Skip to content
mentoor

Topic 3 of 5 · 5 min read

Tool names and descriptions agents choose correctly

Goal: Rewrite an ambiguous tool name, description and parameter list so an agent picks the right tool and fills arguments correctly.

Write each tool's name, description and parameters as if you were briefing a capable new colleague who has never seen your system. The model chooses a tool by reading its definition. It cannot ask you what you meant.

Check yourself · 1 of 3

Two MCP servers each expose a tool called search. What is the most direct fix?

Choose one answer

Why it matters

An agent may see dozens of tools from several MCP servers. Two servers might each offer search. A parameter called user could be a name, an email or an id. When the definition is ambiguous the agent guesses, and a wrong guess often looks like a valid call. Anthropic's guide suggests small refinements to names and descriptions can change tool performance a lot, and that namespacing, such as asana_search and jira_search, helps agents choose between services.

How to do it

  1. Namespace the name. Use service_resource_action: github_issues_search, not search. Keep one style across the server.
  2. Say what it does and when to use it. First sentence: what the tool returns. Next: when to prefer it over a neighbour, and when not to use it.
  3. Make parameter names unambiguous. user_email beats user. start_date with the format in the description beats date.
  4. State formats and units. "ISO date, for example 2026-12-02". "Amount in cents".
  5. Add examples of valid input. The MCP spec and model provider docs allow examples next to the schema. One or two realistic ones prevent most formatting errors.
  6. Use enums and required fields in the schema instead of describing allowed values in prose only.

Before and after

-  name: "search",
-  description: "Searches things.",
-  params: { q: string, user: string, date: string }
+  name: "tickets_search",
+  description: "Search support tickets by text. Returns up to 20 matches. Use for finding existing cases; to open one, use tickets_get.",
+  params: { query: string, assignee_email: string, created_after: string /* ISO date, e.g. 2026-11-01 */ }

What goes wrong

  • Overlapping descriptions. Two tools say "find customer data" and the agent alternates between them.
  • Hidden conventions. An argument needs an internal code the description never mentions, so every call fails.
  • Instructions inside the description that belong elsewhere. Long policy text in every tool wastes context. Keep descriptions about the tool.

Examples

Two search tools

A workspace has search from a docs server and search from a tickets server. The client prefixes nothing, so the agent searches tickets for a handbook page. Renaming to docs_pages_search and tickets_search, with one line each on what they return, removes the confusion.

Ambiguous date

A parameter date receives "next Friday" from the agent and the server rejects it. The fix is due_date, type string, "ISO 8601 date, for example 2026-12-04", plus a note that relative dates are not accepted.

Key points

  • Namespace tool names by service and resource so tools from different servers cannot collide in meaning.
  • A good description says what the tool returns, when to use it and when to pick a neighbouring tool instead.
  • Parameter names must be unambiguous, such as assignee_email rather than user.
  • State formats, units and allowed values in the schema and the description.
  • One or two realistic examples of valid input prevent most argument errors.

Common mistakes

  • Calling every search tool search and relying on the server name to tell them apart.
  • Writing descriptions for humans skimming a catalogue instead of for the model deciding which tool to call.
  • Using generic parameter names like id, user or data.
  • Leaving out formats and units because they seem obvious to the author.

Check yourself · 2 of 3

Which parameter name is least likely to be filled in wrongly by an agent?

Choose one answer

Check yourself · 3 of 3

A tool fails because agents pass "next Friday" for a date. What is the best change?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic