Check mocks against the live API
check-mocksDetects network mocks that drifted from the real API by GET-checking mocked endpoints and reporting removed fields, changed types, new nulls, and missing endpoints.
Instructions
Catch network mocks that drifted from the real API: finds route.fulfill JSON bodies (TS/JS and pytest specs) and routeFromHAR files, GETs each mocked endpoint on the live server (baseUrl) and reports fields the mock has that the API no longer sends, changed types, new nulls and endpoints that are gone. Only GET is sent; write mocks are listed, not replayed.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check-mocks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | No | Real URLs for wildcard or regex mocks: { '**/api/items/*': '/api/items/1' } | |
| filter | No | Only test files whose path contains this text | |
| baseUrl | No | Live server for relative mock URLs, e.g. 'http://localhost:3000' or a staging URL (default: use.baseURL from the Playwright config) | |
| headers | No | Headers for the live calls, e.g. { Authorization: "Bearer {{env:E2E_API_TOKEN}}" }; {{env:NAME}} reads E2E_*/TEST_*/PW_* variables so tokens stay out of chat | |
| timeoutMs | No | Limit per live call (default 10000) | |
| projectRoot | No | Project directory (default: server root) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the call failed (see error) or the tests it ran failed | |
| error | No | ||
| total | No | ||
| status | No | ||
| findings | No |