CLI: coerce --tool-arg values using the tool's inputSchema (zip=10001 is sent as a number to a string field)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- cli
調査の方向性
Start in the CLI's --tool-arg parsing and the tool lookup that already produces tool_not_found and reads inputSchema, since the coercion has to use that schema. The --prompt-args handling after #2859 is the reference for keeping string values verbatim. Done when zip=10001 reaches a string field unchanged, a non-parsing value for a number field gives a usage error naming the key, and --tool-args-json behaves as before.
索引モデルが issue の本文から書いたものです。
説明
Which client?
CLI
The problem
--tool-arg JSON-parses every value, so zip=10001 is sent as the number 10001. A tool whose inputSchema declares zip as string rejects the call:
mcp-inspector --cli node server.mjs --method tools/call --tool-name echo_typed --tool-arg zip=10001
→ Input validation error: ... zip: Invalid input: expected string, received number (exit 5)
The behaviour is documented (count=1 becomes a number), but it makes --tool-arg unreliable for ZIP codes, IDs, phone numbers, versions (1.10 → 1.1) and other numeric-looking strings. Users have to know to switch to --tool-args-json and quote everything. Verified on 2.17.0 (main @ 2069a1a).
Solution you have in mind (optional)
The CLI already looks the tool up (tool_not_found, --strict), so it has the inputSchema. Coerce each key=value by the declared type of that property:
type: "string"→ keep the raw text verbatim (as--prompt-argsnow does after #2859)number/integer/boolean/object/array→ JSON-parse as today, and fail with a usage error naming the key if it doesn't parse to that type- no schema for the key, or a union type → current behaviour
The same applies to mcpdo's --tool-arg and key:=value positionals. --tool-args-json stays verbatim. That matches #2171, which kept raw JSON in the web client from being retyped by the schema; this request only covers key=value text.
Alternatives or workarounds you have tried
--tool-args-json '{"zip":"10001"}', or --tool-arg zip='"10001"'. Both work but need shell quoting, which is especially awkward in PowerShell and cmd.
Already built it locally?
No response
Before you submit
- I searched existing issues and this is not a duplicate.
- This is a request for the Inspector itself, not for the MCP specification or an SDK.
- 主要言語
- TypeScript
- スター
- 11.3k
- フォーク
- 1.6k
- 平均マージ
- 2時間 28分
- マージ済み PR(30日)
- 111
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/inspector のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
modelcontextprotocol/inspector#3073 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
modelcontextprotocol/inspector#3072 ·
メンテナーはふだん 1 日以内に返信
-
CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it furtherオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/inspector#3071 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/inspector#3069 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/inspector#3067 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/inspector の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mckinsey/agents-at-scale-ark#4091 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NUS-Project-SaBai/project-sabai#386 ·
メンテナーはふだん 3 日以内に返信
-
android needs clarification
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
super-productivity/super-productivity#12105 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信