[BUG] API Error 400: MCP tool names exceeding 64 character limit
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?
Description
When using MCP tools with long names, Claude Code throws an API error because the combined tool name exceeds the
64-character limit enforced by the API.
## Error Message
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.6.content.0.tool_result.c
ontent.0.tool_reference.tool_name: String should have at most 64 characters"}}
## Root Cause
MCP tool names follow the pattern mcp__[server_name]__[tool_name]. When the server name and tool name are both
lengthy, the combined string exceeds 64 characters.
Examples from Zapier MCP integration:
mcp__claude_ai_Zapier__google_sheets_lookup_spreadsheet_rows_advanced(70 chars)mcp__claude_ai_Zapier__google_calendar_create_detailed_event(61 chars)
The error triggers when Claude references a tool result from a long-named tool in subsequent messages.
## Environment
- Claude Code CLI
- MCP server: Zapier integration (server name:
claude_ai_Zapier) - Affected tools: Primarily Google Sheets, Google Calendar, and other multi-word tool names
## Workaround
Avoid using MCP tools with long names, or reconfigure MCP servers to use shorter server names.
What Should Happen?
## Expected Behavior
Claude Code should either:
- Truncate/hash long tool names to stay within API limits
- Warn users during MCP configuration if tool names will exceed limits
- Handle the naming collision gracefully
Error Messages/Logs
<img width="948" height="106" alt="Image" src="https://github.com/user-attachments/assets/636420a8-c3e1-4452-81f0-0982381fd9fb" />
Steps to Reproduce
- Configure an MCP server with a moderately long name (e.g.,
claude_ai_Zapier) - Start a Claude Code session
- Use ToolSearch to load a tool with a long name (e.g.,
select:mcp__claude_ai_Zapier__google_sheets_lookup_spreadsheet_rows_advanced)
- Execute the tool successfully
- Continue the conversation where Claude needs to reference the tool result
- Error triggers on the follow-up message
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.20
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
15 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Getting this error now as well. API seems broken.
+1
+1 having this issue since todos update came out
Same for me
Please fix 😬
used to be 128 I believe
The documentation says 64:
https://platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use#specifying-client-tools
and was 64 on 2025-12-01:
https://web.archive.org/web/20251201051248/https://platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use
but might have been changed to 128 here:
https://github.com/anthropics/claude-code/issues/2579
+1 - Current workaround is to remove the
"ENABLE_TOOL_SEARCH": "true"flag in~/.claude/settings.json+1
@edgeq thank you for the workaround, it's working for me
+1 Encountering this same issue.
Environment:
Error:
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.6.content.0.tool_result.content.0.tool_reference.tool_name: String
should have at most 64 characters"},"request_id":"req_011CXfqCcYZf3GMnXcwRjj4m"}
Reproduction scenario:
My case involved using an MCP tool (JIRA integration) after running git diff HEAD --name-only on files with long nested paths. The issue seems to
occur when Claude constructs tool references that include long file paths or action names.
Critical impact: Once this error occurs, the conversation becomes permanently unrecoverable—resuming replays the same error every time, forcing
complete loss of context. This is especially painful in long multi-step workflows.
Extremely frustrating when mcps are shipped as claude plugins, via marketplace. That adds up to the tool name, impossible to fit in 64 chars. @bcherny can you take a look? There are so many open requests on this problem.
I'm pretty sure I saw a comment this was fixed back in August 2025, but cannot find it any more.
Still happening
any update ?
The 64-char cap on
tool_reference.tool_namewas bumped to 256 server-side back in early Feb, no CC upgrade needed. The 69-char name in the OP is fine now.There's a "still happening" comment from March with no details. If anyone can still repro, reopen with the
request_id.