Road User Tools エージェント & API プラットフォーム
速度を変換
キロメートル毎時、マイル毎時、メートル毎秒、ノットの間で変換します。
インターフェース
POST
REST エンドポイント
/api/v1/speed/convertMCP
ツール名
convert_speedリクエスト
リクエストを JSON として送信します。 MCP クライアントは、同じフィールドをツール引数として渡します。
cURLshell
curl -X POST https://roaduser.tools/api/v1/speed/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"value": 60,
"from": "mph",
"to": "kmh"
}'リクエストボディjson
{
"value": 60,
"from": "mph",
"to": "kmh"
}応答
REST は、計算結果を標準の成功エンベロープにラップします。 MCP は、構造化ツールの出力と同じ計算データを返します。
JSON
{
"ok": true,
"data": {
"input": {
"value": 60,
"from": "mph",
"to": "kmh"
},
"conversions": {
"kmh": 96.56063999999999,
"mph": 60,
"ms": 26.8224,
"kn": 52.13857451403887
},
"result": 96.56063999999999
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}スキーマ
以下の定義は、入力の検証と出力の説明に使用される完全な JSON スキーマを示しています。
入力スキーマ
{
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number",
"description": "Speed value to convert."
},
"from": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
],
"description": "Input speed unit."
},
"to": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
],
"description": "Optional target unit. When omitted, all units are returned."
}
},
"required": [
"value",
"from"
]
}出力スキーマ
{
"type": "object",
"additionalProperties": false,
"properties": {
"input": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number"
},
"from": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
]
},
"to": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
]
}
},
"required": [
"value",
"from"
]
},
"conversions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kmh": {
"type": "number"
},
"mph": {
"type": "number"
},
"ms": {
"type": "number"
},
"kn": {
"type": "number"
}
},
"required": [
"kmh",
"mph",
"ms",
"kn"
]
},
"result": {
"type": "number",
"description": "Target-unit result when a target unit is supplied."
}
},
"required": [
"input",
"conversions"
]
}