A Tool Description Is a Spec
Why This Matters
The model chooses a tool mainly by reading its name, description and input schema; the prompt and the conversation steer it too, but the description matters most. A vague description is a vague requirement, and you get what testers always get from vague requirements: something that works in the demo and fails in the corner cases.
What the model sees
{
name: "get_test_history",
description: "Returns the outcome (passed, failed, skipped) of one test in the most recent CI runs on the same branch, newest first, plus the failure rate. Use it to decide whether a failure is new or recurring. Does not return logs or error messages; use read_log for those.",
input_schema: {
type: "object",
properties: {
testId: { type: "string", description: "The test id from the run, e.g. t-004" },
runs: { type: "integer", minimum: 1, maximum: 50, description: "How many recent runs to include (default 20)" },
},
required: ["testId"],
},
}
What a good description says
- What it returns, concretely.
- When to use it: the question it answers.
- When not to use it, and which tool to use instead.
- Limits: maximum results, what is trimmed, what is never included.
Parameter descriptions matter as much as the tool description. testId with an example prevents the model from passing the test name instead.
Overlapping tools
Suppose you have search_issues (search by text) and get_issue (fetch one by id). For “is there already a ticket for this failure?”, both look right, and the model will sometimes call get_issue with a made-up id. Two fixes:
- Sharpen the boundaries: “
get_issue: only use with an id you received fromsearch_issuesor the user.” - Merge them: one
find_issuestool that accepts either a query or an id.
When two tools keep getting confused, merging is often the better design.
Names that pull the wrong way
Names carry meaning. A tool called check_failure will be called for every failure, because it sounds like what the task is. get_test_history says exactly what it does and is only called when history is needed.
tool_choice: who decides whether a tool is called
The description decides which tool the model picks. tool_choice decides whether it must pick one:
tool_choice | Behaviour | TestPilot use |
|---|---|---|
{ type: "auto" } (default) | The model may call a tool or answer directly | The investigation loop |
{ type: "any" } | The model must call a tool, any of them | A step that must gather evidence first |
{ type: "tool", name: "submit_verdict" } | The model must call this tool | Forcing the final verdict into a schema (lesson 9), on models that allow forcing |
{ type: "none" } | The model may not call tools | A summary step that must only use what it has |
Two details that show up in exam scenarios: forcing a tool (any or tool) means the model goes straight to the call without explaining itself first, forcing fails with manual extended thinking, and some current models (Opus 5.5, Sonnet 5.5, Fable 5.x, Mythos 5.x) reject any and tool altogether with a 400 error. If a scenario needs both reasoning and a guaranteed schema, use auto with a submit_verdict tool plus validation in code, or native structured output.
Test your descriptions
Tool choice is behaviour, so test it like behaviour: give TestPilot three failures and log which tools it calls, in which order.
| Failure | Expected tools | Actual |
|---|---|---|
| t-002 discount | history, commit diff | |
| t-004 search | history, log | |
| t-005 payment | log |
Exercise
Here are three weak descriptions. Rewrite them, and compare the tool calls before and after on the three failures above:
get_test_history: "Gets history."
read_log: "Reads logs for a test. Useful for debugging."
search_issues: "Searches Jira."