code · freeuipathdeterministicmirrors uipath.eval ToolCallOrderEvaluator
Tool call order
Tool call order checks that the expected tool names occur in the expected order within the actual calls, as an ordered subsequence. It mirrors UiPath's ToolCallOrderEvaluator and is free.
Run this example in the console runs in code · $0
What the evaluator does
Walk the actual call names; each time the next expected name appears, advance. Score is advanced / expected.
frame 1/4 · the two inputs
actual names
send_email → lookup_order
expected names
lookup_order → issue_refund → send_email
1.expect lookup_order: found at position 2
2.expect issue_refund: not found after it
3.stop
1/3score 0.33
runs in code · $0 · ~0 ms · deterministic
Reach for it when
- Workflows where sequence matters: look up before refund, refund before notify.
Not the right tool when
- Order is irrelevant (use tool_call_count).
Watch out for
- Extra calls between expected ones are allowed; only order of the expected names is checked.
What to send
required fields
tool_callsexpected_tool_calls
optional fields
none
in suites
AgentEverything
result shape
score 0–1 computed in code, label, passed at an evaluator-specific threshold, no probabilities.
POST /api/v1/evaluateopen in console
{
"evaluators": [
"tool_call_order"
],
"output": "…",
"tool_calls": [
{
"name": "send_email"
},
{
"name": "lookup_order"
}
],
"expected_tool_calls": [
{
"name": "lookup_order"
},
{
"name": "issue_refund"
},
{
"name": "send_email"
}
]
}expected
Only lookup_order can be matched in order: 1/3.
Aggregate with
One result per item is a fact; a dataset of them is a metric. These are the aggregations that fit this evaluator's output shape.
tool_call_countcode · free
Per-tool call counts match the expected counts.tool_call_argscode · free
Share of expected tool calls that appear in the output with exactly matching arguments.trajectory_stepsjev
Instead of one prose verdict from an LLM prompt, each expected step gets its own probability that the agent performed it, plus an order judgment, in one call. Score is the share of steps performed.- Does tool call order penalise extra calls?
- No. It only checks that the expected names appear in order. Use tool_call_count for extras.