[Bug] API Error 400: MCP tool_use.name exceeds 200 character limit, blocking all messages
Bug Description
After extended usage in a session, Claude Code becomes completely unresponsive to any input.
Every message (even simple ones like "hi") returns a 400 error indicating that a tool_use.name field exceeds the 200 character API limit.
The error references messages.35.content.1.tool_use.name, suggesting that a tool name in the conversation history is too long, likely from an MCP server with a long namespaced tool name.
Expected Behavior
Claude Code should either:
- Truncate or validate tool names before sending to the API
- Handle MCP tool names that approach the 200 character limit
- Provide a more actionable error message
Actual Behavior
Session becomes completely unusable. Any message returns:
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.35.content.1.tool_use.name: String should have at most 200 characters"}}
Environment
- Version: 2.0.76
- Platform: macOS (darwin)
- Terminal: tmux
- Feedback ID: cb078242-4561-486a-b4de-0083c6c9f259
MCP list
claude-in-chrome
context7
playwright
Workaround
Starting a new conversation (/clear or new session) temporarily resolves the issue until long tool names are used again.
Screenshot
<img width="888" height="266" alt="Image" src="https://github.com/user-attachments/assets/de311077-c010-4949-a991-8a8efe9c52cc" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗