The Tool Call Audit: Four Distinct Questions That Catch Wrong Tool Use Before Users Do

Four separate checks—necessity, selection, arguments, and result use—stop a single tool-accuracy number from hiding the failures that reach production.

Mapki

Mapki

Nov 13, 2026•5 min read
Share:
Mapki
Custom Agents

Why a Single Tool Accuracy Number Hides Failures

Most teams that ship agents measure “tool accuracy” or “tool call success.” The number looks healthy. Users still receive confident answers built on the wrong tool, missing arguments, or unused results.

A tool call can fail in four independent places. Collapsing them into one metric tells you something moved. It does not tell you which lever to pull.

Production traces make the separation practical. OpenTelemetry GenAI conventions already give you execute_tool spans with gen_ai.tool.name, call IDs, and optional arguments and results. The audit sits on top of those spans instead of replacing them.

The Four Questions

Treat every tool decision as four binary or graded checks. Label them separately in evaluation datasets and in production sampling.

  • Necessity: Should the agent have called any tool on this turn?
  • Selection: Did it choose the correct tool (or an acceptable equivalent)?
  • Arguments: Were the parameters valid against the schema and grounded in the user request or prior context?
  • Result use: Did the subsequent reasoning or final answer actually incorporate the tool output?

1. Should it have called a tool at all?

Over-calling burns tokens and latency on facts already in context. Under-calling produces fluent hallucination when a lookup was required.

Capture the decision as a labeled turn: “none” or the expected tool. In production, sample traces where the agent answered without tools on queries that historically needed them, or called tools on pure conversational turns.

A simple rule works for the first version: if the user request contains a concrete entity (order ID, customer name, date range) and a tool exists that can resolve it, the expected action is a call.

2. Did it pick the right tool?

Wrong tool with perfect arguments still fails. Near-duplicate tool names, vague descriptions, and large catalogs are the usual causes.

Score precision and recall per tool, not a global percentage. Low precision on a tool means the agent reaches for it too often. Low recall means it misses cases where that tool was needed.

Keep the expected tool (or set of acceptable tools) in the test case. When multiple tools can succeed, record the set and score against membership.

3. Were the arguments valid and grounded?

Schema validation is deterministic and should be code. Required fields, types, enums, and ranges are mechanical. Grounding is harder: did the agent invent an ID, or did it extract one from the conversation?

Store the raw arguments on the execute_tool span (truncated and redacted). In evaluation, compare against a reference argument set or run a lightweight LLM judge only on the grounding question.

  • Common failure pattern: the agent calls get_order with a plausible but fabricated order ID that the user never supplied.

4. Did it use the result?

The tool succeeded, the span is green, and the final answer ignores the data or contradicts it. This is invisible to pure call-success metrics.

Check two signals:

  • The subsequent model turn references concrete values from the tool result.
  • The final answer is consistent with those values.

In traces, look for the next chat span after the tool span and score whether key fields appear.

How to Instrument the Audit

Add a lightweight post-processing step over existing traces. You do not need a new observability stack.

# Pseudocode for a per-turn audit on an execute_tool span
def audit_tool_span(span, expected=None):
name = span.attributes.get("gen_ai.tool.name")
args = span.attributes.get("gen_ai.tool.call.arguments")  # opt-in
result = span.attributes.get("gen_ai.tool.call.result")   # opt-in

checks = {
"necessity": expected is not None,          # or judge
"selection": name in (expected or []),
"arguments_schema": validate_schema(name, args),
"arguments_grounded": judge_grounded(args, conversation),
"result_used": key_values_in_next_turn(result)
}
return checks

Start with schema validation and selection against labels. Add the two judge checks only on sampled production runs and on the golden set.

Turning Failures into Tests

Every production incident that reaches a user becomes a labeled example:

1. Extract the user message and prior context.

  1. Record the expected tool (or “none”), reference arguments, and key result fields that must appear in the answer.

3. Add the case to the canary set that runs on every prompt or tool change.

  1. Keep the original failing trace ID so you can replay against the fixed version.

Aim for 20–50 real cases before you trust the suite. Synthetic cases are useful for edge coverage; real failures catch the distribution you actually ship.

What the Numbers Look Like in Practice

Teams that separate the four checks usually discover one dominant failure mode within the first two weeks of sampling:

  • Selection errors concentrate on two or three poorly described tools.
  • Argument errors cluster on a single required field that the schema does not enforce strictly enough.
  • Result-use errors appear after long context windows where the model loses the tool output.

Fix the highest-volume mode first. The aggregate “tool accuracy” number then moves for a reason you can explain.

References & Community Insights

The four questions do not replace trajectory evaluation or end-state checks. They make the most common agent failure—wrong or unused tools—visible and fixable before the number on the dashboard looks fine and the user does not.

Want to implement this in your business?

Mapki designs bespoke AI agents, custom workflow automations, and tool-agnostic integrations tailored specifically to your existing ERP, CRM, and databases.

Tags:AI AgentsTool CallingAgent EvaluationProduction AgentsLLM ObservabilityTool Selection