- Symptom
- 400 invalid_request_error on a tools[].name when a custom client passes MCP tools straight to ClaudeA tool such as admin.tools.list works in one MCP client and breaks a home-grown agent
- Cause
- The MCP spec lets tool names use letters, digits, underscore, hyphen, and dot, up to 128 characters. The Claude API requires names to match ^[a-zA-Z0-9_-]{1,128}$, so a dot fails.
- Fix
- Name tools with letters, digits, underscores, and hyphens only, or map names in the client before sending them to the model and map them back on tool_use.
- Apply
const safe = (n) => n.replace(/[^a-zA-Z0-9_-]/g, '_').slice(0, 128); // keep a map from safe name to original- Affected
- MCP protocol 2025-11-25 and later tool naming; Claude Messages API tool name pattern, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders