Skip to content
mentoor

Topic 6 of 6 · 5 min read

Testing tools with real agent runs

Goal: Read transcripts from a tool evaluation and name the change to a tool definition that fixes the most frequent misuse.

You find out whether a tool works by running an agent on realistic tasks and reading what it did, not by reading the definition and feeling good about it. The author knows what the tool means. The model does not.

Check yourself · 1 of 3

What is the main value of reading full transcripts from a tool evaluation?

Choose one answer

Why it matters

A tool can pass every unit test and still fail in use, because the failure is in the model's reading of the name, the description or the output. These failures are invisible in code review. They show up only when a model tries real tasks, and they change when you change the definition, the model or the other tools next to it.

How to do it

  1. Write 10 to 30 realistic tasks. Real user requests, with a known good outcome you can check automatically: "Which customers on the Pro plan have an open ticket older than 7 days?" Include multi-step tasks and a few that need no tool.
  2. Run the agent on each task with your tools and record the full transcript: every call, argument, result and error.
  3. Score the outcome, not the path. Did it get the right answer? Also record number of calls, tokens and errors.
  4. Read the transcripts. This is the main step. Look for patterns, not single failures: the same wrong tool, the same misread parameter, repeated retries after one error, huge results the agent ignored.
  5. Name the change that fixes the most common pattern. If the agent calls search when it should call get in nine of twelve failures, the fix is in those two descriptions, not in twelve prompts.
  6. Change one thing, rerun the same tasks and compare. Keep a held-out set so you do not tune to the examples.
  7. Rerun when anything changes: a new model, a new tool, a new description.

Before and after

Run 4 (task: "find Dana's open tickets")
  tickets_search { "query": "Dana" }        -> 20 results, none by Dana
  tickets_search { "query": "Dana Reyes" }  -> 20 results, none by Dana
  tickets_search { "query": "dana@acme.io" } -> 20 results, none by Dana

The agent keeps searching text when it needs an assignee filter. Adding assignee_email to the schema and a line "To list one person's tickets, use assignee_email, not query" removes the pattern. Rerunning the same 20 tasks shows the call count falling.

What goes wrong

  • Toy tasks. Easy one-step prompts pass and hide the confusion that shows on messy requests.
  • Blaming the model. Many failures are definitions that a person could not use either.
  • Tuning to the test. Descriptions that mention your sample questions pass the set and fail in production.

Examples

Reading an evaluation summary

Across 24 tasks: 17 correct, 7 wrong. In the 7 wrong runs, 5 show orders_get called with a customer email in the order_id field, followed by a not found error.

The most frequent misuse is the parameter, not the tool choice. Fix: rename to order_id with the description "Starts with ORD-" and add to the error "Looks like an email. Use orders_search with customer_email." Rerun the 24 tasks.

A held-out set

You write 30 tasks. Tune descriptions against 20 of them. The other 10 stay untouched until you want to know whether the changes generalise. If the 20 improve and the 10 do not, the descriptions were fitted to the examples rather than made clearer.

Key points

  • Test tools with realistic tasks and an agent, because misuse comes from how the model reads the definition.
  • Record full transcripts of calls, arguments, results and errors, and read them, not only the pass rate.
  • Look for patterns across runs, such as the same wrong tool or the same misread parameter.
  • Fix the most common pattern in the tool definition, change one thing at a time and rerun the same tasks.
  • Keep a held-out task set and rerun the evaluation when the model, tools or descriptions change.

Common mistakes

  • Judging a tool by unit tests and a quick manual try, without running an agent on realistic tasks.
  • Looking only at the pass rate and never reading transcripts, so the cause of failures stays unknown.
  • Fixing each failed run with a prompt patch instead of changing the tool definition behind the pattern.
  • Changing several things between runs, so nobody knows which change helped.

Check yourself · 2 of 3

In 12 failed runs, nine show the agent calling search when it should call get_by_id. What is the best fix?

Choose one answer

Check yourself · 3 of 3

Why keep some evaluation tasks held out while you tune tool descriptions?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic