Check agent tool calls
check_tool_callsCompare an agent's tool-call trace to expected calls to verify tool choice, order, and arguments, and get a pass flag, score, and mismatch reasons.
Instructions
Compare an agent's tool-call trace (evalsmith, Anthropic Messages or OpenAI format, as logged) with the expected calls: right tool, right order (strict or lax) and arguments that satisfy exact / regex / subset / any matchers. Use it to test an agent change against a known-good trace. Returns a pass flag, a score and a reason for every mismatch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | strict: the trace must be exactly the expected calls, in order. lax: every expected call must appear somewhere; order and extra calls are allowed. | strict |
| trace | Yes | Tool calls the agent made, in order. Accepts evalsmith calls ({ "tool", "args" }), Anthropic Messages (messages or content blocks with type "tool_use"), OpenAI Chat messages with "tool_calls" and OpenAI Responses items with type "function_call"; other conversation items are skipped. | |
| expected | Yes | Expected calls. Argument matchers: {"type":"exact","value":...}, {"type":"regex","pattern":"..."}, {"type":"subset","value":{...}}, {"type":"any"}. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calls | No | Tool names of the trace, in call order. Used to draw the expected vs. actual view. | |
| order | Yes | strict: the trace must be exactly the expected calls, in order. lax: every expected call must appear somewhere; order and extra calls are allowed. | |
| score | Yes | Matched expected calls / expected calls. | |
| steps | Yes | ||
| passed | Yes | ||
| summary | Yes | ||
| unexpected | Yes |