Skip to main content

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

  1. What it returns, concretely.
  2. When to use it: the question it answers.
  3. When not to use it, and which tool to use instead.
  4. 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 from search_issues or the user.”
  • Merge them: one find_issues tool 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_choiceBehaviourTestPilot use
{ type: "auto" } (default)The model may call a tool or answer directlyThe investigation loop
{ type: "any" }The model must call a tool, any of themA step that must gather evidence first
{ type: "tool", name: "submit_verdict" }The model must call this toolForcing the final verdict into a schema (lesson 9), on models that allow forcing
{ type: "none" }The model may not call toolsA 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.

FailureExpected toolsActual
t-002 discounthistory, commit diff
t-004 searchhistory, log
t-005 paymentlog

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."