API Error: MCP tool names from plugins can exceed 64-character limit
Resolved 💬 3 comments Opened Jan 25, 2026 by visccyberacct Closed Jan 29, 2026
Description
MCP tools from plugins can generate tool names that exceed the Anthropic API's 64-character limit for tool_name fields, causing API validation errors.
Error Message
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.63.content.0.tool_result.content.0.tool_reference.tool_name: String should have at most 64 characters"}}
Root Cause
The MCP tool naming convention for plugins follows this pattern:
mcp__plugin_{plugin-name}_{server-name}__{tool-name}
For plugins with moderately long names, this can exceed 64 characters. Example:
mcp__plugin_jenkins-mcp-plugin_jenkins__jenkins_get_build_console
This is 65 characters - one over the API limit.
Reproduction Steps
- Install a plugin with a long name (e.g.,
jenkins-mcp-plugin) that has an MCP server - Use
ToolSearchto find tools from that plugin - Attempt to use one of the returned tools
- The API returns a 400 error because the tool name exceeds 64 characters
Expected Behavior
Tool names should always be within the API's 64-character limit, regardless of plugin or server naming.
Suggested Fix
Options to consider:
- Shorten the prefix scheme (e.g.,
mcp_p_{plugin}_{server}__{tool}) - Hash or truncate long segments while maintaining uniqueness
- Validate tool name length during plugin loading and warn/error if exceeded
Environment
- Claude Code CLI
- Plugin: jenkins-mcp-plugin (custom MCP server plugin)
- The issue affects any plugin where
plugin-name + server-name + tool-namecreates a combined length > 64 chars
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗