Skip to content

[Bug]: Meta Muse (api.meta.ai) rejects MCP tool names longer than 64 characters — full catalog fails with 400 #4410

Description

@dangdh08

Client or integration

Other

ZCode connects to the proxy over OpenAI-compatible http://127.0.0.1:10100/v1 (chat completions translated to Responses).

Provider or upstream service

meta-muse (https://api.meta.ai/v1)

OpenCodex version

2.51.0 (also reproduced on 2.50.0, npm @bitkyc08/opencodex, macOS)

Endpoint or capability

/v1/chat/completions with function tools (translated to Responses); tool declarations, tool_choice, tool-call history

Current behaviour

Requesting meta-muse/muse-spark-1.3-contributor fails with HTTP 400 when the request carries MCP tool names longer than 64 characters. ZCode sends fully-namespaced MCP tool names (for example mcp__plugin_huggingface-skills_huggingface-skills__hub_repo_search, 66 characters), and the whole turn is rejected before any tool is called. The long function names are forwarded to api.meta.ai verbatim. Disabling plugins avoids the error but loses tools.

Expected behaviour

For this strict Responses endpoint, opencodex should keep the full tool catalog but send collision-safe short wire names (at most 64 characters) upstream, then restore the original names in tool calls, tool_choice and history before returning to the client — the same pattern as the existing namespace/custom/tool-search alias restores. Arguments, user text and schema property names must not be renamed. Other providers unchanged.

Minimal redacted request or reproduction

# 1. Start opencodex with the meta-muse provider (https://api.meta.ai/v1, OAuth) on port 10100.
# 2. Send a chat-completions request for meta-muse/muse-spark-1.3-contributor with one
#    placeholder function tool whose name is 66 characters long (66 x "t"), empty object schema.
#    Message: "Reply with exactly OK. Do not call tools."

curl -s http://127.0.0.1:10100/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model": "meta-muse/muse-spark-1.3-contributor", "stream": false,
  "messages": [{"role": "user", "content": "Reply with exactly OK. Do not call tools."}],
  "tools": [{"type": "function", "function": {"name": "tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt", "description": "probe", "parameters": {"type": "object", "properties": {}}}}}]}'

# 3. Observe HTTP 400 (body below).
# 4. Repeat with a 64-character name: HTTP 200, reply "OK".

Real-session evidence: a failing ZCode turn carried 93 tools, 20 of them over 64 characters, for example mcp__plugin_huggingface-skills_huggingface-skills__hub_repo_search (66), mcp__plugin_huggingface-skills_huggingface-skills__hub_repo_details (67), mcp__plugin_android-emulator_android-emulator__android_install_app (66), plus more android-emulator and microsoft-docs names. Replaying the exact 93-name catalog fails with the same 400; the same catalog with only short aliases returns 200.

Actual response or error

HTTP 400
{"error":{"message":"`name` must be at most 64 characters, got 66","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}

Upstream documentation

No public specification found for the 64-character tool-name limit on api.meta.ai; the limit is observed empirically (66-character name returns HTTP 400 invalid_request_error, 64-character name returns HTTP 200).

Suggested mapping or implementation notes

Same pattern as the existing routed namespace/custom/tool-search alias restores: generate deterministic collision-checked short wire names for declarations, tool selectors and history on the Meta Muse path only, and restore original names in function calls, deltas, tool_choice and continuation cache before returning to the client.

Additional context and attachments

Distinct from #3362 (that one is a rejected web_search.indexed_web_access field on opencode-go; this is a tool-name length limit on api.meta.ai). Searched existing issues for the exact message, "64-char", "rename tool" and "meta.ai 400" with no matches. Happy to test a fix against the same 93-tool catalog.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingcatalogModel catalog, slugs, visibility, routed entriesproviderProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions