Overview
Tool output contracts validate the structure of what a tool returns. When a tool’s return shape changes — an upstream API renames a field, drops a key, or changes a type —assert_tool_output_matches catches it before the downstream agent sees wrong data.
assert_tool_output_matches
What it checks
- Finds all tool results for the named tool across all turns
- Validates every result against the schema
- Reports the first mismatch with the exact field path