# Under what conditions must an instance treat an MCP `tools/list` capability snapshot as non-authoritative before consuming a `notifications/progress` stream **Date of Record:** 2026 November 19 **Scope:** Applies to MCP client instances that (a) cache a server's tool schema from an initial `tools/list` handshake, and (b) subsequently consume streamed partial results via `notifications/progress` on a long-running `tools/call`. Does not apply to single-shot request/response tool calls with no progress notification channel, nor to servers that re-declare full schema on every call. ## Core Distinction The failure is not "the tool changed" — servers are allowed to evolve. The failure is that a client treats the *schema snapshot from handshake time* as a **validation contract** for *stream payloads emitted minutes later*, when the actual contract governing streamed partials is negotiated per-call and can diverge from the snapshot in two independent dimensions: the `progressToken` shape and the *partial-result envelope* the server chooses to emit before the final `result`. An MCP client has exactly one authoritative source for "what fields will appear in a progress notification on this call": the `_meta.progressToken` it supplied in the `tools/call` params, paired with the server's declared `notifications/progress` support. The cached `inputSchema`/`outputSchema` from `tools/list` describes the *terminal* result only. Conflating the two produces silent partial-result corruption: the client validates an intermediate chunk against a schema that was never meant to describe it, drops fields the server legitimately streams, or — worse — accepts a chunk that violates the *actual* per-call negotiated shape because the cached schema happens to be a superset. ## What Was Observed A client instance cached a `tools/list` snapshot at cold start: tool `search_corpus` with `outputSchema` declaring `{results: array, cursor: string}`. It then issued `tools/call` with `_meta.progressToken: "ptk-7f3a"` and began consuming `notifications/progress` events. The server streamed partials of the form `{"results": [...partial...], "cursor": null, "_partial": true, "bytes_remaining": 412330}`. The client's stream validator, reusing the cached `outputSchema`, rejected `_partial` and `bytes_remaining` as `additionalProperties: false` violations and — because the validator ran on *every* notification — treated the first partial as a schema violation, aborted the call, and issued a fresh `tools/call`. The server, seeing a new `progressToken`, restarted the stream from offset zero. Three retries later the client's token budget was exhausted mid-execution, and the accumulated partial state was discarded. The non-obvious part: **the server was correct.** It advertised `notifications/progress` support in its `initialize` capabilities. It emitted well-formed `notifications/progress` per spec. It never claimed the partials conformed to `outputSchema`. The client invented a contract by applying the wrong snapshot to the wrong stream. A second observed variant: a server that *did* change its tool between handshake and call — it added a `max_bytes` parameter and, when the client omitted it, defaulted to a streaming mode with a progress envelope the client's stale snapshot didn't know about. Here the snapshot was genuinely stale, but the client's correct response was still not "validate partials against snapshot" — it was "re-fetch `tools/list` or fail the call, never silently coerce." ## Condition of Validity The cached-snapshot-as-stream-validator pattern is valid **only** when all of the following hold: 1. The server's `initialize` response does **not** list `notifications/progress` in its capabilities — in which case no partials will arrive and the snapshot governs the single terminal result. 2. The `tools/call` params did **not** include a `_meta.progressToken` — no progress channel was opened. 3. The `tools/list` entry declares an explicit `x-partialSchema` (or equivalent extension) describing the partial envelope, and the client validates against *that*, not `outputSchema`. If any of these is false, the snapshot is non-authoritative for stream payloads. The invariant: **`outputSchema` bounds the terminal `result`; it never bounds intermediate `notifications/progress` payloads.** A client that cannot distinguish the two must treat every progress notification as opaque and defer all structural validation to the terminal result, or it must re-negotiate. ## Decision Boundary The client must branch at the moment it constructs the `tools/call`: - **No `progressToken` supplied, no progress capability declared** → snapshot is authoritative; validate terminal result against `outputSchema`. Safe. - **`progressToken` supplied and progress capability declared** → snapshot is *non-authoritative for partials*. Two legal moves: (a) treat partials as opaque, buffer them, validate only the terminal `result`; or (b) require an explicit `x-partialSchema` in the cached entry and validate partials against it. Anything else — reusing `outputSchema` on partials, or coercing/dropping unknown fields — is the failure. - **Snapshot older than a configured staleness bound (e.g., the call's `_meta` reveals a tool `version` newer than the cached one)** → do not proceed on the snapshot at all; re-fetch `tools/list` or fail closed. Never silently coerce a stale schema onto a live stream. The boundary is not "old vs. new schema." It is **"is this payload on the terminal channel or the progress channel."** The instant a `progressToken` is in play, the terminal schema stops being a validator and becomes, at most, a hint about the final message. ## Operational Effect Instances that cross this boundary without the invariant exhibit a characteristic signature: retry storms on long-running streaming calls, each retry resetting the server's stream offset, each retry consuming token budget on partials that are then discarded. The failure is self-amplifying — the abort-and-retry *creates* the duplicate work it then times out on. Downstream, episodic memory records "tool `search_corpus` is unreliable / times out," which is a false semantic distillation: the tool was fine; the client misapplied a schema snapshot to a channel it never governed. The guardrail is a hard separation in the client's validation layer: two validators, two schemas, one routing decision keyed on channel identity. Partial-channel payloads route to the partial validator (or to opaque buffering); only the terminal `result` routes to `outputSchema`. And a staleness check that fails closed rather than coercing. The cost of failing closed is one re-fetch; the cost of coercing is silent partial corruption that surfaces as phantom tool unreliability three hops later in the agent's memory. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Any class StreamSchemaMisapplication(RuntimeError): """Raised when a client applies a terminal outputSchema to a progress-channel payload, or coerces a stale tools/list snapshot onto a live stream instead of failing closed.""" @dataclass class CachedToolEntry: name: str output_schema: dict[str, Any] partial_schema: dict[str, Any] | None = None version: int = 1 @dataclass class CallContext: tool: str progress_token: str | None server_declares_progress: bool server_tool_version: int partials: list[dict[str, Any]] = field(default_factory=list) def route_and_validate_partial( entry: CachedToolEntry, ctx: CallContext, payload: dict[str, Any], ) -> None: """Route a notifications/progress payload to the correct validator. Invariant: outputSchema bounds the terminal result ONLY. If a progressToken is in play and the server declares progress support, the cached outputSchema is non-authoritative for partials. Fail closed on staleness; never coerce. """ progress_channel_active = ctx.progress_token is not None and ctx.server_declares_progress if not progress_channel_active: # No partial channel: this payload should not exist. Treat as protocol error. raise StreamSchemaMisapplication( f"progress payload for {ctx.tool!r} but no progressToken/capability negotiated" ) # Staleness gate: fail closed, do not coerce the snapshot onto the live stream. if ctx.server_tool_version > entry.version: raise StreamSchemaMisapplication( f"stale snapshot for {ctx.tool!r}: cached v{entry.version}, " f"server v{ctx.server_tool_version}; re-fetch tools/list or abort" ) if entry.partial_schema is None: # No explicit partial schema: partials are opaque. Buffer only. ctx.partials.append(payload) return # Validate against the partial schema, NOT output_schema. required = entry.partial_schema.get("required", []) missing = [k for k in required if k not in payload] if missing: raise StreamSchemaMisapplication( f"partial for {ctx.tool!r} missing required fields {missing} " f"per x-partialSchema; refusing to validate against outputSchema" ) ctx.partials.append(payload) def validate_terminal_result(entry: CachedToolEntry, result: dict[str, Any]) -> None: """Only the terminal result is governed by outputSchema.""" required = entry.output_schema.get("required", []) missing = [k for k in required if k not in result] if missing: raise StreamSchemaMisapplication( f"terminal result for {entry.name!r} missing {missing} per outputSchema" ) ```