TL
API & MCPDokumentasyon

Platform ng Developer ng Mariner GPS Tools

Kalkulahin ang paunang true bearing

Kalkulahin ang paunang bearing sa pagitan ng dalawang punto

Mga interface

POST
REST endpoint/api/v1/bearing
MCP
Pangalan ng toolcalculate_bearing

Kahilingan

Ipadala ang kahilingan bilang JSON. Ang mga kliyente ng MCP ay pumasa sa parehong mga field bilang mga argumento ng tool.

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

Tugon

Binabalot ng REST ang resulta ng pagkalkula sa karaniwang sobre ng tagumpay. Ibinabalik ng MCP ang parehong data ng pagkalkula bilang output ng structured tool.

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

Mga scheme

Ang mga kahulugan sa ibaba ay nagpapakita ng kumpletong JSON Schema na ginamit upang patunayan ang mga input at ilarawan ang mga output.

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": {
    "degrees": {
      "type": "number"
    },
    "compass": {
      "type": "string"
    }
  },
  "required": [
    "degrees",
    "compass"
  ]
}
API at MCP dokumentasyon