-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Description
Description
When using @modelcontextprotocol/server-slack with Claude Code, an API error occurs because a tool_reference.tool_name in the response exceeds the 64-character limit enforced by the Anthropic API.
Error Message
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.10.content.0.tool_result.content.2.tool_reference.tool_name: String should have at most 64 characters"},"request_id":"req_011CXa13UuZz4NJ9bb7mURZb"}
Steps to Reproduce
- Configure Slack MCP server with Claude Code
- Attempt to use any Slack tool (e.g., post a message)
- API error occurs
Expected Behavior
Tool should execute successfully.
Actual Behavior
API returns 400 error due to tool name length validation failure.
Analysis
The error path tool_result.content.2.tool_reference.tool_name indicates the issue is in the tool result content, suggesting the Slack MCP server might be:
- Returning responses that include references to other tools
- Including tool names in its response content that, when prefixed by the client (e.g.,
mcp__slack__), exceed 64 characters
When MCP clients prefix tool names (e.g., mcp__{server}__{tool}), the combined name can easily exceed the API's 64-character limit.
Environment
- Package:
@modelcontextprotocol/server-slack(latest via npx) - Client: Claude Code CLI
- OS: macOS
Suggested Fix
Consider:
- Ensuring tool names exposed by the server are short enough to accommodate client prefixes
- Not including tool references in response content, or using shortened identifiers
- Documenting maximum recommended tool name lengths for MCP servers
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels