Mariner GPS Tools-ontwikkelaarsplatform
Initiële ware koers berekenen
Initiële koers tussen twee punten berekenen
Interfaces
POST
REST-eindpunt
/api/v1/bearingMCP
Naam van het gereedschap
calculate_bearingVerzoek
Verzend het verzoek als JSON. MCP-clients geven dezelfde velden door als toolargumenten.
cURLshell
curl -X POST https://marinergps.tools/api/v1/bearing \
-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
}
}'Lichaam aanvragenjson
{
"from": {
"lat": 50.1,
"lng": -4.2
},
"to": {
"lat": 49.8,
"lng": -3.1
}
}Reactie
REST verpakt het berekeningsresultaat in de standaard succesenvelop. MCP retourneert dezelfde berekeningsgegevens als de gestructureerde gereedschapsuitvoer.
JSON
{
"ok": true,
"data": {
"degrees": 112.54786806700503,
"compass": "ESE"
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Schema's
De onderstaande definities tonen het volledige JSON-schema dat wordt gebruikt om invoer te valideren en uitvoer te beschrijven.
Invoerschema
{
"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"
]
}Uitvoerschema
{
"type": "object",
"additionalProperties": false,
"properties": {
"degrees": {
"type": "number"
},
"compass": {
"type": "string"
}
},
"required": [
"degrees",
"compass"
]
}