API & MCP
Everything a person can do on Ohmforge Magnetic Declination (WMM2025), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgemagneticdeclination.usefulweb.app/api/v1/calculate– run Ohmforge Magnetic Declination (WMM2025)GET https://ohmforgemagneticdeclination.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge Magnetic Declination (WMM2025)
Computes the Earth's main magnetic field with the World Magnetic Model WMM2025 of NOAA and the British Geological Survey: declination (how far a compass needle points away from true north), inclination, horizontal and total field strength, the yearly change and the grid variation near the poles. Optionally converts a compass bearing to a true bearing. Same model as the compass in Ohmforge's Pocket instruments.
| Field | Type | Default | Description |
|---|---|---|---|
latitude | number | 52.52 | Latitude. North positive, south negative (WGS84). |
longitude | number | 13.405 | Longitude. East positive, west negative. |
height | number | 0 | Height above sea level. Treated as height above the WGS84 ellipsoid; the difference (up to about 100 m) does not matter here. |
date | text | — | Date. YYYY-MM-DD or a decimal year such as 2027.5, between 2025.0 and 2030.0. Empty = today. |
bearing | number | — | Compass bearing to convert (optional). A magnetic bearing read from a compass; the result adds the declination to get the true bearing. |
Example request
Berlin, 8 November 2026
curl -X POST https://ohmforgemagneticdeclination.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"latitude":52.52,"longitude":13.405,"height":34,"date":"2026-11-08"}'
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://ohmforgemagneticdeclination.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_magnetic_declination - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-magnetic-declination
{
"mcpServers": {
"ohmforge-magnetic-declination": { "type": "http", "url": "https://ohmforgemagneticdeclination.usefulweb.app/mcp" }
}
}