Rightshold™ Sign up

Answers · MCP servers

How do I write MCP tool descriptions so agents pick the right tool?

Last updated

TL;DR: Write each description for a reader who knows nothing about your system: what the tool does, when to call it, when not to (and which tool to use instead), what each parameter means and its format, and what comes back. Anthropic's tool-use docs call detailed descriptions 'by far the most important factor in tool performance' and suggest at least 3-4 sentences per tool. OpenAI's function-calling guide says to explain when (and when not) to use each function and to pass 'the intern test': could a new person use it correctly from only what you wrote? Then cut overlap, because agents often pick wrong when two tools sound alike: fewer tools with distinct jobs, names prefixed by service, unambiguous parameter names (user_id, not user), enums instead of free text, and error messages that say how to fix the call. Finally, test which tool gets picked on realistic tasks and read the transcripts instead of guessing.

What should I check, step by step?

1. Open with the job and the trigger. The first sentence should say what the tool does and the situation it's for, for example 'Call before using any image, text or code you did not create.'

  1. Say when not to use it and name the alternative: 'For one contact's full history, use crm_get_contact instead.' Wrong picks often come from two tools that both seem to fit.
  2. Describe every parameter: what it means, its format and units, and an example. Name parameters unambiguously (user_id, not user), mark what's required, and use enums for fixed choices. For complex nested inputs, Anthropic's API also accepts input_examples.
  3. Say what comes back and what doesn't: the fields, how many results, the sort order, pagination or truncation, and what the tool can't see.
  4. Remove overlap. If two of your tools could answer the same request, merge them (for example one tool with an action parameter) or sharpen both descriptions so the boundary is obvious.
  5. Keep the starting list short. OpenAI's guide suggests, as a soft rule, fewer than 20 functions available at the start of a turn, with tool search or deferred loading for the rest.
  6. Prefix names by service and resource (github_list_prs, slack_send_message). The MCP spec only asks names to be unique within one server, and clients that combine servers have to disambiguate collisions, so a bare 'search' is a likely clash.
  7. Write errors as instructions. The MCP spec returns input validation problems as tool results with isError: true so the model can correct itself, so say what was wrong and give a valid example.
  8. Keep descriptions factual. Don't tell the model to always prefer your tool or how to treat other servers' tools; that is what tool shadowing looks like, and scanners and careful clients flag it.
  9. Test it: run realistic multi-step tasks, record which tool the agent called and with what arguments, and read the transcripts where it picked wrong.

What the MCP spec says about names and definitions

In the MCP spec (2026-07-28), a tool has a name, an optional title for display, a description, an inputSchema (a JSON Schema object), an optional outputSchema and optional annotations.

What Anthropic and OpenAI recommend

Anthropic's tool-use docs: explain what the tool does, when it should be used (and when it shouldn't), what each parameter means and how it affects the behavior, and caveats such as what the tool doesn't return. Consolidate related operations into fewer tools, prefix names with the service, and return only high-signal fields with meaningful identifiers.

Before and after

Before: name 'search', description 'Searches records.', one parameter 'q'. An agent with a CRM server and a ticketing server connected can't tell which search to use or what 'records' means.

Measure, don't guess

Write a few dozen tasks taken from real use, several needing more than one call, and record for each run which tools were called, with what arguments, how many calls, the tool errors and the tokens used. Anthropic used held-out test sets so its descriptions weren't tuned to one batch of tasks; do the same.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Before I publish my MCP server, does any other registered MCP server offer a tool with the same name as mine, and is there hidden text in the tool definitions my server serves?”

One-click setup

{
  "tool": "precall_check",
  "arguments": {
    "url": "<your MCP server's https URL>",
    "tool": "<one of your tool names, for example crm_search_contacts>"
  }
}

Rightshold checks tool names against servers registered on it and scans definitions for hidden text and instruction-like language. It doesn't judge how well your descriptions steer a model; only your own tests with the clients and models you target can tell you that.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'