[BUG] Vague MCP-only prompt (e.g. "use XX MCP") triggers "API Error: Tool use input must be a string or object" error before tools/call and stops immediately; well-specified prompts work fine.

Open 💬 0 comments Opened Jul 2, 2026 by plok-lgtm

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

[BUG] Vague MCP-only prompt (e.g. "use XX MCP") triggers "API Error: Tool use input must be a string or object" error before tools/call and stops immediately; well-specified prompts work fine.

Environment
OS: Windows 10
Claude Code CLI version: 2.1.178 (also reproduced on 2.1.149 after downgrading)
Claude Code VSCode extension version: 2.1.178
Reproduces in both surfaces: Yes — confirmed in the Claude Code VSCode extension and in the standalone CLI (claude in PowerShell), independently of each other. Same error, same trigger condition, in both.
Claude model: (loacl custom api with anthropic url)
Node.js version: v25.8.2
MCP servers tested: chrome-devtools-mcp (0.26.0), and other MCP servers (ida-mcp, ghidra mcp)
chrome-devtools-mcp config:
json"chrome-devtools": {
"command": "chrome-devtools-mcp",
"args": ["--no-usage-statistics"]
}

What's Wrong?
When the prompt only names the MCP server without specifying a concrete task (e.g. "use chrome-devtools MCP"), Claude Code fails with the error:
API Error: Tool use input must be a string or object
The MCP debug log (claude --mcp-debug) shows only initialize, tools/list, and roots/list being exchanged with the MCP server — no tools/call is ever sent. This indicates the failure happens client-side, after Claude Code receives a tool_use content block from the model but before it constructs/dispatches the actual MCP tools/call request.
When the prompt instead specifies a concrete, well-formed task (e.g. "use chrome-devtools MCP to open a blank page"), the flow proceeds correctly to tools/call and completes without error.
This suggests that when the prompt is ambiguous, the model may generate a malformed or incomplete tool_use block (e.g. missing required input fields, or a name/input shape Claude Code doesn't expect), and Claude Code does not handle this gracefully — instead of asking the model to retry or surfacing a clear validation error, it throws the generic, hard-to-diagnose message tool use must be string or object and aborts.

What Should Happen?

Expected Behavior
Claude Code should not crash/error out with an opaque message when the model produces an ambiguous or incomplete tool call. It should either:

Reject the malformed tool_use and prompt the model to retry with valid input, or
Surface a clear, actionable error message (e.g. naming which field/tool failed validation and why), rather than the generic tool use must be string or object.

Actual Behavior
Claude Code throws tool use must be string or object and the turn fails entirely, with no tools/call ever reaching the MCP server. This reproduces:

On Windows 10, in both the CLI and the VSCode extension (v2.1.178)
Across multiple Claude Code versions (confirmed on 2.1.178 and 2.1.149), so it doesn't appear to be a regression tied to one release
Across multiple different MCP servers, not just chrome-devtools-mcp

Error Messages/Logs

When the prompt only names the MCP server without specifying a concrete task (e.g. "use chrome-devtools MCP"), Claude Code fails with the error:
API Error: Tool use input must be a string or object
What I've Already Ruled Out
claude doctor reports no issues
claude --safe-mode still reproduces the error
Reproduces in a fresh, empty project directory (not project-config related)
Reproduces with a clean/regenerated .claude.json
Downgrading Claude Code from 2.1.178 to 2.1.149 does not fix it
All tool inputSchema root nodes returned by tools/list have "type": "object" (verified manually)
Not specific to chrome-devtools-mcp — other MCP servers show the same pattern
Not specific to the VSCode extension — the standalone CLI reproduces the same error under the same conditions
The determining factor appears to be prompt specificity, not the MCP server, its schema, or the client surface: vague prompts ("use XX MCP") fail before tools/call; specific task prompts succeed in both CLI and VSCode extension

Steps to Reproduce

Steps to Reproduce
Reproduced identically in both the CLI and the VSCode extension:

Configure any MCP server, e.g.:
json{
"mcpServers": {
"chrome-devtools": {
"command": "chrome-devtools-mcp",
"args": ["--no-usage-statistics"]
}
}
}

CLI: Start Claude Code with claude --mcp-debug
VSCode extension: Open the Claude Code panel in VSCode (extension v2.1.178) with the same MCP config
Send a vague prompt that only names the MCP server without a concrete task, e.g.:

use chrome-devtools MCP

Observe: Claude Code fails with tool use must be string or object, in both the CLI and the VSCode extension. In the CLI, the debug log shows only initialize / tools/list / roots/list — no tools/call is issued.
As a control, restart and send a well-specified prompt instead:

use chrome-devtools MCP to open a blank page

Observe: this completes successfully in both surfaces; the CLI debug log shows a normal tools/call exchange.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.178

Claude Code Version

2.1.178

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Additional Notes
I'd be happy to provide a raw API request/response capture (via ANTHROPIC_BASE_URL pointed at a local logging proxy) showing the malformed tool_use block from the model's response if that would help diagnose this further — let me know what would be useful to attach.

View original on GitHub ↗