[BUG] MCP tool names with UUIDs exceed 64-character API 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?
When connecting to certain MCP servers (e.g., Notion), Claude Code generates tool names that exceed the 64-character limit, causing API errors and getting stuck in a loop.
What Should Happen?
Tool names should be kept within the 64-character API limit. The UUID prefix should be shortened or an alternative naming scheme used.
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.40.content.0.tool_result.content.0.tool_reference.tool_name: String should have at most 64 characters"}}
Problematic tool name: mcp__5ae21acc-5fda-4317-803f-1a7a34a38c3d__notion-update-data-source (71 characters)
Steps to Reproduce
- Install the Notion MCP connector via Claude Desktop or Claude Code
- Start a session that uses the Notion MCP tools
- The tool name generated includes a UUID prefix, making it exceed 64 characters
- API errors occur and the session gets stuck in a loop
<img width="2048" height="1152" alt="Image" src="https://github.com/user-attachments/assets/ae1dec9e-cb58-43d6-8ae1-3292a106c4c4" />
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
2.1.12 (Claude Code)
Claude Code Version
2.1.12 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The issue persists in the session even after removing the MCP server from configuration. Starting a new session resolves it since the problematic tool name is no longer in the conversation history.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗