API & MCP
Everything a person can do on Electric & Magnetic Field Line Plotter, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://prooflinefieldlines.usefulweb.app/api/v1/calculate– run Electric & Magnetic Field Line PlotterGET https://prooflinefieldlines.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Electric & Magnetic Field Line Plotter
Place point charges (in nC) and long straight wires (in A) in a plane and get a drawing of the electric field lines from positive to negative charges, the magnetic field loops around the wires and the equipotential lines, traced numerically from Coulomb’s law and the Biot–Savart law. The number of lines per charge follows Gauss’s law; probe points give the exact field strength, direction, potential and magnetic flux density. Part of the Proofline math notebook.
| Field | Type | Default | Description |
|---|---|---|---|
sources (required) | textarea | — | Charges and wires (one per line). “charge q x y” is a point charge q in nC at (x, y) in cm; “wire I x y” is a long straight wire carrying I amperes out of the page (negative: into the page). At most 16 lines; # starts a comment. |
linesPerUnit | number | 8 | Field lines per nC (or per 2 A) |
equipotentials | boolean | true | Draw equipotential lines |
extent | number | — | View half-height (cm). Empty: fit the view around the sources. |
probes | textarea | — | Probe points (optional). One point per line: x and y in cm. The table lists E, the potential and B there (at most 20). |
Example request
Electric dipole with probes on the axis and the bisector
curl -X POST https://prooflinefieldlines.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"sources":"charge 1 -2 0\ncharge -1 2 0","probes":"0 0.0001\n0 3\n6 0"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://prooflinefieldlines.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
proofline_field_lines - Local stdio connector:
node src/mcp-stdio.ts --tool=proofline-field-lines
{
"mcpServers": {
"proofline-field-lines": { "type": "http", "url": "https://prooflinefieldlines.usefulweb.app/mcp" }
}
}