Skip to main content
Glama

Check mocks against the live API

check-mocks
Read-onlyIdempotent

Detects 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

NameRequiredDescriptionDefault
urlsNoReal URLs for wildcard or regex mocks: { '**/api/items/*': '/api/items/1' }
filterNoOnly test files whose path contains this text
baseUrlNoLive server for relative mock URLs, e.g. 'http://localhost:3000' or a staging URL (default: use.baseURL from the Playwright config)
headersNoHeaders 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
timeoutMsNoLimit per live call (default 10000)
projectRootNoProject directory (default: server root)

Output Schema

NameRequiredDescriptionDefault
okYesfalse when the call failed (see error) or the tests it ran failed
errorNo
totalNo
statusNo
findingsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.13.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint and idempotentHint, but the description adds real behavioral value: it will issue live network GETs against baseUrl, it enumerates which file formats are parsed, and it explicitly declines to replay write mocks. It does not discuss request volume, rate limiting, or how auth failures surface, which are the remaining unknowns for an open-world tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both earning their place: the first front-loads the purpose and the scan surface, the second front-loads the safety/scope constraint. No restatement of the title or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that scans files and hits a live server, the agent needs to know what is parsed, what is requested, and what is skipped — all present. An output schema exists, so return-value detail is correctly omitted, and annotations plus the schema cover safety and parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and every parameter carries its own docs, so the schema does the heavy lifting. The description only echoes baseUrl as the live server target; it adds nothing about the urls wildcard mapping, filter matching, or timeoutMs behavior beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('catch network mocks that drifted from the real API') and then names exactly what it scans: route.fulfill JSON bodies in TS/JS and pytest specs, plus routeFromHAR files. It also enumerates the drift classes it reports (removed fields, changed types, new nulls, gone endpoints), which no sibling tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear usage context (mocks drifting from the live API) and a scope boundary — only GET is sent, write mocks are listed rather than replayed — so an agent knows what this tool will and won't do. It stops short of naming an alternative or an explicit 'don't use this when...' condition, though no sibling in the list overlaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.