AG-007Agent · Using toolslayaeval.ToolCallAccuracy
Tool Call Accuracy
Was the tool called the right way?
Simulation state:
When it passes
Clean, correct call.
Threshold satisfied: evaluation score >= 3.0.
When it fails
A broken field.
Violation detected: execution flagged for human review or fallback routing.
SDK Specification
| Parameter | Value | Description |
|---|---|---|
| Class | ToolCallAccuracy | Python evaluator class in layaeval |
| Required Fields | "task", "tool_definition", "tool_call" | Arguments expected in the call signature |
| Default Threshold | >= 3.0 | Passes when quality score is at or above this value |
| Category | Agent Evaluation | Using tools (Right tool, right inputs, results actually used.) |
Python Example
tool-call-accuracy.py
1from layaeval import ToolCallAccuracy23metric = ToolCallAccuracy(threshold=3.0) # passes at or above 3.045res = metric(6 task="Book a hotel in Paris for 2 guests on Mar 4.",7 tool_definition="search_hotels(city: str, date: str, guests: int)",8 tool_call="search_hotels(city='Paris', date='2026-03-04', guests=2)",9)1011print(res.passed, res.value, res.confidence)
Related Agent Checks
Other checks in Using tools
AG-005Read →
Tool Selection
Which tool is the best one for this step?
AG-006Read →
Tool Selection Correctness
Was the tool the agent picked the right one?
AG-008Read →
Tool Input Accuracy
Are the values sent to the tool correct?
AG-009Read →
Tool Output Use
Did the agent use what the tool gave back?
AG-010Read →
Tool Necessity
Was calling a tool really needed here?