Contract testing exists because interfaces break silently. A provider renames user_name to username, the spec is not updated, unit tests pass, and a consumer starts throwing parse errors in production; the totalshiftleft guide on API contract testing calls this the moment you notice "the interface broke silently because nothing was watching the boundary" the totalshiftleft guide on API contract testing. The same failure mode applies when the "provider" is a model vendor and the "consumer" is your agent: the vendor ships a tool definition with a renamed argument, or a new required property, and nothing in your test suite notices because your tests mock the model.
Most teams test the wrong side. They capture a model reply as a fixture, replay it, and call it an agent test. That catches prompt regressions but cannot catch schema drift, because a recorded reply is a frozen artifact that no longer tracks what the provider actually sends. Tool function mocking is useful for testing agent reasoning, but the langwatch testing guide is explicit that this level does not test the tool implementation or the external interface the langwatch testing guide on mocking. The schema is the external interface, so it needs its own contract.
The distinction that matters is between a schema test and a contract test. A schema test checks that one system is compatible with a schema at a point in time; a contract test checks that two systems can still communicate the Pactflow explainer on schema testing and contract testing. Your tool definition is the contract. It is the artifact the model reads, and the only thing you can hold it to.



