TL
API & MCPDokumentasyon

Platform ng Developer ng Mariner GPS Tools

I-convert ang mga bilis

I-convert ang mga unit ng bilis

Mga interface

POST
REST endpoint/api/v1/speed/convert
MCP
Pangalan ng toolconvert_speed

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/speed/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "value": 12,
  "from": "kn",
  "to": "kmh"
}'
Humiling ng katawanjson
{
  "value": 12,
  "from": "kn",
  "to": "kmh"
}

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": {
    "input": {
      "value": 12,
      "from": "kn",
      "to": "kmh"
    },
    "conversions": {
      "kn": 12,
      "mph": 13.80935337628251,
      "kmh": 22.224,
      "ms": 6.173333333333334,
      "fts": 20.253718285214347
    },
    "result": 22.224
  }
}

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": {
    "value": {
      "type": "number",
      "description": "Speed value to convert."
    },
    "from": {
      "type": "string",
      "enum": [
        "kn",
        "mph",
        "kmh",
        "ms",
        "fts"
      ],
      "description": "Input speed unit."
    },
    "to": {
      "type": "string",
      "enum": [
        "kn",
        "mph",
        "kmh",
        "ms",
        "fts"
      ],
      "description": "Optional target unit. When omitted, all units are returned."
    }
  },
  "required": [
    "value",
    "from"
  ]
}

Output schema

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "from": {
          "type": "string",
          "enum": [
            "kn",
            "mph",
            "kmh",
            "ms",
            "fts"
          ]
        },
        "to": {
          "type": "string",
          "enum": [
            "kn",
            "mph",
            "kmh",
            "ms",
            "fts"
          ]
        }
      },
      "required": [
        "value",
        "from"
      ]
    },
    "conversions": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kn": {
          "type": "number"
        },
        "mph": {
          "type": "number"
        },
        "kmh": {
          "type": "number"
        },
        "ms": {
          "type": "number"
        },
        "fts": {
          "type": "number"
        }
      },
      "required": [
        "kn",
        "mph",
        "kmh",
        "ms",
        "fts"
      ]
    },
    "result": {
      "type": "number",
      "description": "Target-unit result when a target unit is supplied."
    }
  },
  "required": [
    "input",
    "conversions"
  ]
}
API at MCP dokumentasyon