Agent Wranglers

Contracts and docs Required

Test the API against its contract

Run tests that send requests and validate every response against the contract.

How to do it

Use a contract testing tool, such as Schemathesis or a validating proxy such as Prism, or validate responses in your own end-to-end tests. Run them in the build before every deploy. An endpoint that follows an outside protocol, such as MCP or JSON-RPC, uses that protocol's schema as its contract instead.

Example

schemathesis run openapi.yaml --url https://staging.example.com --checks all

How to check

Change a field's type in the code on a branch. The contract tests fail.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/contracts-and-docs/contract-tests.