Model Context Protocol · api · fg-0527

MCP tool names with dots are valid in MCP but rejected when forwarded to the Claude API

If you see 400 invalid_request_error on a tools[].name when a custom client passes MCP tools straight to Claude, the cause and the fix for Model Context Protocol are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
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

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun