DEV Community

Cover image for Our schema diff saw 2 changes. Replaying the agent's real calls found 5 that came back different.
Edy Cu
Edy Cu

Posted on Edited on

Our schema diff saw 2 changes. Replaying the agent's real calls found 5 that came back different.

I wrote this as part of the Kiroween 2026 hackathon (Frankenstein category).

One field renamed in an MCP server. The server's tests were updated with it, so they stay green. A caller that still reads total finds it gone.

That is the failure I wanted to catch before shipping, and I wanted to catch it using what an agent actually called, not what the server says it can do. This is a write-up of what worked, what the obvious check missed, and one result that found nothing.

The obvious check sees too little

The demo server (hollow-inn, ours) has three versions. v2 carries three breaks I planted on purpose:
quote renames total to total_cents, search_rooms changes a default limit, and cancel_booking becomes booking_cancel.

An input-schema diff of tools/list (tools removed, added, inputSchema changed) reports 2 changes: the removed cancel_booking and the added booking_cancel. The quote rename and the search_rooms default are invisible to it, because neither touches an input schema.

Replaying ten recorded calls against v2:

HOLD · 4 rattled, 1 cracked · 10 jars compared · 4 of 6 tools · not recorded: booking_cancel, get_room
SPC-0002 · quote · rattled · /total, /total_cents · suspected rename from /total ×100
SPC-0010 · search_rooms · rattled · /rooms, /rooms/r-08, /rooms/r-09 · -
SPC-0009 · cancel_booking · cracked · - · tool not in tools/list
Enter fullscreen mode Exit fullscreen mode

(evidence/replay/racks-vs-v2.txt, trimmed)

Five of ten recorded calls came back different, four of them in tools whose inputs never changed. That is the whole argument for replaying calls instead of diffing schemas.

Capture from inside the agent

The calls come from real Kiro CLI sessions. A pair of Kiro hooks, PreToolUse and PostToolUse, each with a per-server @hollowinn matcher, see the tool input and response from inside the agent, so there is no proxy and no change to the server. The PostToolUse half:

{
  "name": "specimen-jar-post",
  "trigger": "PostToolUse",
  "matcher": "@hollowinn",
  "action": { "type": "command", "command": "npx --no-install specimen hook post --server hollowinn" }
}
Enter fullscreen mode Exit fullscreen mode

The PreToolUse half (specimen-jar-pre.json) runs the same command with hook pre. The CLI is not published to npm: run npx specimen from a clone of the repo after npm ci.

Each call is sealed as a jar: request and response text byte for byte, redacted on write, checksummed. The hook costs p50 465 / 474 ms (pre / post) per call (CLI wall-clock) over 30 fresh npx processes per hook on my laptop (evidence/bench/hook.md), excluding Kiro's own hook launch.

Closing the loop

A red jar goes to a Kiro custom agent that may only write under .kiro/specs/; it files a bugfix spec with the captured call as the repro, and a deterministic check-spec accepts or rejects it. Kiro's Bug Fix workflow then designs the fix and executes its implementation tasks (for two specs I ran the final acceptance steps myself). After three specs, v2.1 replays SHIP, 10 of 10. Three of those jars carry one new compatible field; --strict calls that HOLD.

The null result

Run against a server I did not write (@modelcontextprotocol/server-memory 1.0.0 to 2.2.1), the replay found no break: HOLD, 3 preserved, 2 unsealed. The two unsealed ones exist because that server also returns structuredContent that a text-only jar cannot compare. That is a limit of my jar format, not a clean bill for the server.

What I would not claim

Not the first MCP record/replay tool (mcp-recorder, AgentVCR and mcpsnoop exist). Ten jars, five of six tools; SHIP means "clean on the recorded set". The breaks are mine. No outside user has run it yet.

Live cabinet (replays in your browser): https://specimen.edycu.dev/ · Code (MIT): https://github.com/edycutjong/specimen · Built for Kiroween 2026 (Frankenstein).

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

This is a sharp diagnosis, Edy. The input-schema diff reporting only 2 changes while the replay found 5 different responses is the kind of gap that is easy to miss — especially the total to total_cents rename, where the server's own tests stay green because they were updated with the rename, and only a real caller still reading total feels the break. That 4 of the 5 differences came from tools whose inputs never changed makes the case for replaying real calls, not just diffing schemas.

I also liked the honesty about the null result on server-memory: two unsealed jars because structuredContent cannot be compared as text, and calling that a limit of the jar format rather than a clean bill of health. If you extend the format, would you add an output-schema comparison next, or a structuredContent-aware comparison for those unsealed jars?