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?
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
- Namespace the name. Use
service_resource_action:github_issues_search, notsearch. Keep one style across the server. - 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.
- Make parameter names unambiguous.
user_emailbeatsuser.start_datewith the format in the description beatsdate. - State formats and units. "ISO date, for example 2026-12-02". "Amount in cents".
- 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.
- 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_emailrather thanuser. - 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
searchand 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,userordata. - 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?
Check yourself · 3 of 3
A tool fails because agents pass "next Friday" for a date. What is the best change?
Practice items, not counted towards your mastery.
Start here
- Writing effective tools for AI agents (Anthropic) (opens in a new tab)ArticleFree
Anthropic's field guide: which tools to build, namespacing, token-efficient responses, prompt-engineered descriptions and eval-driven iteration.
- MCP specification: Tools (opens in a new tab)StandardFree
The protocol definition of tool listings, input and output schemas, structured content and the isError flag.
- Introducing advanced tool use (Anthropic) (opens in a new tab)ArticleFree
Techniques for large tool sets, such as loading tools on demand and calling them from code, and why they matter for context cost.
More for this topic
- Define tools (Claude API docs) (opens in a new tab)DocsFree
How names, descriptions, input schemas and input examples are written, with the advice that detailed descriptions drive tool selection.