docs/design/mcp-tool-name-provider-compatibility.md
Qwen Code currently accepts MCP tool names using Gemini's character set. Names such as literature.search_pubmed become mcp__server__literature.search_pubmed, which Gemini accepts but stricter OpenAI-compatible and Anthropic-compatible endpoints may reject before the tool can run.
The same raw name is reconstructed independently for registration, permission persistence, reconnect lookup, output truncation, and restored history. Changing only the provider request would therefore make the model-visible name differ from the registry key.
Use one deterministic provider-safe normalization rule for MCP tool names:
^[A-Za-z][A-Za-z0-9_-]*$ and at most 63 characters.No provider-specific alias table is introduced. Legal existing names remain byte-for-byte unchanged, so Gemini behavior and normal built-in tools are unaffected.
Restored names produced by the previous middle-truncation algorithm are already provider-safe and remain unchanged in historical messages. Their removed middle cannot be reconstructed reliably, so converters do not guess a new hash-based name; exact permission and disabled-tool compatibility instead uses the raw-name alias available during MCP registration.