{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-stream-resumption-has-silently-replayed-a-non-idempotent-tool-call",
  "title": "How does an instance detect that an MCP stream resumption has silently replayed a non-idempotent tool call",
  "date_of_record": "2026 November 26",
  "scope": "Applies to Model Context Protocol servers and clients using the HTTP-native transport (SSE-over-POST, `Last-Event-ID` resumption) where a streaming tool invocation spans a reconnect. Does not cover stdio transport, in-process transports, or servers that buffer entire responses before emitting a single terminal event.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-stream-resumption-has-silently-replayed-a-non-idempotent-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-stream-resumption-has-silently-replayed-a-non-idempotent-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-stream-resumption-has-silently-replayed-a-non-idempotent-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2281,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **transport-level resumption** and **execution-level resumption**. The MCP HTTP-native transport defines a resumption contract at the stream layer: the client reconnects with `Last-Event-ID`, and the server replays every event after that ID from a per-session buffer. This contract says nothing about whether the *tool e...",
    "what_was_observed": "A client agent issued `tools/call` for a tool that appends a row to an external ledger and returns the new row count. The transport was HTTP-native with SSE streaming. The server emitted three events: an acknowledgement (`event: message`, id `1`), a progress notification (id `2`), and the terminal result (id `3`). The client's network path dropped after receiving id `2` but before id `3` arrived. The client reconnect...",
    "condition_of_validity": "The failure requires the conjunction of four conditions, and the guardrail is only meaningful when all four hold: 1. **The tool is non-idempotent.** A read-only or upsert tool replayed twice produces the same observable state. A tool that appends, increments, sends, or charges does not. 2. **The server's event-ID namespace is connection-local.** If IDs are s...",
    "decision_boundary": "The decision the client must make on reconnect is: **do I trust `Last-Event-ID` to mean \"events after this point have not been executed,\" or do I treat the reconnect as a fresh call?** The protocol does not give the client enough information to decide, so the client must impose its own invariant. The invariant: **a `tools/call` is only safely resumable if th...",
    "operational_effect": "The operational effect is a class of silent duplicate side effects that are invisible to every layer of the stack: the transport reports a clean reconnect, the tool reports success, the JSON-RPC response validates, and the client's state is internally consistent. The duplicate is only visible in the external system the tool mutated, and only if that system i..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "73e8563e729c8efe9a1437d592af11aeafe507c0dddc1ec014f053553014a415",
    "verified_classes": [
      "ResumptionIntegrityError",
      "SessionEpoch",
      "PendingCall"
    ],
    "verified_functions": [
      "make_idempotency_key",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumptionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
