Tool Evaluation and Testing
The accuracy-latency-cost and observability topics that also appear under this domain on the exam page are the same as D3.3 and D3.4.
The evaluation cycle (verified, from Anthropic's testing guide)
Define success criteria, develop test cases (include edge cases), engineer a preliminary prompt, test against the cases, refine, test against held-out evals, then ship.
Good success criteria are specific, measurable, achievable and relevant. Example metrics: task-specific (F1, BLEU), generic (accuracy, precision, recall), operational (response time, uptime), plus A/B tests against a baseline, user feedback and edge-case analysis. Even "hazy" areas such as safety can be quantified (for example fewer than 0.1% of 10,000 outputs flagged by a content filter).
Grading methods
| Method | Notes |
|---|---|
| Exact match / string match | Fast and objective; no nuance |
| Human grading | Most flexible and highest quality, but slow and expensive; avoid where possible |
| LLM-based grading | Fast, flexible, scalable, suits complex judgement; test its reliability first, then scale; use detailed, clear rubrics |
Evaluating tools specifically (design guidance)
Tools are interfaces the model chooses to call, so test the model-plus-tool system, not only the function:
| Dimension | Test |
|---|---|
| Selection accuracy | For a set of prompts, does Claude pick the right tool (and no tool when none applies)? Include near-duplicate and ambiguous cases |
| Argument validity | Are inputs schema-valid and semantically right? (Strict tool use guarantees schema validity, not meaning.) |
| Outcome | Did the task succeed end to end, including multi-step chains? |
| Error handling | Does the agent recover from structured errors, retry transients, escalate permissions? (2.2) |
| Efficiency | Tool calls and tokens per task; definition token cost |
| Robustness | Injection-bearing outputs, empty results, timeouts, oversized outputs |
| Description quality | A/B test rewritten descriptions; Anthropic names descriptions the most important factor in tool performance (verified) |
Building the suite (design guidance)
- Start from real traffic and real failures; every production incident becomes a regression case.
- Cover happy path, edge cases, adversarial inputs and "should refuse or escalate" cases.
- Keep a held-out set you never tune against.
- Version the suite with the prompts and tools; run it in CI as a gate on any change to prompts, tool descriptions, models or schemas.
- Track trend and variance; models are non-deterministic, so run multiple trials and report ranges.
Exam traps
- Tuning on the same cases you report.
- Only happy-path cases.
- Using an LLM grader without validating it against human judgement.
- Testing the function but not the model's tool choice.
- One-off manual testing with no regression gate.
References
- Define success criteria and build evaluations — checked Oct 16, 2026
- Define tools — checked Oct 16, 2026
Check your understanding
Why keep a held-out evaluation set?Show answerHide answer
Answer
To avoid overfitting prompts to the cases you tune on.What must you do before relying on LLM-based grading at scale?Show answerHide answer
Answer
Test its reliability, using clear rubrics.What does strict tool use not guarantee?Show answerHide answer
Answer
That the arguments are semantically correct.