NL
API & MCPDocumentatie

Road User Tools agent- en API-platform

Bandenspanning converteren

Converteer tussen pounds per square inch, bar en kilopascal.

Interfaces

POST
REST-eindpunt/api/v1/pressure/convert
MCP
Naam van het gereedschapconvert_pressure

Verzoek

Verzend het verzoek als JSON. MCP-clients geven dezelfde velden door als toolargumenten.

cURLshell
curl -X POST https://roaduser.tools/api/v1/pressure/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "value": 32,
  "from": "psi",
  "to": "bar"
}'
Lichaam aanvragenjson
{
  "value": 32,
  "from": "psi",
  "to": "bar"
}

Reactie

REST verpakt het berekeningsresultaat in de standaard succesenvelop. MCP retourneert dezelfde berekeningsgegevens als de gestructureerde gereedschapsuitvoer.

JSON
{
  "ok": true,
  "data": {
    "input": {
      "value": 32,
      "from": "psi",
      "to": "bar"
    },
    "conversions": {
      "psi": 32,
      "bar": 2.2063223338137603,
      "kpa": 220.632233381376
    },
    "result": 2.2063223338137603
  }
}

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": {
    "value": {
      "type": "number",
      "description": "Pressure value to convert. Must be finite and non-negative."
    },
    "from": {
      "type": "string",
      "enum": [
        "psi",
        "bar",
        "kpa"
      ],
      "description": "Input pressure unit."
    },
    "to": {
      "type": "string",
      "enum": [
        "psi",
        "bar",
        "kpa"
      ],
      "description": "Optional target unit. When omitted, all units are returned."
    }
  },
  "required": [
    "value",
    "from"
  ]
}

Uitvoerschema

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "from": {
          "type": "string",
          "enum": [
            "psi",
            "bar",
            "kpa"
          ]
        },
        "to": {
          "type": "string",
          "enum": [
            "psi",
            "bar",
            "kpa"
          ]
        }
      },
      "required": [
        "value",
        "from"
      ]
    },
    "conversions": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "psi": {
          "type": "number"
        },
        "bar": {
          "type": "number"
        },
        "kpa": {
          "type": "number"
        }
      },
      "required": [
        "psi",
        "bar",
        "kpa"
      ]
    },
    "result": {
      "type": "number",
      "description": "Target-unit result when a target unit is supplied."
    }
  },
  "required": [
    "input",
    "conversions"
  ]
}
API- en MCP-documentatie