IT
API & MCPDocumentazione

Piattaforma per sviluppatori Mariner GPS Tools

Calcola il rilevamento vero iniziale

Calcola il rilevamento iniziale tra due punti

Interfacce

POST
Punto finale REST/api/v1/bearing
MCP
Nome dello strumentocalculate_bearing

Richiesta

Invia la richiesta come JSON. I client MCP passano gli stessi campi degli argomenti dello strumento.

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
  }
}'
Richiedi corpojson
{
  "from": {
    "lat": 50.1,
    "lng": -4.2
  },
  "to": {
    "lat": 49.8,
    "lng": -3.1
  }
}

Risposta

REST racchiude il risultato del calcolo nella busta di successo standard. MCP restituisce gli stessi dati di calcolo dell'output strutturato dello strumento.

JSON
{
  "ok": true,
  "data": {
    "degrees": 112.54786806700503,
    "compass": "ESE"
  }
}

Schemi

Le definizioni seguenti mostrano lo schema JSON completo utilizzato per convalidare gli input e descrivere gli output.

Schema di input

{
  "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"
  ]
}

Schema di output

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "degrees": {
      "type": "number"
    },
    "compass": {
      "type": "string"
    }
  },
  "required": [
    "degrees",
    "compass"
  ]
}
Documentazione API e MCP