Mariner GPS Tools Developer Platform
Calculate great-circle distance
Calculate great-circle and rhumb-line distances between two positions.
Interfaces
POST
REST endpoint
/api/v1/distanceMCP
Tool name
calculate_distanceRequest
Send the request as JSON. MCP clients pass the same fields as tool arguments.
cURLshell
curl -X POST https://marinergps.tools/api/v1/distance \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"from": {
"lat": 50.1,
"lng": -4.2
},
"to": {
"lat": 49.8,
"lng": -3.1
}
}'Request bodyjson
{
"from": {
"lat": 50.1,
"lng": -4.2
},
"to": {
"lat": 49.8,
"lng": -3.1
}
}Response
REST wraps the calculation result in the standard success envelope. MCP returns the same calculation data as structured tool output.
JSON
{
"ok": true,
"data": {
"km": 85.48058951328396,
"nm": 46.15584267182427,
"mi": 53.11515938645877,
"m": 85480.58951328397,
"ft": 280448.0415605023,
"greatCircleBearing": {
"degrees": 112.54786806700503,
"compass": "ESE"
},
"rhumbLine": {
"km": 85.4813587821647,
"nm": 46.15625804394131,
"mi": 53.115637387832464,
"m": 85481.35878216471,
"ft": 280450.56540775544,
"bearing": {
"degrees": 112.96963655680418,
"compass": "ESE"
}
}
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Schemas
The definitions below show the complete JSON Schema used to validate inputs and describe outputs.
Input schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"from": {
"type": "object",
"additionalProperties": false,
"properties": {
"lat": {
"type": "string",
"description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
},
"lng": {
"type": "string",
"description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
}
},
"required": [
"lat",
"lng"
]
},
"to": {
"type": "object",
"additionalProperties": false,
"properties": {
"lat": {
"type": "string",
"description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
},
"lng": {
"type": "string",
"description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
}
},
"required": [
"lat",
"lng"
]
}
},
"required": [
"from",
"to"
]
}Output schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"nm": {
"type": "number"
},
"mi": {
"type": "number"
},
"km": {
"type": "number"
},
"m": {
"type": "number"
},
"ft": {
"type": "number"
},
"greatCircleBearing": {
"type": "object",
"properties": {
"degrees": {
"type": "number"
},
"compass": {
"type": "string"
}
},
"required": [
"degrees",
"compass"
]
},
"rhumbLine": {
"type": "object",
"properties": {
"nm": {
"type": "number"
},
"mi": {
"type": "number"
},
"km": {
"type": "number"
},
"m": {
"type": "number"
},
"ft": {
"type": "number"
},
"bearing": {
"type": "object",
"properties": {
"degrees": {
"type": "number"
},
"compass": {
"type": "string"
}
},
"required": [
"degrees",
"compass"
]
}
},
"required": [
"nm",
"mi",
"km",
"m",
"ft",
"bearing"
]
}
},
"required": [
"nm",
"mi",
"km",
"m",
"ft",
"greatCircleBearing",
"rhumbLine"
]
}