Road User Tools エージェント & API プラットフォーム
出力を変換
キロワット、英馬力、メートル馬力(PS)の間で変換します。
インターフェース
POST
REST エンドポイント
/api/v1/power/convertMCP
ツール名
convert_powerリクエスト
リクエストを JSON として送信します。 MCP クライアントは、同じフィールドをツール引数として渡します。
cURLshell
curl -X POST https://roaduser.tools/api/v1/power/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"value": 150,
"from": "kw",
"to": "hp"
}'リクエストボディjson
{
"value": 150,
"from": "kw",
"to": "hp"
}応答
REST は、計算結果を標準の成功エンベロープにラップします。 MCP は、構造化ツールの出力と同じ計算データを返します。
JSON
{
"ok": true,
"data": {
"input": {
"value": 150,
"from": "kw",
"to": "hp"
},
"conversions": {
"kw": 150,
"hp": 201.1533134392542,
"ps": 203.94324259558564
},
"result": 201.1533134392542
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}スキーマ
以下の定義は、入力の検証と出力の説明に使用される完全な JSON スキーマを示しています。
入力スキーマ
{
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number",
"description": "Power value to convert. Must be finite and non-negative."
},
"from": {
"type": "string",
"enum": [
"kw",
"hp",
"ps"
],
"description": "Input power unit. hp is mechanical horsepower; ps is metric horsepower (PS)."
},
"to": {
"type": "string",
"enum": [
"kw",
"hp",
"ps"
],
"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": [
"kw",
"hp",
"ps"
]
},
"to": {
"type": "string",
"enum": [
"kw",
"hp",
"ps"
]
}
},
"required": [
"value",
"from"
]
},
"conversions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kw": {
"type": "number"
},
"hp": {
"type": "number"
},
"ps": {
"type": "number"
}
},
"required": [
"kw",
"hp",
"ps"
]
},
"result": {
"type": "number",
"description": "Target-unit result when a target unit is supplied."
}
},
"required": [
"input",
"conversions"
]
}