AG-005Agent · Using toolslayaeval.ToolSelection

Tool Selection

Which tool is the best one for this step?

TASKFind a hotel in ParisSearchCalculatorEmailPicked the right tool
Simulation state:
When it passes

Picks search.

Threshold satisfied: evaluation score >= 0.70.

When it fails

Picks email.

Violation detected: execution flagged for human review or fallback routing.

SDK Specification

ParameterValueDescription
ClassToolSelectionPython evaluator class in layaeval
Required Fields"task", "available_tools", "selected_tool"Arguments expected in the call signature
Default Threshold>= 0.70Passes when quality score is at or above this value
CategoryAgent EvaluationUsing tools (Right tool, right inputs, results actually used.)

Python Example

pip install layaeval
tool-selection.py
1from layaeval import ToolSelection
2
3metric = ToolSelection(threshold=0.70) # passes at or above 0.70
4
5res = metric(
6 task="Book a hotel in Paris for 2 guests on Mar 4.",
7 available_tools=["search_hotels", "calculator", "send_email"],
8 selected_tool="search_hotels",
9)
10
11print(res.passed, res.value, res.confidence)

Related Agent Checks

Other checks in Using tools

View all 42 checks →