Tool Design
The model never touches your systems directly. It reads a short list of tools, picks one, and fills in the inputs. Everything it knows about each tool is a name, a description and a schema. If those are vague, the agent will be confidently wrong.
Definition: Tool design is the work of defining the actions an AI agent can take (each with a clear name, a description of when to use it, strict inputs, compact outputs, helpful errors and safe retries) so the model picks the right tool and calls it correctly the first time.
1 The big idea
A tool is a contract with a reader who can't ask questions
When an agent "does" something, such as checking a calendar or sending a quote, the model is not doing it. The model writes a request: use this tool, with these inputs. The software around it checks the request and runs it. That request-and-run arrangement is usually called tool calling or function calling.
To choose, the model sees a short description of each tool: its name, a sentence or two about what it does, and a schema listing the inputs it accepts and their types. Often this is written in a standard format called JSON Schema. An open standard called MCP (Model Context Protocol) is now a common way to offer the same tools to many different agents. Whatever the plumbing, the model only knows what those few lines tell it.
That is why tool design is its own skill. Your internal systems were built for programmers who read the documentation. A model reads one paragraph, at speed, every time, and then acts. The tool has to be impossible to misunderstand, strict about what it accepts, and safe when things go wrong.
Think of a good paper form. A clear title. Labelled boxes. Tick boxes instead of free text where the answers are known. Required fields marked. And a clerk who hands it back with "date must be in the future" circled, instead of quietly filing it. A well-designed tool is that form, and that clerk, for a model.
2 Interactive map
The anatomy of a good tool
Click any part to see what it does, an example, and what goes wrong without it. Then switch to Raw API to see what an agent gets when you hand it your internal API as it is.
A specific name
A verb and a noun that say exactly what the tool does. Names are the first thing the model uses to choose, so similar tools need clearly different names.
Read all 8 parts as text
- A specific name
- A verb and a noun that say exactly what the tool does. Names are the first thing the model uses to choose, so similar tools need clearly different names. Example: search_listings and find_lead_by_name. Not search and find, which sound like the same thing. Without it: The model picks the tool whose name sounds closest, which is often the wrong one.
- A description that says when
- Two or three sentences: what it does, when to use it, and when to use something else instead. Written for a newcomer, not for the team that built it. Example: "Create a confirmed booking and take the deposit. Use only after the guest has agreed dates and price. To check dates, use check_availability." Without it: The model uses a booking tool to check availability, or a write tool where a read tool would do.
- Strict, typed inputs
- Lists every input with its type, format and limits, marks which are required, and offers fixed choices where the answers are known. Anything not listed is rejected. Example: check_in: a date as YYYY-MM-DD. guests: a whole number from 1 to 12. channel: one of "whatsapp", "email", "sms". Without it: The model sends "next Friday" as a date, invents a discount field, or passes a flat name where an ID was needed.
- A compact output
- Returns only the fields the agent needs, in a consistent shape, with a clear status. Large lists come back in pages with a note that more exist. Example: {status: "confirmed", booking_id: "B-90412", total_aed: 3150}. Not the 140-field database record. Without it: One call can fill the context window, push out the instructions and slow down every later step.
- Errors that explain the fix
- When something is wrong, says what, why and what to do next, in plain words the model can act on. Failure is never silent. Example: "flat_id must look like M-07. You sent 'Marina 7'. Use find_flat(name) to get the ID." Without it: The model gets "Error 400", has no idea why, and repeats the same call or gives up.
- Clear side effects
- Separates tools that only read from tools that change things, and says exactly what each change does: who is charged, who is messaged, what is created. Example: check_availability: read only. create_booking: creates a booking, charges the deposit, emails the guest. Without it: The agent triggers a payment or a message it didn't know was part of the action.
- Safe to retry
- An action is idempotent when doing it twice has the same effect as doing it once. For actions that create or charge, the caller sends a unique idempotency key, and a repeat with the same key returns the first result. Example: A booking request times out and is retried with the same key. The booking system returns the existing booking. One booking, one charge. Without it: A timeout followed by a retry creates two bookings and charges the guest twice.
- Permissions and limits
- Each tool runs with only the access it needs, and checks its own limits in code, whatever the model asked for. Risky calls go to a person. Example: issue_refund works only on this guest's booking, up to AED 1,000. Above that it returns "needs approval" and creates a request for a person. Without it: One fooled or confused model call can reach any record or any amount.
When choosing a tool, the model sees only the first three parts: name, description and inputs. Output and errors reach it after the call. The last three parts protect you when it uses a tool wrongly anyway.
3 Step-by-step simulator
Watch an agent use your tools
Agents at a holiday-rental company using tools. The model is the same in every scenario. Only the design of the tools changes. Watch where a bad design would have caused real damage.
- Requestuser
- Choose toolmodel
- Validate inputsharness
- Runtool
- Shape resultharness
- Next stepmodel
Picking the right tool
A sales assistant has two search tools. With vague names, the model picks the wrong one. With specific names and descriptions, it picks correctly first time.
Read the walkthrough as text
Picking the right tool
A sales assistant has two search tools. With vague names, the model picks the wrong one. With specific names and descriptions, it picks correctly first time.
- A question about a lead. A salesperson asks about a lead in the CRM, the system that tracks potential customers.
- Version 1: two vague tools. The agent sees two tools, search and find, both described as "searches records". The question mentions a villa, so the model picks search. Why it matters: The model chooses from names and descriptions alone. Two tools that sound alike is a coin toss.
- Wrong system, plausible answer. search looks in property listings, not the CRM. It returns three villas. The model is about to describe a villa as if it were Sara's enquiry.
- Version 2: specific names. The same tools, renamed and described properly: search_listings ("properties we rent out; not people") and find_lead_by_name ("people who enquired; use for questions about a person").
- The right record. The CRM finds one matching lead and returns a short, relevant summary.
- A correct answer. Same model, same question. The only change was two names and two descriptions.
Bad input caught
A pricing agent fills in a rate change loosely. A strict schema catches every problem before it reaches the pricing system, and the error tells the model how to fix it.
- A loosely worded request. The revenue manager writes the way people do: a flat name, a relative date and an approximate price.
- The model fills in the tool. It copies the wording straight into the inputs, and adds a discount field that sounded helpful.
- The schema rejects it. Validation runs before anything touches the pricing system. Four problems: wrong ID format, a date that isn't a date, a rate that isn't a number, and a field that doesn't exist. Why it matters: Without a strict schema, the pricing system might have guessed. "next Friday" could become any date, and an unknown field might be silently ignored or, worse, applied.
- An error the model can act on. The harness returns one clear message listing each problem and how to fix it, including which tool turns a flat name into an ID.
- The model fixes it. It looks up the flat ID, works out the date from today, and uses 900 as the rate.
- Valid, and run. Every input passes. The pricing system checks the rate against the flat's cap and applies it.
- Confirm, with the details spelled out. The reply states the exact date and rate it used, so the manager can spot it if "next Friday" meant something else.
Retry without a double booking
The booking system creates the booking, but the reply gets lost on the way back. The harness retries. Whether the guest is charged once or twice depends on one input.
- The guest agrees. The guest has accepted the dates and the price. The agent can now book.
- The model asks to book. The model requests the booking. The harness adds a unique idempotency key for this specific booking attempt.
- It worked, but nobody heard. The booking system creates booking B-90412 and charges the deposit. Then the network drops before the reply arrives. To the harness, it looks like a timeout.
- Retry with the same key. Timeouts are often temporary, so the harness retries. Crucially, it sends the same idempotency key as before.
- The booking system recognises it. It has already seen this key, so it does not create a second booking. It returns the first one. Why it matters: Without the key, this retry would have created a second booking and a second deposit charge, for a guest who did nothing wrong.
- A small, clear result. The harness passes back only what the model needs: status, booking ID and total.
- One booking, one charge. The model confirms to the guest. The trace shows the timeout and the safe retry.
Output floods the context
A tool returns everything it has. One call fills the agent's context with old messages. The redesigned tool returns a short, filtered answer instead.
- A history question. A support agent wants to know if a long-time guest has raised noise before.
- Version 1: one big tool. The only tool available is get_guest_messages, which takes a guest ID and nothing else.
- Three years of messages. The tool returns every message the guest ever sent: thousands of lines. The context fills up, the instructions get pushed aside, and the call becomes slow and costly. Why it matters: Tool output goes straight into the model's context. A tool that returns too much damages every step that follows, not just this one.
- Version 2: a tool built for the question. The redesigned tool takes a topic filter and a limit, with a small default. The model asks only for what it needs.
- A short, filtered answer. The tool returns two matching messages, a count, and a note saying there are no more results.
- A clear answer, cheaply. The model answers in one sentence, based on exactly the evidence it needed.
The point: the model's intentions were reasonable every time. The damage, or the rescue, came from the tool: its name, its schema, its error message, its idempotency key, the size of its output. Tools are where an agent touches the real world, so that is where design pays off most.
4 Two kinds of tool
Wrapping your API, or designing for an agent?
A thin wrapper over the API
- Named after internal endpoints
- One tool does many things via an "action" field
- Dozens of optional, loosely typed fields
- Returns the full database record
- Errors are status codes
- Retrying may repeat the action
Designed for an agent
- Named for the task: verb plus noun
- One tool, one job
- Few inputs, strict types, fixed choices
- Returns only what the next step needs
- Errors say what to do next
- Safe to retry with an idempotency key
- Limits and approvals checked in code
It is fine for agent tools to call your existing API underneath. The point is to put a thin, careful layer between the model and that API, designed for a reader who only sees a name, a description and a schema.
5 Design your own tools
Turn on design choices. Watch the failures disappear.
These are common ways agents misuse tools in real systems. Tick the design choices your tools follow and see which failures you are protected from. Exposing your raw API covers almost none.
- Searches property listings when asked about a sales leadTwo tools sound the same.
- Picks the wrong one of 40 similar toolsToo many choices, too little guidance.
- Invents a "discount" field the system never hadUnknown inputs are accepted.
- Books the wrong day because it sent "next Friday" as a dateAny text passes as a date.
- Gets "Error 400" and repeats the same call five timesThe error says nothing useful.
- A failed send returns nothing, so the agent reports "done"Silence looks like success.
- Charges a guest twice after a timeout and retryRetries repeat the action.
- One lookup returns 3,000 messages and floods the contextThe tool returns everything.
- Refunds a booking that belongs to a different guestThe tool can reach any record.
Read which part prevents which failure
- Searches property listings when asked about a sales lead: prevented by Specific names or When-to-use descriptions.
- Picks the wrong one of 40 similar tools: prevented by Small toolset or When-to-use descriptions.
- Invents a "discount" field the system never had: prevented by Strict input schema.
- Books the wrong day because it sent "next Friday" as a date: prevented by Strict input schema.
- Gets "Error 400" and repeats the same call five times: prevented by Helpful errors.
- A failed send returns nothing, so the agent reports "done": prevented by Explicit status.
- Charges a guest twice after a timeout and retry: prevented by Idempotency keys.
- One lookup returns 3,000 messages and floods the context: prevented by Compact output.
- Refunds a booking that belongs to a different guest: prevented by Scoped permissions.
Notice that most of these are invisible in a demo. They show up the first time a network blips, a request is worded oddly, or a list is longer than expected. Design for those days.
6 Optional: what it looks like in code
One well-designed tool
You don't need to read code to follow this series. If you do, here is a booking tool written the way this page recommends. Everything above def is what the model sees. The highlighted line is what saves you on a bad network day.
create_booking = Tool(
name="create_booking",
description="Create a confirmed booking and charge the deposit. "
"Use only after the guest has agreed dates and price. "
"To check dates, use check_availability instead.",
inputs={
"flat_id": Text(pattern="^[A-Z]{1,3}-[0-9]{2}$", example="DT-22"),
"check_in": Date(format="YYYY-MM-DD"),
"check_out": Date(format="YYYY-MM-DD"),
"guests": Number(whole=True, min=1, max=12),
},
extra_inputs=False, # made-up fields are rejected
)
def run_create_booking(args, key):
if args.check_out <= args.check_in:
return Error("check_out must be after check_in. Ask the guest to confirm dates.")
if not can_book(args.flat_id):
return Error("Not allowed for this flat. A person must approve.")
booking = bookings.create(args, idempotency_key=key) # same key, same booking
return Ok(status=booking.status, booking_id=booking.id, total_aed=booking.total)
inputs becomes a JSON Schema the model is shown. Many model APIs can also constrain the model to produce inputs that match the schema, but always validate again on your side. The harness creates the idempotency key once per booking attempt and reuses it on every retry.7 The rules I build by
Eight principles of good tool design
One tool, one job
A tool called manage_booking with an "action" field is five tools pretending to be one. Split it. Each job gets its own name, inputs and rules.
Name it for the task, not the system
Verb plus noun, in the language of the job: check_availability, send_quote. Make similar tools obviously different.
Say when to use it, and when not to
The most useful sentence in a description is often "for X, use Y instead". It stops the commonest mix-ups.
Be strict about inputs
Types, formats, ranges, fixed choices and no extra fields. Reject bad input before it reaches a real system, every time.
Return less
Only the fields the next step needs, a clear status, and pages for long lists. Tool output is context, and context is a budget.
Write errors for the model
Say what was wrong and what to do next, in plain words. A good error turns a failure into a second, correct attempt.
Make every write safe to retry
Networks fail after the action has happened. Use idempotency keys for anything that creates, charges or sends.
Put the limits inside the tool
The tool checks who and what it may touch and how much, in code. Never rely on the description to keep the model in bounds.
8 Common mistakes
Things teams say right before a tool incident
"Let's just expose our whole API as tools."
Internal APIs are written for programmers who read documentation. Exposed as-is, they give the model vague names, dozens of optional fields and huge responses. Put a small layer of agent-friendly tools in front, each built for one job.
"The description says not to do that."
A description guides the choice. It does not stop a confused or fooled model. If an action must never exceed a limit or touch another customer's data, check that in the tool's code.
"Retries are handled by the framework."
Retrying is easy. Retrying safely is not. If a create or charge can succeed and still look like a failure (for example, the reply times out), a retry repeats it unless the tool uses an idempotency key.
"Just return everything, the model will pick what it needs."
Every field you return goes into the context and stays there for later steps. Large outputs cost money, slow things down and push out more important text. Return the fields the task needs and offer filters and pages for the rest.
"If it fails, it'll throw an error."
Not always. Some systems return an empty result or a success code with nothing done. Make every tool report an explicit status, and verify important actions by reading the result back.
9 Check yourself
Four quick questions
10 Do this today
Six steps to better tools this week
Pick one agent you're building or running. Work down this list. Your ticks are saved in this browser.
11 Questions people ask
Tool design FAQ
What is a tool in an AI agent?
A tool is an action an AI agent can request, such as looking up a booking, checking a calendar or sending a message. The model sees each tool's name, description and input schema, chooses one, and fills in the inputs. The software around the model validates the request and runs it.
What is the difference between tool calling and function calling?
They usually mean the same thing. Both describe a model producing a structured request to run a named action with specific inputs, which your software then executes. Different providers and frameworks simply use different names for it.
How do you write a good tool description for an AI agent?
Say what the tool does, when to use it, and when to use a different tool instead, in two or three plain sentences. Mention important side effects, such as charging a card or emailing a customer. Write it for a newcomer who has never seen your systems.
What is idempotency and why does it matter for agent tools?
An action is idempotent if doing it twice has the same effect as doing it once. Agents retry when calls time out, and sometimes the first call actually succeeded. Sending an idempotency key with actions that create, charge or send lets your system recognise a retry and avoid doing it twice.
How many tools should an AI agent have?
As few as the task needs. Every extra tool takes space in the context and adds another way to choose wrongly. If an agent needs many tools, offer only the relevant ones for each step or split the work across more focused agents.
What is MCP (Model Context Protocol)?
MCP is an open standard for connecting AI applications to tools and data sources, so a tool written once can be used by many different agents and assistants. It standardises how tools are offered and called. It does not make a badly designed tool good, so names, schemas, errors and permissions still matter.
12 Glossary
Words you'll hear
- Tool
- An action the agent can request, such as a lookup or a booking.
- Tool call
- The model's structured request to run a tool with specific inputs.
- Function calling
- Another name for tool calling, used by many providers.
- Schema
- A description of the inputs a tool accepts: names, types, formats and limits.
- JSON Schema
- A widely used standard format for writing schemas.
- Validation
- Checking a tool call's inputs against the schema before running it.
- Side effect
- A change a tool makes in the world, such as a charge, a message or a new record.
- Idempotency key
- A unique value sent with an action so that a retry returns the first result instead of repeating it.
- MCP
- Model Context Protocol: an open standard for offering tools and data to AI applications.
- Pagination
- Returning a long list in pages, with a note when more results exist.
For teams
Want your team to build tools agents can use?
I run AI agents in production at estaie that set prices, find customers and look after guests. This page comes from building and running them.
AI Skills 2027, for your engineering team
A hands-on workshop where your engineers redesign the tools for a real agent from your business: names, schemas, errors, retries and permissions.
- One skill in depth, or all ten as a bootcamp
- On site in the UAE or remote
- Your team leaves with working code, not slides
Have your agent's tools reviewed
I go through every tool your agent can call and give you a written list of what to rename, tighten, split or protect, in order of risk.
- For teams about to launch, or just after an incident
- Plain-English findings your board can read
The series
All ten AI Skills for 2027
- Harness Engineering
- Loop Engineering
- Context Engineering
- Tool Design
- Memory Architecture
- Orchestration Patterns
- Guardrails & Permissions
- Evals for Agents
- Human-in-the-loop Design
- Observability & Tracing
Published 2 December 2026. Written by Nimit Solanki from building production agents at estaie.
Get the free Playbook by email
Seven short lessons on taking an agent from prototype to production. One a day, free. You may also hear about my course and consulting. Opt out any time.