[BUG]New session fails with tool name validation error from a connected MCP connector
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
Starting a brand new chat session throws a validation error before I send any message:
tools.138.FrontendRemoteMcpToolDefinition.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'
This appears to be a tool definition sourced from one of my connected MCP connectors whose combined
tool name (server-id prefix + tool name) exceeds the 64-character limit or otherwise fails the
required ^[a-zA-Z0-9_-]{1,64}$ naming pattern. The whole session's tool list build seems to fail
validation because of this one entry, blocking normal use of the home screen.
Steps to reproduce
- Open a new chat session with multiple MCP connectors linked (I have a large number connected,
including a Facebook/Instagram management connector whose native tool names are quite long,
e.g. facebook_get_conversation_messages, instagram_create_carousel_container).
- The error appears immediately: tools.138.FrontendRemoteMcpToolDefinition.name: String should
match pattern '^[a-zA-Z0-9_-]{1,64}$'
Expected behavior
A single connector's tool with an invalid/too-long name should either be dropped/skipped, or the
platform should truncate/hash long combined names, rather than failing validation for the entire
session's toolset.
Suspected cause
Combined tool names appear to be built as mcp__<36-char-server-id>__<tool-name>. For connectors
with long native tool names, this prefix pushes the combined string past 64 characters
(e.g. 5 + 36 + 2 + ~35 = ~78 chars), which fails the {1,64} length cap in the naming pattern.
Environment
- Client: Claude (chat/session home screen)
- Model: Claude Sonnet 5
- Date observed: 07-11-26
What Should Happen?
A single connector's tool with an invalid or too-long name should be dropped or skipped
(or the platform should truncate/hash long combined names), rather than failing
validation for the entire session's toolset and blocking the home screen.
Error Messages/Logs
tools.138.FrontendRemoteMcpToolDefinition.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'
Steps to Reproduce
- Have multiple MCP connectors linked to the account, including at least one whose
native tool names are long (e.g. facebook_get_conversation_messages,
instagram_create_carousel_container).
- Open a brand new chat session.
- The session fails before any message is sent, with:
tools.138.FrontendRemoteMcpToolDefinition.name: String should match pattern
'^[a-zA-Z0-9_-]{1,64}$'
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.149
Claude Code Version
v2.1.150
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_