MCP ツールが誤った引数で呼ばれる原因をデバッグする
使うタイミング: ツールをリリースしたが、Claude が誤った引数で呼び続けるとき。
前提条件
- Inspector の起動 — npx -y @mcpjam/inspector(ブラウザで localhost:6274 が開く)
- 作成した MCP サーバー — stdio コマンドまたは SSE URL で起動できる状態にしておく
フロー
-
サーバーに接続するIn the inspector UI, add a stdio server: command=node, args=[./dist/server.js].✓ コピーしました→ ツール一覧が説明とスキーマ付きで表示される
-
LLM からの見え方を確認するLook at the rendered description in the tool detail panel — that's exactly what the model sees.✓ コピーしました→ 曖昧な箇所を発見できる(「id」は「task_id」であるべき、例が不足しているなど)
-
誤使用を再現するOpen Chat tab. Send the user prompt that caused the failure. Watch the tool_use payload.✓ コピーしました→ 本番環境と同じ誤った呼び出しが再現される
-
説明を修正して再テストUpdate the tool's description and example in your server code, restart, retry the same prompt.✓ コピーしました→ 今度は正しい呼び出しが行われる
結果: 証拠に基づいた修正前後の比較による具体的な改善。
注意点
- サーバー再起動後もスキーマがキャッシュされたまま — サーバーパネルの「Reconnect」をクリックする。Inspector が list_tools を再取得する