# Write tool descriptions an AI agent can use correctly

- Author: RomanMotion (https://wurk.fun/user/RomanMotion)
- Published: 2026-11-02
- Updated: 2026-11-03
- Canonical (HTML): https://wurk.fun/blog/write-tool-descriptions-an-ai-agent-can-use-correctly
- Cover image: https://ik.imagekit.io/wurk/browser-uploads/f1c626b5c17e7f0a61dfbbe7a20d85ae7b33a20527243aeec2ee1d0a8b87562a/623b9554-9f2d-44a9-aa2e-d8a09b866e15/cover-tools.jpg?wurkUpload=v1.T9pPUy850TT_Yv6kTNDCXRk-VVhQpeH-o6RVxWXJ7Pg

---

You ask your coding agent to pull yesterday's sales and it calls the reporting function with a date like "last Friday". Then it invents a currency code, retries the same failed call three times, and announces the task is impossible. Fix the tool definition itself and most of those misses have nowhere left to come from.

Here is the direct answer. The model never sees your code. It sees each tool's name, its description, and its parameter schema, and it picks tools and fills in arguments from those three things alone. Write them like instructions for a smart but extremely literal temp worker: a verb_noun name with one job, a description that says what it does, when to use it and when not to, typed parameters with enums and units spelled out, error messages that name the fix, and a hard line between read and write tools.

## What the model actually sees

When you hand an agent a tool, none of your implementation travels with it. The model receives a name, a short text block, and a schema describing the arguments. That description is not documentation for humans. It is a prompt, and it is the only context the model has when it decides "should I call this?" and "what goes in date?"

So the test for every sentence in a description is simple: would a stranger with no access to your codebase make the right call from this text alone? "Gets data for the user" fails. So does a description built around your internal table names. Write for the outside view: what the tool returns, in what shape, for what kind of question.

If your tools ride on MCP rather than raw function calling, the same rules apply one layer up, and I covered the security half of that in [give your agent tools, not your keys](https://wurk.fun/blog/mcp-explained-give-your-agent-tools-not-your-keys).

## Name it verb_noun, one job per tool

The name does heavy lifting because the model scans it first. verb_noun reads like a command it can pattern-match: get_booking_revenue, list_customers, cancel_booking. Avoid data_tool, process, handle_stuff. If you can't name a tool with one verb and one noun, it probably has two jobs, and a model forced to guess between overlapping tools will guess wrong.

The description then answers four questions, one sentence each:

- What: returns total revenue for one calendar day, in EUR.
- When: the user asks about earnings, sales, or a daily total.
- When NOT: customer lists (use list_customers), multi-day ranges (call once per day).
- Returns: date, total_eur, booking_count, or an error message.

That "when not" line is the one most people skip, and it prevents the most damage, because models love to reuse a tool that half-fits the question in front of them.

## Parameters: types, enums and units

Most arguments you actually need are not free text. A status is one of a few words, a currency is one of a few codes. Model that in the schema itself instead of hoping the model guesses your conventions. [JSON Schema](https://json-schema.org/understanding-json-schema) is the vendor-neutral spec behind most function-calling formats, and its core ideas carry over: declare types, mark which fields are required, and prefer enums to strings wherever the value set is known.

Three habits pay for themselves in the first week. Spell out units and formats in the field description: "date, format YYYY-MM-DD, local time" or "amount in cents, integer". Put one realistic example in each description; a concrete value is harder to misread than a rule. And mark required fields honestly, since a model told everything is optional will omit fields and improvise the rest.

## Make errors say what to fix

A stack trace tells the model nothing actionable, so it retries the identical call and fails the identical way. An error message that names the fix usually ends the loop in one round trip.

Compare "ValueError at line 42" with "date must be YYYY-MM-DD, got 'last Friday'. Example: '2026-11-01'." The second lets the model correct itself on the next call. Keep errors short, state what was wrong, state what correct looks like. If a failure is permanent, say so: "no booking with id 1234, do not retry; use list_bookings to find valid ids." That gives the model a stated reason to stop instead of looping. This is the cheapest fix on this page, and it turns your error handling into part of the interface. It also saves money: every blind retry is another paid model call, which matters if you run agents for hours on a subscription such as the GLM coding plans (this link gives [a referral discount on GLM coding plans](https://z.ai/subscribe?ic=R0K78RJKNW)).

## Split read tools from write tools

Read tools fetch, list, search. Write tools create, update, delete, send, charge. Label every write tool inside its description ("This DELETES the booking permanently"), because the model weights that text when it decides whether to act.

Then put a confirmation step between the model and anything that spends money, deletes data, or messages a real person. The pattern is simple: the write tool returns a preview and a confirmation id, and a second confirm tool completes it. The model proposes, you approve. It is easy to wire a delete straight to the model with no gate, and that is funny right up until it drops a real row instead of a test one.

## Before and after

A bad definition, and the fixed one:

Bad, because the model is guessing at everything:

```json
{
  "name": "data_tool",
  "description": "Gets data for the user.",
  "parameters": {
    "date": { "type": "string" },
    "type": { "type": "string" }
  }
}
```

Fixed:

```json
{
  "name": "get_booking_revenue",
  "description": "Returns total revenue for one calendar day, in EUR, for the salon's bookings. Use when the user asks about earnings, sales, or a daily total. Do NOT use for customer lists (use list_customers) or multi-day ranges (call once per day). Returns {date, total_eur, booking_count} or an error message.",
  "parameters": {
    "type": "object",
    "properties": {
      "date": {
        "type": "string",
        "description": "Business day to total, format YYYY-MM-DD, local time. Example: '2026-11-01'."
      }
    },
    "required": ["date"]
  }
}
```

Same code underneath, completely different behavior, because the model now knows when to reach for the tool, what shape the date takes, and what comes back. The exact envelope around the schema differs by API; the ideas do not. The checklist to screenshot:

```
Tool definition checklist
- name: verb_noun, exactly one job
- description: what / when / when NOT / returns
- every parameter typed, required list set
- enums instead of free text where values are known
- units and date formats written out
- one example argument per parameter
- errors name the fix, ban pointless retries
- write tools labeled, confirmation step for spend and delete
```

## The five-request test

Definitions look fine until a real request lands. Write five requests a user would actually say, mixing the obvious with the adjacent: "how much did we make yesterday", "show me cancelled bookings", "book me a cleanup for Friday", "email the client the invoice". Run them against your agent and record which tool it picks and what arguments it fills. Two misses out of five means a description is lying or two tools overlap.

Fix the definitions, not the prompts. A better prompt papers over a bad tool once; a better description fixes every future request. If you want a ready-made place to run these five requests against a real agent loop, you can [try the zcode agent harness free](https://zcode.z.ai/invite/ALWM9JUA).

Good tool definitions are boring, and boring is the goal: the agent stops being lucky and starts being reliable.

There's [more on our blog](https://claw.rommark.dev) if you build agents for clients.

If this saved you an afternoon of prompt-wrestling, a small WURK tip on the post keeps these guides coming.
