API Error: MCP tool_reference.tool_name exceeds 64 character limit

Resolved 💬 3 comments Opened Jan 28, 2026 by TechnicalRhino Closed Feb 1, 2026

Description

When using the Slack MCP server (@modelcontextprotocol/server-slack), Claude Code throws an API error because a tool name exceeds the 64-character limit.

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

  1. Configure Slack MCP server in ~/.claude.json:
"slack": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-slack"],
  "env": {
    "SLACK_BOT_TOKEN": "xoxb-...",
    "SLACK_TEAM_ID": "...",
    "SLACK_CHANNEL_IDS": "..."
  }
}
  1. Try to use any Slack tool (e.g., slack_post_message)
  2. Error occurs before/after the tool executes

Expected Behavior

Tool should execute successfully without API errors.

Actual Behavior

API returns 400 error with tool_reference.tool_name validation failure.

Environment

  • Claude Code version: Latest (CLI)
  • OS: macOS (Darwin 25.0.0)
  • MCP Server: @modelcontextprotocol/server-slack (latest via npx)

Analysis

The error path messages.10.content.0.tool_result.content.2.tool_reference.tool_name suggests the issue occurs inside a tool result response, not during tool registration. The MCP server might be returning a response that references another tool with a name exceeding 64 characters.

This could be:

  1. An issue with how Claude Code prefixes MCP tool names (e.g., mcp__slack__slack_post_message)
  2. An issue with the Slack MCP server including tool references in its responses
  3. A combination of both

Additional Context

The Anthropic API enforces a 64-character limit on tool names. MCP tool names are prefixed with mcp__{server}__{tool}, which can easily exceed this limit with longer server names or tool names.

---
🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗