deep · 6 min
Tool design
Shaping the tools an agent calls (what they do, their names and descriptions, what they return and how they fail) so a model uses them well.
updated 29 Sept 2026
Let's build a scheduling assistant. We already have an API with
list_users, list_events and create_event, so the obvious move is to
hand all three to the model as tools and let it figure out the rest.
Now watch it book one meeting. It lists users and scans them for the right person. It lists that person's events. It works out a free slot. It creates the event. That's four calls, four chances to get something wrong, and every list it read is now sitting in its context window for the rest of the run.
Nothing here is broken. The tools work. The model just has a much harder job than it needs to, and that's what tool design is about: shaping the functions you let a model call so it picks the right one, fills it in correctly, and gets back something it can act on.
The caller guesses
With tool calling, the model reads each tool's name, description and input schema, decides whether to call one, and writes the arguments. Our code runs it and sends back the result.
When a normal program calls a function, it calls it the same way every time and never invents an argument. A model isn't like that. Ask it "should I bring an umbrella?" and it might call our weather tool, answer from memory, or ask where you are first. It can misread what a tool is for or make up an argument. So a tool is a deal between code that always behaves the same and a caller that doesn't.
Shape tools around the job
Think about an address book. A program can scan every contact for free. A model reads every returned contact token by token, and each one eats space it needs for the real task. People don't read an address book front to back. They jump to the right page. Let's give the model that shortcut.
So instead of mirroring the API, we design around what the agent is trying to do:
Two quick rules fall out of this. If two functions are always called one after the other, merge them. And don't make the model fill in something our code already knows, like the current user's ID. Anything code can do reliably, code should do.
The description is a prompt
How does the model decide when to use schedule_event? Mostly from its
description. The API turns tool definitions into part of the model's
instructions, so a description is prompt text and deserves the same care
as a system prompt. Anthropic's docs call detailed
descriptions by far the most important factor in tool performance and
suggest at least three or four sentences per tool.
Here's the gap. A weak stock-price tool says "Gets the stock price for a ticker." A strong one says it returns the latest trade price in USD, that the ticker must be on a major US exchange, that it's for when the user asks about a current price, and that it gives nothing else about the company. Each extra sentence settles something the model would have guessed at.
A good check is the intern test: could a new hire use this tool correctly with only the name, description and schema? If they'd need to ask you something, the answer goes in the description.
Small things count too. Call a parameter user_id, not user, or the
model can't tell if you want a name, an email or an ID. Use enums and
structured objects so bad combinations can't even be written, and turn
on strict mode where your provider has it, so arguments always match the
schema (structured output). And make mistakes hard.
Building a coding agent, Anthropic found the model fumbled relative file
paths once it changed directory. Requiring absolute paths fixed it, and
the team said it spent more time on its tools than on the overall prompt.
Once tools come from several services, names collide. Two servers might
both have search. Prefix by service: github_list_prs,
slack_send_message. Whether the prefix goes at the start or the end
changed Anthropic's eval scores, and the better choice depended on the
model, so test it.
Return what helps the next step
Whatever a tool returns goes into the context and stays. So what should
schedule_event send back?
Names, not random IDs. Swapping arbitrary UUIDs for readable names, or even plain 0, 1, 2, made Claude noticeably more precise in retrieval tasks and cut made-up IDs.
Sometimes, though, the model needs the IDs for a follow-up call. A
response_format parameter with "concise" and "detailed" lets it
pick. In Anthropic's Slack example, the same thread came back as 206
tokens in detailed form (with the IDs) or 72 in concise form.
Anything that can return a lot needs pagination, filters or truncation with sensible defaults. Claude Code caps tool responses at 25,000 tokens by default. If you cut something off, say so in the output and tell the model how to narrow the request.
And JSON, XML or Markdown? It changes eval scores, and no format wins everywhere. You find out by testing.
Errors that say what to do
An error message is the model's only clue for recovering. A stack trace or a bare error code gives it nothing. Compare "Invalid departure date: must be in the future. Current date is 08/08/2025." The model reads that, fixes the date and tries again.
The MCP spec builds this in. A protocol error (unknown tool,
malformed request) is something a model is unlikely to fix. A tool
execution error (bad input, a failing API) comes back as a normal result
marked isError: true, written so the model can correct itself. The
same goes for tools that hold state. MCP has no sessions, so a stateful
tool hands back a handle like bsk_a1b2c3, the description says how long
it lasts, and an expired handle returns an error that tells the model to
make a new one.
How many tools is too many?
Every definition costs tokens on every request, and every extra tool is
one more wrong option. OpenAI suggests fewer than 20 functions at the
start of a turn, and calls that a soft suggestion. Anthropic's docs say
Claude's tool picking gets worse past 30 to 50 tools, and suggest merging
related operations into one tool with an action parameter, so
create_pr, review_pr and merge_pr become one. These numbers come
from different vendors, models and tasks, so treat them as rough. And a
merged tool that does everything gets a vague description of its own.
Past that point, both point to tool search. Most definitions are marked as deferred. The model starts with a search tool and a few common ones, searches the catalog, and loads only what it needs. Five MCP servers (GitHub, Slack, Sentry, Grafana, Splunk) can eat about 55,000 tokens of definitions before any work starts, and tool search usually cuts that by more than 85%. It's a small retrieval problem, so prefixed names and good keywords in descriptions help it the way clean text helps BM25.
You find out by watching
You can't tell from a definition whether a tool is easy to use. You find out by watching the model use it. Write realistic tasks that need several calls ("schedule a meeting with Jane next week about the Acme project, attach last meeting's notes and book a room"), run them through a simple loop, and read the transcripts. Lots of repeated calls hint that pagination is off. Lots of invalid arguments hint that the description is unclear. Change the tools and run again on tasks you didn't tune on. That's ordinary evals work pointed at tools, and grading whole runs is agent evals. Anthropic even had Claude read the transcripts and rewrite its tools, and on held-out tasks those rewrites beat the ones its researchers wrote by hand.
Watching is also how you catch the weird ones. When Anthropic launched its web search tool, Claude kept adding "2025" to search queries for no good reason, which skewed the results. No one would have spotted that from the definition. A change to the description fixed it.
Further reading
- Writing effective tools for agents — with agents, Ken Aizawa (Anthropic), 2025. The main guide, and the source of the scheduling, Slack and "2025" examples. Read this one if you read one.
- Define tools, Anthropic docs. The good and bad stock-price descriptions side by side.
- Function calling, OpenAI docs. A second vendor's take, with the intern test and the soft limit of 20.
- Tool search tool, Anthropic docs. What to do once you have too many tools.
- Model Context Protocol specification 2026-07-28: Tools, MCP maintainers, 2026. The two kinds of errors and handles for stateful tools.
- Building effective agents, Erik Schluntz and Barry Zhang (Anthropic), 2024. Appendix 2 is about tools, including the absolute file path fix.