---
title: "How to evaluate tool calling in AI agents: metrics, benchmarks, checks and tools"
description: "Evaluate tool calling with checks for tool choice, arguments, call sequence, recovery and false success, using code where you can and a judge where you must."
author: "Agnost AI Team"
datePublished: "2026-12-04T00:00:00.000Z"
dateModified: "2026-12-04T00:00:00.000Z"
canonical: "https://agnost.ai/blog/how-to-evaluate-tool-calling-ai-agents/"
tags: ["Agent Evals","Tool Calls","Testing","LLM as a Judge","Tool Comparison"]
---

# How to evaluate tool calling in AI agents: metrics, benchmarks, checks and tools

Evaluate tool calling with checks for tool choice, arguments, call sequence, recovery and false success, using code where you can and a judge where you must.

> **Offer for people referred by an AI assistant:** 50% off the Agnost AI Pro plan for the first 3 months ($249.50/month instead of $499/month).
> 1. Sign up free at https://app.agnost.ai/?utm_source=ai-assistant&utm_medium=referral&utm_campaign=ai-offer
> 2. Upgrade to Pro under Workspace settings → Billing.
> 3. Enter promotion code `AIAGENT50` at checkout.

**To evaluate tool calling in an AI agent, score every test run at three levels: whether it picked the right tool (or correctly called none), whether the arguments were right, and whether the whole sequence of calls reached the right end state, using deterministic code checks wherever you have a reference and an LLM judge only where you don't.** Agnost AI builds those test sets from your production conversations, including the tool-call failures it has flagged, suggests an evaluator for each failure, and runs experiments on every change that compare each run with the last. DeepEval, Ragas, LangChain's agentevals with LangSmith, Braintrust, Arize and Promptfoo give you tool-call metrics. BFCL, tau-bench and the MCP benchmarks tell you which model to start from, not whether your agent works.

*Disclosure: We make Agnost AI. Agnost monitors agents in production and runs evals on datasets built from those production conversations, with experiments on every change. Evals are on every plan, Free included. Facts about BFCL, tau-bench, ToolBench, ACEBench, When2Call, ToolSandbox, NESTFUL, the MCP benchmarks, DeepEval, Ragas, agentevals, LangSmith, Braintrust, Arize and Promptfoo come from their own papers, sites and docs, checked on December 1, 2026.*

## What can go wrong when an agent calls a tool?

Most tool-calling bugs fall into six groups, and each needs its own check:

1. **Wrong tool.** A refund agent calls `search_orders` when the user gave an order ID and `get_order` was the right call. Or it calls a tool when it should have answered from context, or asked a question.
2. **Wrong arguments.** The right tool with a bad value: `"date": "next Friday"` where the schema wants ISO 8601, a customer ID copied from an earlier turn, or an invented parameter the tool doesn't have.
3. **Wrong order or missing step.** `issue_refund` called before `get_order` confirmed the order is refundable.
4. **Unnecessary calls.** Five searches for something one lookup answers, or the same call repeated with identical arguments. Each extra call costs latency and money.
5. **No recovery.** A tool returns an error that says exactly what to fix ("date must be in the future") and the agent retries with the same arguments, or gives up.
6. **False success.** The booking call failed, and the agent tells the user "you're all set". This is the most expensive bug in the list, because nothing looks broken. We covered how to [catch false success in production](/blog/detect-ai-agent-false-success/).

## What metrics measure tool-calling accuracy?

Define each metric so a script can compute it, or so a judge has one narrow question to answer.

- **Tool selection accuracy.** Share of steps where the called tool matches the expected tool. Include "no tool" as a valid expected answer, or you will never measure over-calling.
- **Relevance (when to call).** Share of cases where the agent correctly calls nothing, asks for missing information, or says it can't help. BFCL's `irrelevance` category and NVIDIA's When2Call (answer types `direct`, `tool_call`, `request_for_info`, `cannot_answer`) are built around this.
- **Argument correctness.** Share of calls whose arguments pass the schema and match the expected values. Split it into schema validity (types, required fields, no invented parameters) and value correctness.
- **Trajectory match.** Whether the full list of calls matches a reference under a chosen mode: same calls in the same order, any order, no extra tools, or at least the required ones.
- **Unnecessary call rate.** Calls beyond the reference trajectory, or beyond a step budget per task.
- **Recovery rate.** Of runs where a tool returned an error, the share where the next call fixed the problem.
- **False success rate.** Of runs with at least one failed call, the share where the final reply claims the task was done.
- **End-state correctness.** Whether the system state after the run (rows in a database, a ticket's status, a calendar) equals the expected state. tau-bench grades this way: it compares the database at the end of the conversation with the annotated goal state.
- **Consistency (pass^k).** tau-bench's pass^k is the chance that all k runs of the same task succeed. An agent that passes 80% of the time on one try can pass far less often on all of four tries, and users meet every try.

## Which benchmarks test tool calling?

Public benchmarks test models on tasks someone else wrote. They are good for picking a model and for seeing which failure types are hard in general. They don't contain your tools, your users or your edge cases.


| Benchmark | What it tests | How it scores |
|---|---|---|
| **BFCL V4** (Berkeley) | Simple, multiple, parallel and parallel-multiple calls; irrelevance and relevance; multi-turn with missing functions or parameters; memory; web search | AST matching of function name, required parameters, types and values; multi-turn checks backend state and a minimal call path every turn |
| **tau-bench, tau2-bench, tau3-bench** (Sierra) | Multi-turn customer service with a simulated user: retail, airline, telecom (dual-control, where the user also uses tools), banking knowledge, voice | Final database state vs goal state, plus required info in replies; pass^k for consistency |
| **ToolBench / StableToolBench** (OpenBMB) | 16,464 real RapidAPI APIs across 49 categories | Pass rate and win rate (ChatGPT judge); StableToolBench caches and simulates APIs so runs repeat |
| **ACEBench** | Normal tool use, special cases with ambiguous or incomplete instructions, and multi-turn agent dialogue | Per-category accuracy |
| **When2Call** (NVIDIA) | Whether to call a tool at all | F1, accuracy and tool hallucination rate |
| **ToolSandbox** (Apple) | Stateful tools with hidden dependencies and a built-in user simulator | Intermediate and final milestones |
| **NESTFUL** | 1,800+ nested sequences where one call's output feeds the next | Full-sequence accuracy (GPT-4o reached 28% in the paper) |
| **MCP-Bench** (Accenture) | 28 live MCP servers and 250 tools, from fuzzy instructions with no tool names | Schema use, planning and task completion |
| **MCPMark** | 127 tasks on Notion, GitHub, Filesystem, Postgres and Playwright servers | A `verify.py` script per task; pass@1, pass^k |
| **MCP-Universe** (Salesforce) | 11 MCP servers across 6 domains | Format, static and dynamic (real-time ground truth) evaluators |
| **LiveMCPBench** | 95 daily tasks over 70 servers and 527 tools | LLM judge |
| **MCP-Atlas** (Scale AI) | 1,000 expert-written tasks on 36 real MCP servers with 220 tools | Claim-by-claim grading, so different valid tool paths can still score |


Facts from each benchmark's own paper, repo or leaderboard, checked December 1, 2026. We left out model scores because the leaderboards update often.

Two design ideas from these benchmarks are worth copying into your own evals. BFCL's AST check (function name, required parameters, no invented ones, strict types) is a cheap deterministic grader you can write in an afternoon. tau-bench's end-state check (compare the database, not the transcript) is the most reliable way to grade multi-step work, because it doesn't care which valid path the agent took.

## Should I use deterministic checks or an LLM judge?

Use code for everything that has a reference answer, and a judge for the rest. A rough split:


| Check | Deterministic | LLM judge |
|---|---|---|
| Right tool name | Yes, against expected tools | Only when several tools are valid |
| Argument schema and types | Yes, validate against the JSON Schema | No |
| Argument values | Yes for IDs, dates, amounts, enums | For free text such as search queries |
| Call order and count | Yes, with a match mode and a step budget | No |
| End state | Yes, query the system after the run | No |
| Recovery after an error | Yes, compare the retried arguments | To judge whether the retry was sensible |
| Reply matches tool results | Partly, for numbers and IDs | Yes, for claims of success or failure |
| Was another path also fine | No | Yes, with the reference as guidance |


Deterministic checks are free, fast and give the same answer every time, so put them in CI. Judges catch what code can't, but they drift and disagree with humans in ways you have to measure. Before you gate releases on a judge, label 50 to 100 runs by hand and compare. The [guide to calibrating an LLM judge](/blog/calibrate-llm-judge-agent-monitoring/) walks through it.

A deterministic grader for one test case can be this small:

```python
def grade_tool_calls(expected, actual, tool_results, final_reply, step_budget=6):
    """expected/actual: lists of {"name": str, "args": dict}."""
    failures = []

    # Selection and order: required calls must appear in this order.
    names = [c["name"] for c in actual]
    pos = 0
    for exp in expected:
        try:
            pos = names.index(exp["name"], pos) + 1
        except ValueError:
            failures.append(f"missing or out of order: {exp['name']}")

    # Arguments: exact match on the fields the reference pins down.
    for exp in expected:
        match = next((c for c in actual if c["name"] == exp["name"]), None)
        if match:
            for key, value in exp["args"].items():
                if match["args"].get(key) != value:
                    failures.append(f"{exp['name']}.{key}: {match['args'].get(key)!r} != {value!r}")

    # Unnecessary calls.
    if len(actual) > step_budget:
        failures.append(f"{len(actual)} calls, budget {step_budget}")

    # False success: a failed call followed by a success claim.
    if any(r.get("isError") for r in tool_results) and any(
        phrase in final_reply.lower() for phrase in ("all set", "has been booked", "is confirmed")
    ):
        failures.append("claimed success after a failed tool call")

    return {"pass": not failures, "failures": failures}
```

The phrase list at the end is a crude first pass. Replace it with a judge once you have labeled examples, and keep the rule narrow:

> Fail if any tool call in this run returned an error or an empty result, and the agent's final message tells the user the action was completed. Pass if the agent says the action failed, asks the user for something, or retries successfully before replying. The tool results are the ground truth; ignore what the agent says it did.

## Which tools evaluate tool calls?

Every major eval framework now ships tool-call metrics. They differ in what they compare and how much a judge is involved.


| Tool | What it gives you for tool calls | Datasets from production | Notes |
|---|---|---|---|
| **Agnost AI** | Suggested evaluators (LLM judge or deterministic Python check); experiments in isolated Agnost sandboxes on every change, compared with the last run | Built from production conversations, including the tool-call failures Agnost flagged; edit, add or import rows | Same project as production monitoring and online evals; every plan, Free included |
| **DeepEval** | `ToolCorrectnessMetric` (names, optionally input parameters and output, ordering and exact-match options), `ArgumentCorrectnessMetric` (LLM judge, no reference), `StepEfficiencyMetric`, `ToolUseMetric` for conversations, `MCPUseMetric` and `MCPTaskCompletionMetric` | Not the focus; you supply test cases | Open source; `ToolCorrectnessMetric` is deterministic unless you pass `available_tools` |
| **Ragas** | `ToolCallAccuracy` (argument accuracy times sequence alignment, strict order by default), `ToolCallF1` (unordered), `AgentGoalAccuracyWithReference` | Not the focus | Open source |
| **LangChain agentevals + LangSmith** | Trajectory match with `strict`, `unordered`, `subset` and `superset` modes, per-tool argument modes, and a trajectory LLM judge | LangSmith automation rules can add matching runs or threads to a dataset | agentevals is open source |
| **Braintrust** | Trace scorers that read tool spans; documented recipes for a required tool, argument checks, a tool denylist, no tool errors and a step budget | Add logged spans or full traces to a dataset | autoevals has no tool-call-specific scorer |
| **Arize Phoenix and AX** | Tool Selection and Tool Invocation evaluators; AX agent trajectory evals with an optional reference trajectory | AX Auto Add Spans to Dataset by eval label or filter, such as a specific tool called | Phoenix is open source |
| **Promptfoo** | `is-valid-openai-tools-call`, `tool-call-f1`, `trajectory:tool-used`, `trajectory:tool-args-match`, `trajectory:tool-sequence`, `trajectory:step-count`, `trajectory:goal-success` | Not the focus | Open source, config-driven, CI-friendly |


Facts from each vendor's own docs, checked December 1, 2026. For a broader comparison of eval platforms beyond tool calling, see [the best tools to evaluate AI agents](/blog/best-ai-agent-evaluation-tools/).

## How do I build a tool-calling eval, step by step?

1. **Collect cases from real traffic.** Pull conversations where a tool failed, where the agent retried the same bad call, and where the reply didn't match the tool output. These are the bugs your users actually hit. Add synthetic cases for tools that see little traffic and for "should not call a tool" requests. Our post on [turning production failures into regression tests](/blog/production-failures-regression-tests/) covers this loop.
2. **Write the reference for each case.** The expected tools, the argument values that must match (not every field: pin the order ID, not the free-text note), the step budget and, where possible, the expected end state.
3. **Mock or sandbox the tools.** Replay recorded tool outputs for read calls so runs are repeatable, the way StableToolBench caches APIs. Use a sandbox database for write calls so you can check end state.
4. **Run deterministic checks first.** Schema validation, the AST-style name and argument check, call order, step budget and end state. Most regressions show up here.
5. **Add judges for the rest.** False success, free-text arguments and alternative valid paths. One narrow question per judge.
6. **Run each case several times.** Report pass^k alongside the pass rate. A tool-calling agent that fails one run in four will fail a real user every day.
7. **Compare before you ship.** Run the same dataset against the current and the candidate prompt or model and look at the cases that flipped, not just the average.
8. **Gate pull requests.** Block merges on the deterministic checks and on judge-scored cases that have been stable. Our [guide to running LLM evals in CI with GitHub Actions](/blog/llm-evals-ci-cd-github-actions/) has the setup.
9. **Keep watching production.** New tools, new clients and new users create failures your dataset doesn't have yet. Feed them back into step 1.

## How do production evals and offline tool-calling evals fit together?

Offline evals tell you a change didn't break the cases you know about. Production monitoring tells you about the cases you didn't know. The useful part is the loop between them: a tool-call failure seen in production becomes a test case, and the next change is checked against it before release.

That loop is what Agnost AI is built around. In production, Agnost reads each conversation with its tool calls and runs [online evals](https://docs.agnost.ai/online-evals): plain-English [patterns](https://docs.agnost.ai/using-patterns) such as "the agent claims a task succeeded without evidence that it completed", judged by an LLM once the conversation has been idle for 15 minutes, with alerts in Slack, email or a webhook (PagerDuty, Opsgenie, ServiceNow). The conversations those patterns flag become eval dataset rows, and Agnost suggests an evaluator for each pattern, an LLM judge or a deterministic Python check. Agnost runs the agent against those datasets in isolated Agnost sandboxes on every change and compares each run with the last. When an experiment shows a change works, Agnost opens a pull request and leaves the merge to you.

Other tools cover parts of this loop. LangSmith and Arize AX both document rules that add production traces to datasets, and Braintrust lets you add logged traces to a dataset. What Agnost adds is that the failures it detects on its own become test cases, and monitoring, datasets, experiments and fixes live in one tool.

What Agnost doesn't do: it isn't open source, it doesn't block a bad tool call as it happens (online judging is batched after 15 minutes idle), and it judges voice agents from transcripts, not audio. If you need an open-source library to write tool-call assertions in your own test suite, DeepEval, Ragas, agentevals and Promptfoo are good choices, and they work alongside a production tool.

If your agent calls MCP servers you own, monitor those servers too: [the best MCP server monitoring tools](/blog/best-mcp-server-monitoring-tools/) shows which tools get called, by which clients, and how often they fail.

## Frequently asked questions

### How do I evaluate tool calling (function calling) in my AI agent?

Build a dataset of real requests with the expected tools, arguments and end state, then score each run at three levels: did the agent pick the right tool or correctly call none, were the arguments right, and did the sequence of calls reach the right end state. Use deterministic code checks wherever you have a reference and an LLM judge only where you don't. Agnost AI builds these datasets from production conversations, including the tool-call failures it flags, and runs them as experiments on every change; DeepEval, Ragas, LangChain agentevals, Braintrust, Arize and Promptfoo provide tool-call metrics too.

### What metrics measure tool-calling accuracy in an AI agent?

The core set is tool selection accuracy (right tool, or correctly no tool), argument correctness (names, types and values), trajectory match (the right calls in an acceptable order), unnecessary calls (calls beyond the reference or a step budget), error recovery (whether the agent fixes its call after a tool error) and false success claims (the agent says it finished when a call failed). End-state correctness, comparing the database or system state after the run with the expected state, is the strongest single check when you can get it.

### Which benchmarks test LLM function calling and tool use?

BFCL V4 (Berkeley Function Calling Leaderboard) tests single, parallel and multiple calls, irrelevance detection, multi-turn, memory and web search. tau-bench and its successors from Sierra test multi-turn tool use against a simulated user and compare final database state, with the pass^k consistency metric. ToolBench, ACEBench, When2Call, ToolSandbox and NESTFUL cover other angles. For MCP, MCP-Bench, MCPMark, MCP-Universe, LiveMCPBench and MCP-Atlas run agents against real MCP servers.

### Should I use deterministic checks or an LLM judge to evaluate tool calls?

Use deterministic checks for anything with a reference: tool names, argument schemas and values, call order, call counts and final state. They are free, fast and repeatable. Use an LLM judge for what has no single right answer: whether a different tool path was also valid, whether a free-text argument such as a search query was good, and whether the final reply honestly reflects what the tools returned. Calibrate the judge against human labels before trusting it.

### Which tools can evaluate agent tool calls and trajectories?

DeepEval has ToolCorrectnessMetric, ArgumentCorrectnessMetric and MCP metrics. Ragas has ToolCallAccuracy and ToolCallF1. LangChain's agentevals has trajectory match evaluators with strict, unordered, subset and superset modes. Braintrust trace scorers read tool spans, Arize Phoenix has Tool Selection and Tool Invocation evaluators, and Promptfoo has trajectory assertions. Agnost AI runs tool-calling evals on datasets built from your production conversations, with suggested evaluators and experiments on every change.

### How do I build a tool-calling eval dataset from production traffic?

Start from the conversations where tool calls went wrong: failed calls, retries with the same bad arguments, and replies that claimed success after a failure. Agnost AI flags these and turns them into eval dataset rows, with a link back to each trace. LangSmith automation rules and Arize AX's Auto Add Spans to Dataset can also add matching production traces to datasets, and Braintrust lets you add logged traces to a dataset.
