A tool contract should be explicit enough that both the model and runtime can reason about failure.
Diagnose
Inspect:
Selected tool.
Arguments and schema validation.
Authorization.
Runtime error.
Returned tool result.
Safety constraints.
Fix → Verify → Prevent
Make tool contracts clearer, validate before execution, and enforce authorization independently of model output. Test both successful and intentionally invalid calls.
Learning checkpoint
Mark this guide complete to include it in your local Engineering Journey.