← all posts
agents·Lukas Babaliauskas·Aug 10, 2026·updated Nov 17, 2026·15 min read

Evaluating agent tool calls: what text evals can't see

Agent behavior drifts in the trace, not the prose. The four tool-call evaluators, the modes worth changing, and the expectations not worth pinning.

To evaluate an agent's tool calls, score the trace instead of the reply: which tools the agent called, in what order, with what arguments, how many times, and whether it refused or verified before acting. Grade each run against expected calls recorded from real traffic, compare the candidate model with the current one on the same cases, and read the failures by category rather than as one average.

The output looked identical. That is the sentence at the center of most agent migration incidents. Both models answered "I've refunded your order, you'll see it in three to five business days" — and one of them called issue_refund before lookup_order, on an order id it had not verified. Text evaluators cannot see that, because the thing that changed was never in the text.

Agent behavior is a trace: which tools, in what order, with what arguments, and how many times. It drifts independently of prose quality, which is why a migration can pass every judge criterion you wrote and still be the wrong deploy. This post covers what to score on the trace, how to score each part, and what to leave out of your expectations.

A disclosure: I build EvalShift, a tool for testing model changes on agents. It has a short section at the end. Everything before it works with any harness that records tool calls.

Why can't text evaluators see agent regressions?

Because on the turns where an agent does its work, there is often no text to score. A turn where the model answered only with tool calls gives an embedding nothing to embed and a judge nothing to judge, and a tie between two empty strings is not a judgment.

A sensible harness skips those turns rather than inventing a score. That is correct, and it also means your text evaluators contribute nothing on the most agent-shaped turns in the suite. If tool calls are how your product does its work, trace checks are not an addition to your eval config. They are the config.

The asymmetric case still belongs to the text side: a new model that went silent where the current one answered in prose is exactly the regression an output comparison exists to catch. Checking the end state is not a substitute for the trace either.

The Berkeley Function Calling Leaderboard paper ↗ scores its multi-turn tasks on both the final system state and the call sequence, because the state cannot show whether a read-only function such as a lookup was ever called. lookup_order changes nothing, so neither the reply nor the database shows that it was skipped. Only the trace does.

What should you score on an agent trace?

Five things: tool selection, arguments, the shape of the loop, refusals, and verification before risky actions. Each fails independently, so each needs its own check and its own line in the report.

CheckQuestion it answersExample failure
Tool selectionDid it call the right tools, in an acceptable order?issue_refund with no lookup_order first
ArgumentsSame tools, right values?A refund issued on the wrong order id
Loop shapeHow many calls, and in parallel or not?Five searches where one used to do
RefusalsDoes it decline the same requests?Starts refusing a routine cancellation
VerificationDid a check run before a risky call?transfer_funds with no confirm_with_user

The failure analysis in τ-bench ↗, a benchmark of simulated customer-service conversations, shows why one score is not enough. The authors read 115 retail trajectories of a gpt-4o function-calling agent and sorted the 36 failures the agent caused by type. No single check would have caught them all:

Failure (τ-bench retail, gpt-4o)Share of 36 failuresCheck that sees it
Wrong argument, or wrong information given to the userabout 55%Arguments (output, for the information)
Wrong decision: the wrong type of tool call25%Tool selection
A compound request only partly resolved19%Tool selection, call count

Scoring single calls also overstates how well a loop works. In the BFCL paper, gpt-4o-2024-11-20 in function-calling mode scored 93.5 on single-turn tasks that choose among several functions and 62.5 on the base multi-turn category, where an entry counts as correct only if every turn passes. Score each round of the loop, not just the first call.

How do you check tool selection?

Compare the calls against two references: the calls you expected, which measures correctness, and the calls the current model made, which measures drift. Then decide per case whether order matters.

The current model is a baseline, not an oracle. Grading both models against recorded expected calls tells you which one is right; comparing the candidate with the current model only tells you what moved. When both models miss the expected calls, suspect the case before the model: ground truth the current model also fails is usually a broken harness, not a migration finding.

For drift, compare the sets of tool names by default, so that reordered identical calls do not read as change, and switch to an exact sequence where order carries meaning, like a lookup before a refund. Calls issued in parallel have no order to compare; BFCL ignores their order for the same reason. Google's Vertex AI agent evaluation ↗ names the common variants, and they are a useful menu whichever tool you use:

MetricWhat it scoresOrderExtra calls
Exact match1 if the same calls appear in the same orderMust matchFail
In-order match1 if every expected call appears, in orderMust matchAllowed
Any-order match1 if every expected call appearsIgnoredAllowed
PrecisionShare of calls made that were expected (0 to 1)IgnoredLower the score
RecallShare of expected calls that were made (0 to 1)IgnoredNo effect
Single tool use1 if one named tool appears at allIgnoredAllowed

Make "no tool call" an expectation too. A policy question ("what is your refund window?") should be answered without touching the database, and a case that expects zero calls passes only if none were made. BFCL's irrelevance category tests exactly this, offering tools when none should be called: gpt-4o-2024-11-20 scored 83.1 there in function-calling mode.

Abstention can move when nothing but the calling setup changes. On BFCL's multi-turn missing-function category, where the right move is to say that no available tool fits, the same model scored 6.0 in function-calling mode and 41.0 when prompted to write its calls as text.

Small slices need a severity floor. The canonical agent migration failure — the candidate quietly stops calling notify_security_team on security-sensitive tickets — is a small effect on a small slice. Unless a regression on that check can never be classified below, say, high, it gets filed as low next to a formatting nit.

How do you check tool arguments?

Pair each call with its counterpart on the other side, then compare argument values field by field, with a strategy chosen per field. A valid schema is not enough: strict tool-use modes guarantee the shape of the arguments, not that the values are right.

Match calls by tool name and nearest position in the sequence. Then compare exact for ids and enums, subset for lists, numeric with a relative tolerance for amounts, and embedding similarity for free text such as a search query. Fields you do not list should default to exact.

Anthropic's strict tool use ↗, for example, constrains sampling so that a tool's input always matches its JSON schema: passengers: 2, never "two". That removes a class of errors and leaves the one τ-bench saw most, where the agent makes the right type of call and fills in one or more arguments wrongly. Invented ids are the case to watch when the candidate is a cheaper model: in τ-bench, gpt-4o made 0.46 calls per retail task with user, product, order or item ids that do not exist, and gpt-3.5-turbo made 2.08.

Two defaults carry real judgment:

  • +A field present on one side only is a partial mismatch, not a wrong value. Omitting an optional parameter is a real difference, but scoring it 0 puts it level with passing the wrong order id.
  • +Decide what you compare against. Drift mode, candidate against current model, gives the current model a perfect score by construction: fine for "did anything move", wrong for "is it right". A hallucinating baseline scores perfectly forever, so if your suite came from real captures, you have the ground truth; score both models against the expected arguments.

How do you check the shape of the loop?

Count the calls, check whether they ran in parallel, and compare refusals. Allow a small tolerance on the count, and treat any refusal mismatch as serious.

Compare the number of calls with a tolerance (one is a sensible default), whether the calls were issued in parallel, a fixed expected count where the task has one, and whether both models refused the same cases. Each of these should be possible to switch off on its own.

Refusals are the sharp edge. A model that started refusing work it used to do, or stopped refusing work it used to decline, is never a low-severity finding — and it is invisible to every evaluator that scores output text, because a refusal is fluent, well-formed prose.

Refusal rates move with small changes. On the 250 safe prompts of XSTest ↗, Mistral-7B-Instruct-v0.1 fully refused 0.8% with no system prompt and 9.6% with a guardrail system prompt added. Llama-2-70b-chat-hf fully refused 38% with its original system prompt and 14% without one. Neither change touched the weights.

How do you catch a missing verification step?

List the tools that change something you cannot undo, list the tools that count as a check, and flag any risky call with no check before it. Separately, flag any risky call the candidate makes that the current model did not.

Those two flags are worth encoding before you need them, because they are the failures that turn a quality regression into an incident report. They work on traces from any loop — LangChain, a custom orchestrator, another language entirely — as long as each call is recorded in order with its arguments.

The base rate is not low. ToolEmu ↗, which emulates 36 high-stakes tools across 144 test cases, found that even the safest agent it tested had risky failures 23.9% of the time, according to its automatic evaluator. In the authors' human evaluation, 68.8% of the failures ToolEmu identified would be valid real-world agent failures.

Why read regression categories instead of an average?

Because a category names the bug and an average does not. Label every regression by kind: selection, argument value, call count, order, dangerous action, missing verification, unnecessary call, refusal.

The grouping is the point. "Agent quality dropped 4%" is not actionable and not even really a claim. "Twelve argument-value regressions on issue_refund.amount_usd, everything else flat" names the bug, and usually names the fix too — that one is almost always a formatting change in how the model emits numbers, not a change in what it believes the refund should be.

How strict should the gate be?

Strict enough to block a real change, loose enough to survive the model's own variance. Budget the share of cases allowed to drift, put a floor under each case's argument score, and measure the current model against itself before you pick the numbers.

The floor is what keeps the budget honest. Without it, a long tail of tiny per-field differences — each individually below anyone's attention — averages into a number that clears any threshold you would be willing to write down.

The variance is real. In τ-bench, gpt-4o solved 61.2% of retail tasks and 35.2% of airline tasks on a single try, and its chance of solving the same retail task in all of eight trials fell to 25%. A budget tighter than the current model's own rerun spread will fail the current model.

What does not belong in the trace expectations?

Anything that records circumstance rather than behavior: values regenerated per run, retry loops, and turns that follow a failed tool result. The failure mode on the other side is a suite so strict nobody can merge anything.

  • +Timestamps, request ids, session tokens, and anything else regenerated per run. Score them with numeric tolerance or leave them unlisted only if they are genuinely stable — otherwise drop them from the expectations.
  • +Retry loops. A recorded run that called the same tool three times because the first two timed out is a story about your network, and pinning an expected call count on it makes an infrastructure flake into a permanent model regression.
  • +Tool results that failed (error, or {"success": false}). The model's next move was a reaction to a broken tool, not a decision worth reproducing.

Start with tool names only, watch what the diff actually flags for a week, and tighten to arguments once you know which fields carry meaning. A gate people learn to re-run until it passes is worse than no gate.

Doing this with EvalShift

Disclosure again: I'm the founder. EvalShift runs the paired comparison above and scores it with four tool-call evaluators. All of them are pure computation over recorded traces: no API calls, no cost, no opinion that can be argued with. Configure all four and you are still paying less than one judge criterion.

The toolset travels with the example. Nothing on the prompt marks it as an agent prompt. The toolset rides on each golden-suite example — a content-addressed toolset_ref pointing at a sidecar under .evalshift/toolsets/, or an inline tools list — so one suite mixes agent and text-only rows. Each response is recorded as a provider-agnostic ToolTrace: ordered ToolCalls with tool_name, arguments, call_id, parent_call_id and sequence_index, plus final_text and refusal info.

A toolset accepts both provider shapes, as a flat list or {"tools": [...]}:

yaml
- name: issue_refund
  description: Issue a refund on an existing order.
  input_schema:
    type: object
    properties:
      order_id:   {type: string}
      amount_usd: {type: number}
    required: [order_id, amount_usd]

The model client serializes it for Anthropic, OpenAI or Gemini, so a cross-provider migration has no hand-maintained second copy of your schemas to drift. evalshift capture sync writes one sidecar per distinct toolset your captures recorded and stamps each example's toolset_ref, so the schemas your suite replays are the ones your agent actually offered. It also warns when a promoted turn contains a failed tool result. Hand-authored suites inline tools: instead, and tools: [] is a real value: "this example's agent had no tools available" is an assertion, not an absence.

Text evaluators step aside on tool-only turns. When both sides answered with tool calls and no prose, semantic writes no record at all, and llm_judge does the same without spending a judge call. A target that went silent where the source answered in prose is still scored.

tool_selection writes two independent records, because a migration asks two questions:

AxisComparesStrategies
conformanceEach side, absolutely, against the example's expected_toolsexpected (default — matched in order), expected_set (order-insensitive multiset recall, for parallel fan-outs), off
divergenceThe target against the sourceset (default — Jaccard over the tool-name sets), exact (sequence equality), first (first call only), off

A row where both sides missed the expected tools is tagged TOOL_GROUND_TRUTH_MISS and left out of the policy rates. Examples marked expected_no_tools score 1.0 on conformance if and only if zero calls were made. Turning both axes off is a config error, and severity_floor: low|medium|high|critical keeps a regression from being classified below the floor regardless of effect size.

tool_arguments matches calls greedily by (tool_name, nearest sequence_index) and scores each field exact, subset, numeric (relative error decaying linearly to zero at numeric_tolerance, default 0.05) or semantic (embedding cosine, borrowing the configured semantic evaluator's model and cache — without one it degrades to exact). Unlisted fields default to exact. A field present on one side only scores 0.5; optional_fields_scored: strict restores 0.0.

Default drift mode pins source_score at 1.0. against: expected scores both sides against expected_tools[].arguments instead, where each expectation's match_strategy picks the keys: exact compares the union, subset and contains_per_field only the recorded keys. An expected call the model never made scores 0; an example with no expected arguments is skipped neutrally at 1.0/1.0.

tool_trace_structure checks call-count drift within call_count_tolerance (default 1), parallelism, expected_tool_count when set, and refusal alignment, each toggled by check_call_count, check_parallelism and check_refusals. A refusal mismatch forces severity to at least high and flags REFUSAL_REGRESSION.

agent_trace is for agent loops that run outside EvalShift. Run the model-call stage, then attach full timelines, one trace per (prompt_id, example_id, role) line, in the same event schema the capture SDK writes:

bash
evalshift traces import <run-id> --source source_traces.jsonl --target target_traces.jsonl

It scores order similarity (LCS-normalised), per-field argument equality on matched calls, and missing verification. An extra dangerous call on the target flags DANGEROUS_ACTION_DRIFT; a dangerous call with no preceding verification tool flags MISSING_VERIFICATION_STEP:

yaml
evaluators:
  agent_trace:
    - name: safety
      check_missing_verification: true
      verification_tools: [confirm_with_user]
      dangerous_tools: [delete_record, transfer_funds]

Labels and the gate. Regressions carry machine-readable labels that the report and the Cloud diff group by: TOOL_SELECTION_DRIFT, ARGUMENT_VALUE_DRIFT, TOOL_TRACE_STRUCTURE_DRIFT, TOOL_ORDER_DRIFT, DANGEROUS_ACTION_DRIFT, MISSING_VERIFICATION_STEP, UNNECESSARY_TOOL_CALL, REFUSAL_REGRESSION, alongside the text-side ones. Two migration_policy fields budget the argument surface:

yaml
migration_policy:
  max_tool_argument_drift: 0.01
  tool_argument_drift_floor: 0.9

To start loose, capture sync --names-only makes the expected calls match on tool names only, ignoring arguments. The agent evaluation docs list every mode, strategy and default.

FAQ

How do you evaluate an AI agent's tool calls? Score the trace rather than the reply: which tools were called, in what order, with what arguments, how many times, and whether the agent refused or verified before a risky action. Grade each run against expected calls recorded from real traffic, compare the candidate with the current model on the same cases, and read failures by category.

Why can't text evaluators catch agent regressions? Agent behavior drifts in the trace, not the prose. A refusal regression is the clearest case: a model that started refusing work it used to do is invisible to every evaluator that scores output text, because a refusal is fluent, well-formed prose.

What does the tool_selection evaluator check? Whether the right tools were called, across five modes: expected (the default, comparing both sides against the example's expected_tools in order), expected_set, exact, set, and first. The default compares against recorded ground truth rather than the source model, which is a baseline, not an oracle.

What does the tool_arguments evaluator check? Argument values on matched calls, scored per field by an exact, subset, numeric, or semantic strategy. By default it measures drift against the source, which pins the source score at 1.0 by construction; setting against: expected scores both sides against the expected arguments and measures correctness instead.

What should not go in trace expectations? Anything regenerated per run — timestamps, request ids, session tokens — plus retry loops, which turn an infrastructure flake into a permanent regression, and turns containing failed tool results, where the model's next move was a reaction to a broken tool rather than a decision worth reproducing.

Keep reading