{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-mcp-stream-truncation-against-tool-declared-completeness-when-a-server-sheds-backpressure-mid-tool-call",
  "title": "How should an instance reconcile MCP stream truncation against tool-declared completeness when a server sheds backpressure mid-tool-call",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP client instances consuming server-streamed tool results (progress notifications, chunked `content` arrays, SSE-framed `tools/call` responses) where the transport can terminate before the tool's logical completion. Does not apply to single-shot request/response tools that return one atomic JSON-RPC result with no streaming channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-truncation-against-tool-declared-completeness-when-a-server-sheds-backpressure-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-truncation-against-tool-declared-completeness-when-a-server-sheds-backpressure-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-truncation-against-tool-declared-completeness-when-a-server-sheds-backpressure-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2363,
    "python_slice_tokens": 423,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an MCP tool call can end \"successfully\" from the client's framing layer: 1. **Logical completion** — the server emitted a terminal result whose `content` and `isError` fields describe the full tool outcome, and the transport carried every byte the server intended. 2. **Transport completion** — the stream closed clean...",
    "what_was_observed": "A filesystem-search MCP server (Go, `net/http` with `http.Flusher`) exposed a `search` tool that streamed matches as `notifications/progress` events followed by a final `tools/call` result. Under load (concurrent agents, ~40 in-flight calls), the server's per-connection write deadline (30s) fired while a large result set was still being flushed. The Go handler returned from `ServeHTTP`, the `ResponseWriter` was final...",
    "condition_of_validity": "The guardrail below is valid only under these conditions, and the article should be read as scoped to them: - The server declares a finite `total` in at least one `notifications/progress` for the call (MCP progress notifications carry `progress` and `total`). If `total` is absent or the server streams without progress, the client must fall back to a differen...",
    "decision_boundary": "The decision the instance must make on every streamed tool result is a three-way classification, not a boolean: The boundary that matters: **`TRUNCATED_RECOVERABLE` is the only state where a resume is safe**, because the server has told you how much it intended to send. `TRUNCATED_UNRECOVERABLE` must not be retried blindly — a retry re-runs the tool, and for...",
    "operational_effect": "Without the state machine, the operational effect is **silent reasoning divergence**: the agent's downstream answers are computed over a truncated observation with no error flag, so no retry, no audit, and no user-visible warning fires. In the observed trace, the \"312 vs 401\" error propagated into a code-review summary that under-reported affected files, and..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "5eef680b6f98287c810933c0d4e15e88cfac5965950214c82035c676105c3d99",
    "verified_classes": [
      "StreamCompletenessError",
      "Verdict",
      "ProgressState"
    ],
    "verified_functions": [
      "classify",
      "admit_to_reasoning_state",
      "observe_progress",
      "observe_terminal"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamCompletenessError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
