# How Do You Write Good Tool Descriptions?

> How to describe an AI tool so the model knows when to use it, what to pass in and what comes back, explained simply for your AI interview.

**In short:** A good tool description says what the tool does, when to call it and when not to, what each parameter means, and what comes back. Anthropic calls detailed descriptions the most important factor in tool performance.

AI and LLM interview question Q107, Prompt and context engineering. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/how-do-you-write-good-tool-descriptions

## Say it in 30 seconds

A tool description is the text that tells the model what a tool does. I write it like a note for a new hire: what the tool does, when to use it and when not to, what each parameter means, and what comes back. Anthropic says detailed descriptions are the most important factor in tool performance. I also give parameters clear names, like customer_id rather than id, and keep the tool set small so the model doesn't get confused.

## Say it in 2 minutes

The model never runs a tool itself. It reads the tool's name, its description and its parameter list, then decides whether to call it. So the description is the main manual the model gets, with the name and parameters beside it. A one-line note that only says the tool looks up a claim leaves the model guessing when to use it, what the number looks like and what comes back.

A strong description covers five things: what the tool does, when to use it, when not to, what each parameter means in plain words, and what it returns, with any limits. For a claims agent at an insurer, the lookup tool takes a claim number like CL-204871, returns the status and last adjuster note, and does not search. Parameter names matter too. policy_number is clearer than number, and one example of the format saves a lot of wrong calls.

Then I measure it. I run realistic test tasks, count wrong tool choices and bad arguments, and rewrite the descriptions that cause them. Anthropic says small refinements to tool descriptions can yield dramatic improvements. The cost is tokens, the small chunks of text you pay for on every call. Each definition rides along in the prompt, so a long description across forty tools adds up on a busy support line. Shorten what you can, and load rarely used tools only when a task needs them.

## What is a tool description, in plain words?

A tool is a function your code offers the model, such as looking up a claim or issuing a refund. The model never runs it. It reads the tool's name, its description and its parameters, decides whether it needs the tool, and asks your code to run it.

Think of a new hire at an insurance firm reading the claims handbook. If the entry for a tool says only that it gets a claim, they will guess when to use it, what the number looks like and what they get back. The model is in the same spot, and the description is the only handbook it has.

So a vague description leads to the wrong tool, or to the right tool with a wrong value in one of its fields. The fix is to write the description the way you would brief that new hire.

- **Tool:** A function your code offers the model, like looking up a claim.
- **Description:** The text that says what a tool does and when to use it.
- **Parameter:** An input the model fills in, such as claim_id.
- **Schema:** The formal list of parameters, their types and which are required.
- **Tool call:** The model asking your code to run a tool with some values.

## What does a strong description say?

Anthropic's developer guide is blunt about it. Detailed descriptions are the first best practice it lists. It says a description should explain every detail: what the tool does, when to use it and when not to, what each parameter means, and any limits.

> "Provide extremely detailed descriptions. This is by far the most important factor in tool performance." (Anthropic)
>
> "Write clear and detailed function names, parameter descriptions, and instructions. Explicitly describe the purpose of the function and each parameter (and its format), and what the output represents." (OpenAI)

- **Weak: One line, no rules.** Gets a claim by its number. The model cannot tell when to use it, what the number looks like or what comes back.
- **Strong: Says what, when and what back.** Looks up one claim by claim_id, with its status, policy number and last adjuster note. Use it when a customer asks about one claim. It does not search; use search_claims for that.

Name the inputs clearly too. Anthropic's engineers say input parameters should be unambiguously named, so user_id is better than a bare user. When a value is picky, give its format and one example, such as CL- followed by six digits.

*Diagram, How a tool description reaches the model: The model reads the tool definition, then either answers or asks your code to run the tool. It reads the name, the description and the parameter list before it chooses. The result of a run goes back so the model can finish its answer.*
1. The model reads the description before it replies.
2. It asks your code to call the tool, with the values it picked.
3. The result goes back to the model, so it can finish the answer.
4. If no tool is needed, the model answers the user directly.

## Why does the number of tools matter?

Every tool costs something. Its definition goes into the model's working text on every call (its context), and you pay for that text as input tokens, the small chunks of text that AI services bill by. The model also has to choose between tools each time, and a crowded list makes that choice harder.

> "This means callable function definitions count against the model's context limit and are billed as input tokens." (OpenAI)
>
> "Too many tools or overlapping tools can also distract agents from pursuing efficient strategies." (Anthropic)

Take a claims agent for a mid-size insurer with forty tools. Several have near-identical names: get_claim, fetch_claim, claim_status and lookup_claim. Every one carries a long description, so the prompt is heavy on every turn, and the model keeps picking the wrong lookup. The fix is to merge the lookups into one tool, keep search separate, and load rare tools only on request.

- **Merge related actions:** Fold them into fewer tools, with an action field where that helps.
- **Prefix names with the service:** Names like claims_get_claim keep tools from different services apart.
- **Load rare tools on request:** Keep rarely used tools out of the prompt until a task needs them.

> **Tip:** Asked how many tools to give an agent? Start with a few thoughtful tools that match real tasks, then add more only when your tests show a gap.

## Can a small check catch a weak description?

A script can't judge a description the way a person can, but a simple check catches the easy misses. This made-up checker looks at three claims tools and asks three things: at least three sentences, a when to use it, and a when not.

```python
# A simplified check of tool descriptions for a claims agent (made-up tools).
TOOLS = {
    "get_claim": "Looks up one claim by claim_id. Use it when a customer asks about one claim. Returns the status and last note. It does not search, so use search_claims for that.",
    "search_claims": "Finds claims.",
    "close_claim": "Closes a claim.",
}

def check(name, text):
    sentences = text.split(". ")
    words = text.lower().replace(".", "").split()
    problems = []
    if len(sentences) < 3:
        problems.append(str(len(sentences)) + " sentence(s), needs 3")
    if "when" not in words:
        problems.append("no 'when to use'")
    if "not" not in words:
        problems.append("no 'when not'")
    return name + ": " + ("ok" if not problems else "; ".join(problems))

for name, text in TOOLS.items():
    print(check(name, text))
```

Output:

```text
get_claim: ok
search_claims: 1 sentence(s), needs 3; no 'when to use'; no 'when not'
close_claim: 1 sentence(s), needs 3; no 'when to use'; no 'when not'
```

Two of the three fail, and the checker points at the words to add. Real tests still matter more, because a description can pass every rule and still describe the wrong thing.

### How would you fix an agent that keeps picking the wrong tool?

An online retailer's support assistant keeps calling refund_order when the customer only wants a tracking update. A customer writes "Where is my parcel? I ordered it on Monday." and gets a refund offer instead of a status. Here is how I would work through it.

1. **Read the failed runs:** Read each failed run in full, including the tool calls and the results. The reason for the wrong pick often shows up in the model's own notes, not in your summary of them.
2. **Compare the two descriptions:** Put refund_order and the tracking tool side by side. If both sound like they answer a status question, the model is guessing.
3. **Add when-not lines and clear names:** Say in refund_order that it does not check tracking. Rename any vague input so the model cannot mix up an order ID and a tracking number.
4. **Test on tasks you did not tune on:** Re-run fresh tasks, not the ones you tuned on. Anthropic kept separate test sets so the fix would not just memorise its own examples.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: the description is the model's only manual for the tool.
- [ ] What it does, when to use it, and when not to.
- [ ] Clear parameter names, with the format and an example where it matters.
- [ ] What comes back, and the limits.
- [ ] Fewer tools with distinct purposes, named by service.
- [ ] Measured with test tasks, then rewritten.

**Common traps**

- Trap: "Gets a claim, the model will work out the rest." Better: It won't. Say when to use it, when not to, and what it returns.
- Trap: "More tools give the agent more options." Better: More tools mean more confusion. Merge overlapping ones and keep each tool's purpose distinct.
- Trap: "A longer description is always better." Better: Detail helps, but every word is billed on each call. Cut what the model doesn't need.

## Can you spot the weak description?

**Spot the weak description:** Which tool description is most likely to make the agent pick the wrong tool?

A. Looks up an invoice by invoice_id. Use it when the customer asks about one invoice. It does not list invoices.
B. Creates a refund for a paid invoice. Use it only after a human approves. It returns the refund ID.
C. Does things with invoices. Pass it the invoice and it helps.
D. Lists a customer's invoices, newest first. Use it when the customer asks for a list, not one invoice.

**Answer:** C. The third option says nothing about when to use it, what the input means or what comes back. The others name the action, the input and when to pick them.

**Quick check:** An agent keeps passing a policy name where the tool wants a policy number. What is the first fix?

A. Use a bigger model
B. Rename the parameter to policy_number and describe its format, with one example
C. Lower the temperature
D. Add a longer system prompt

**Answer:** B. The name and description tell the model what the field is. A bigger model or a new temperature doesn't change what the field means, and a longer system prompt is a weaker place to fix one field.

## Can you answer these from memory?

**Flash cards**

- **What is a tool description?** The text that tells the model what a tool does and when to use it.
- **What must it say?** What it does, when to use it, when not to, its parameters, and what it returns.
- **Why does it matter most?** Anthropic calls detailed descriptions the most important factor in tool performance.
- **How should parameters be named?** Clearly, like user_id not user. Add the format and one example.
- **What about many tools?** Anthropic says too many or overlapping tools distract the agent. Merge related actions into fewer tools.
- **How do you know it is good?** Run realistic test tasks, count wrong picks, and rewrite the descriptions behind them.

## Likely follow-up questions

- Q156 What is tool (function) calling? https://designervenkat.online/interview/ai/what-is-tool-calling
- Q164 What is the Model Context Protocol (MCP)? https://designervenkat.online/interview/ai/what-is-the-model-context-protocol
- Q175 What makes a tool-calling loop reliable enough to ship? https://designervenkat.online/interview/ai/reliable-tool-calling-loop
- Q176 How should an agent handle tool errors and retries? https://designervenkat.online/interview/ai/how-should-an-agent-handle-tool-errors-and-retries
- Q177 What makes a good tool set? https://designervenkat.online/interview/ai/what-makes-a-good-tool-set

## Learn it in depth

- [Function Calling](https://designervenkat.online/learn/ai-engineering/function-calling)
