Eval gap between “did the agent call the right tool?” and “did the agent correctly use the tool output?”
When evaluating tool-using agents, I’m running into a gap between two different questions:
Did the agent call the right tool?
Given that the tool returned a valid response, did the agent correctly use that tool output?
Current tool-related evals do a good job of catching the first class of error (wrong or missing tool calls), but they often miss silent failures in the second class: the agent chooses the appropriate tool, the tool executes successfully and returns valid data, and then the agent misinterprets or misuses that data in its subsequent reasoning or final answer.
Some concrete examples of this second category:
The agent ignores a critical field in the tool response.
The agent flips a boolean or misreads a status.
The agent draws a conclusion that is not supported by the tool output, even though the tool call itself was “correct.”
From an evaluation standpoint, these show up as “green” on tool selection and the raw tool logs look fine, but the overall behavior is still wrong. I usually only catch them by manually inspecting trajectories.
I’d love a two-stage eval pattern or metric type that explicitly separates:
Tool-choice correctness: did the agent select an appropriate tool (or set of tools) for this task?
Tool-output usage correctness (conditional on a valid tool response): given that the tool executed successfully and returned a valid response, did the agent’s next step or final answer correctly reflect that tool output and the ground-truth label?
Concretely, this could look like:
Stage 1: score tool selection.
Stage 2: only run on traces where the tool call succeeded (no API error, structurally valid response), and have a judge (LLM or objective check) compare:
the tool response,
the agent’s subsequent message or final answer,
the expected outcome for the task, and score whether the agent correctly incorporated the tool output.
Aggregated metrics or breakdowns that separate:
“Tool selection errors”
“Tool execution / API errors”
“Tool interpretation errors” (right tool, valid response, wrong usage)
would make it much easier to debug and prioritize work on tool-using agents
Two weeks in, and we’re still consistently seeing this gap across production traces. I’ve been exploring it with a ContextualPrecision metric, which is surfacing a recurring pattern: tool selection tends to perform well, while context interpretation is where things break down.
From a recent sample (50+ multi-step agent traces):
87% tool selection accuracy
64% correct interpretation of tool outputs
These silent failures seem to accumulate in ways that meaningfully impact outcomes.
The two-stage evaluation pattern you outlined feels like a strong fit for addressing this. I’d be glad to share anything helpful, including:
Raw traces that highlight the divergence
ContextualPrecision scoring breakdowns
Aggregated metrics comparing selection vs. interpretation errors
If this is something you’re considering for the roadmap, I’d be happy to collaborate and contribute data to help move it forward within HUD.
Since there's been no reply, sharing a concrete implementation sketch to make this easier to scope as a PR. The idea is a ToolInterpretationEvaluator that wraps any existing HUD task evaluation with a second-stage score:
from dataclasses import dataclass
from typing import Any
@dataclass
class ToolEvalResult:
task_id: str
tool_selection_score: float # Stage 1: correct tool called?
tool_interpretation_score: float # Stage 2: correct reasoning from output?
combined_score: float
failure_class: str # 'selection_error' | 'interpretation_error' | 'none'
def classify_tool_failure(
expected_tool: str,
actual_tool: str,
tool_output: dict[str, Any],
agent_final_answer: str,
ground_truth: str,
llm_judge, # callable: (prompt) -> float
) -> ToolEvalResult:
selection_score = 1.0 if actual_tool == expected_tool else 0.0
if selection_score == 0.0:
return ToolEvalResult(
task_id="",
tool_selection_score=0.0,
tool_interpretation_score=0.0,
combined_score=0.0,
failure_class="selection_error",
)
# Stage 2: did the agent correctly reason from the tool output?
prompt = (
f"Tool output: {tool_output}\n"
f"Agent answer: {agent_final_answer}\n"
f"Ground truth: {ground_truth}\n"
f"Score 0-1: how well did the agent use the tool output to reach the correct answer?"
)
interpretation_score = llm_judge(prompt)
failure_class = "none" if interpretation_score >= 0.7 else "interpretation_error"
combined = (selection_score * 0.4) + (interpretation_score * 0.6)
return ToolEvalResult(
task_id="",
tool_selection_score=selection_score,
tool_interpretation_score=interpretation_score,
combined_score=combined,
failure_class=failure_class,
)
This gives you the two-stage classification: selection_error vs interpretation_error, which maps cleanly to the aggregate metrics (87% selection accuracy vs 64% interpretation accuracy from my earlier data).
If the HUD team would find this useful as a built-in evaluator type, I'm happy to:
- Open a PR adding
ToolInterpretationEvaluatoras an eval class. - Include a worked example (web scraping agent task with tool output interpretation).
- Add docs showing how to read the two-stage breakdown in traces.
What's the best path forward? Should I open a draft PR, or would you prefer a design doc first?
Thanks for taking a look, @lorenss-m. Understood on the not-planned call — makes sense if this isn't the direction for HUD's eval surface right now.
For context: I ended up building the ToolInterpretationEvaluator as a standalone layer on top of HUD traces and it's been useful in my own agent testing workflow. Happy to share the implementation externally if it's ever useful as a reference or community contribution down the line.
Thanks again for the engagement on the earlier thread.