IT
API & MCPDocumentazione

Piattaforma per agenti e API Road User Tools

Converti la pressione degli pneumatici

Converti tra libbre per pollice quadrato, bar e kilopascal.

Interfacce

POST
Punto finale REST/api/v1/pressure/convert
MCP
Nome dello strumentoconvert_pressure

Richiesta

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

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"
}'
Richiedi corpojson
{
  "value": 32,
  "from": "psi",
  "to": "bar"
}

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": {
    "input": {
      "value": 32,
      "from": "psi",
      "to": "bar"
    },
    "conversions": {
      "psi": 32,
      "bar": 2.2063223338137603,
      "kpa": 220.632233381376
    },
    "result": 2.2063223338137603
  }
}

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

Schema di output

{
  "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"
  ]
}
Documentazione API e MCP