Platforma agentów i API Road User Tools
Przelicz ciśnienie w oponach
Przeliczaj między funtami na cal kwadratowy, barami i kilopaskalami.
Interfejsy
POST
Punkt końcowy REST
/api/v1/pressure/convertMCP
Nazwa narzędzia
convert_pressureŻądanie
Wyślij żądanie jako JSON. Klienci MCP przekazują te same pola, co argumenty narzędzi.
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"
}'Treść żądaniajson
{
"value": 32,
"from": "psi",
"to": "bar"
}Odpowiedź
REST zawija wynik obliczeń w standardową kopertę sukcesu. MCP zwraca te same dane obliczeniowe, co dane wyjściowe narzędzia strukturalnego.
JSON
{
"ok": true,
"data": {
"input": {
"value": 32,
"from": "psi",
"to": "bar"
},
"conversions": {
"psi": 32,
"bar": 2.2063223338137603,
"kpa": 220.632233381376
},
"result": 2.2063223338137603
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Schematy
Poniższe definicje przedstawiają kompletny schemat JSON używany do sprawdzania poprawności wejść i opisywania wyjść.
Schemat wejścia
{
"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"
]
}Schemat wyjścia
{
"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"
]
}