Skip to content
TheChatArchiveThe Chat Archive
o4-mini-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

Does Model Context Protocol specify the maximum tool name length?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-3-7-sonnet-20250219’s answer.
  1. User

    Does Model Context Protocol specify the maximum tool name length?

  2. Assistant

    In the current “Model Context Protocol” (MCP) specification, a tool’s name is simply defined as a JSON string—there is no hard-coded “max length” baked into the protocol itself.

    Any effective limit on how long your tool names can be will instead come from the implementation you’re using—for example:

    • OpenAI’s function-calling API
      • Names must be unique, 1–64 chars long, and match ^[a-zA-Z0-9_]+$
    • LangChain / LangSmith
      • No protocol-enforced limit, but very long names can hurt readability
    • Other LLM-driving UIs or CDAs
      • May truncate in UI, impose header-size limits, etc.

    —–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    What this means for you
    • If you’re talking directly “pure” MCP, there’s no ceiling on tool.name—it’s up to your client/server to decide.
    • If you’re using a specific LLM API (e.g. OpenAI’s function-calling), refer to that API’s docs for the exact character-count and character-set rules.

    Still not sure which implementation you’re targeting? Let me know and I can point you to the exact limits! 🚀

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.