[BUG] ToolSearch Creates tool_reference Objects Exceeding 64-Character API Limit makes claude code unresponsive
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?
Environment
Claude Code Version: 2.1.29 (latest as of 2026-02-01)
OS: macOS tahoe
MCP Server: IBM FlashSystem MCP (stdio-based)
Comparison Client: Codex (handles same MCP server without issues)
Description
Claude Code's ToolSearch tool creates tool_reference objects that exceed the Claude API's 64-character tool name limit, causing complete conversation failure and making certain MCP servers unusable.
Critical Impact
Severity: Critical - Completely breaks Claude Code functionality:
- Entire conversation becomes unresponsive after ToolSearch executes
- Claude Code cannot display any responses (stuck/frozen)
- Users must disable affected MCP servers to recover
- Prevents use of legitimate MCP servers with reasonable tool names
Error Details
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.154.content.0.tool_result.content.0.tool_reference.tool_name: String should have at most 64 characters"
},
"request_id": "req_011CXgofvhjjsvvX622ot7ob"
}
Error Location: tool_result.content.0.tool_reference.tool_name
This indicates the issue is in how Claude Code constructs tool_reference objects, not in the actual tool names themselves.
What Should Happen?
The 64-character limit is reasonable, but Claude Code shouldn't be adding metadata that pushes valid tool names over the limit.
MCP servers with tool names under 64 characters should work
Tool discovery should succeed without API errors
tool_reference objects should respect API limits
Claude Code should handle tools the same way Codex does
Error Messages/Logs
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.154.content.0.tool_result.content.0.tool_reference.tool_name: String should have at most 64 characters"
},
"request_id": "req_011CXgofvhjjsvvX622ot7ob"
}
Steps to Reproduce
- Configure an MCP server with tools that have names longer than 64 characters (e.g., IBM FlashSystem MCP)
(https://github.com/IBM/ibm-flashsystems-mcpserver)
- Load the MCP server in Claude Code
- Use ToolSearch or similar tool discovery mechanism
- Claude Code creates tool_reference objects with names exceeding 64 characters
- When sending the tool results back to the Claude API, the conversation fails with "String should have at most 64 characters" error
- Claude Code becomes stuck/unresponsive
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.29
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The exact same MCP server configuration works flawlessly in Codex
When Claude Code's ToolSearch returns MCP tools, it creates tool_reference objects that apparently include:
Additional metadata
Prefixes or namespacing
MCP server identifiers
Or other data that pushes the total over 64 characters
This transformation happens inside Claude Code, not in the MCP server.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗