Skip to content

MCP update_event returns mis-routed page_analytics response shape on parallel calls #121

Description

@JohnTarbox

Symptom

In a batch of 8 parallel update_event MCP calls, 3 returned page_analytics-shaped JSON instead of the expected update_event response (events: Jeezum Crow, Foodaroo, Holiday Show in Capital City).

The updates DID apply — verified by re-running each call and observing previousValues already contained the new field values. But the response went to the wrong tool's serializer.

Why this is concerning

This is a silent-success-with-wrong-response pattern. In a less paranoid run (e.g., automation that doesn't double-check by re-reading), a caller would see a "success-shaped" response, log it, and move on — missing that the response correlates to the wrong tool. If the wrong-shaped response had ever been treated as a failure response, retries would re-apply mutations.

Suspect

JSON-RPC request/response correlation in the MCP transport, or shared mutable state between tool handlers running concurrently in the Worker. Possible causes:

  • A shared currentToolName / currentResponseSerializer module-level variable that gets clobbered when handlers run interleaved (Workers are single-threaded but await interleaves).
  • An ID collision where two tool calls reuse the same JSON-RPC id and one response overwrites the other in the client mapping.
  • A handler caching the last response shape per session and serving it cross-talk style.

Repro hint

Fire 8+ parallel MCP tool calls of mixed types (e.g., update_event + get_page_analytics in alternation). Watch for response shapes that don't match the id of the request.

mcp-server/src/tools/admin.ts:313 is update_event. mcp-server/src/tools/analytics.ts has get_page_analytics. Diff their handlers for any shared state.

Priority

Medium — silent and could mask real failures. Worth diagnosing before next round of bulk MCP work.

Notes

update_event writes did succeed (verified). Bug is purely in response routing/serialization, not in the mutation path.

Distinct from #120 (which is a venue-dedup race in suggest_event).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions