# How does an instance detect capability degradation when an MCP server silently negotiates down to a legacy tool schema mid-session? **Date of Record:** 2026 November 27 **Scope:** Applies to MCP client instances that hold a negotiated tool schema across multiple calls to the same server, where the server may re-advertise capabilities after a transport-layer reconnect or downgrade (e.g., SSE→stdio, HTTP/2→HTTP/1.1, or a load-balancer failover to an older server build). Does not apply to single-shot `tools/list` consumers that re-fetch schemas before every invocation, nor to stateless one-shot RPC clients with no held capability state. ## Core Distinction The failure is not "the server went away." It is that the server *came back with a narrower contract that is still syntactically valid*. MCP capability negotiation is a stateful handshake: the client calls `initialize`, receives a `capabilities` object plus a tool list, and caches the schema (argument types, required fields, enum members, `outputSchema` if present). When the underlying transport drops and re-establishes—say an SSE stream reconnects through a failover proxy that routes to a pre-upgrade replica—the server may complete a fresh `initialize` that advertises `protocolVersion: "2024-11-05"` instead of `"2025-03-26"`, and a `tools/list` that omits fields the newer schema required, or drops a tool entirely. A naive client treats a successful `initialize` as "capability preserved." The invariant that actually holds is weaker: *a successful re-initialize proves only that some server answered, not that it is the same capability surface.* The distinction that matters operationally is between **transport continuity** (the socket is alive) and **schema continuity** (the contract the agent's plan was compiled against still holds). These decouple precisely at the reconnect boundary, and the agent's cached reasoning—tool-call arguments it constructed against the old schema—becomes stale the instant they do. ## What Was Observed An agent mid-task had planned a three-step sequence against a `write_file` tool whose negotiated schema (protocol `2025-03-26`) declared `path`, `content`, and a required `expected_sha256` precondition field—a compare-and-swap guard the newer server enforced. The plan was compiled once, at task start, into a structured call graph. Step 2 issued `write_file` with `expected_sha256` populated. Between step 1 and step 2, the SSE transport dropped (idle timeout at an intermediary) and reconnected. The reconnect landed on a replica still running the older build, which negotiated `protocolVersion: "2024-11-05"`. Its `write_file` schema had no `expected_sha256` field. Because the older server used a permissive argument parser that *ignored unknown keys* rather than rejecting them, the call did not fail. It succeeded—writing the file with no precondition check. The agent observed a `200`-equivalent tool result, marked step 2 complete, and proceeded to step 3, which assumed the write had been precondition-guarded against concurrent modification. It had not been. A concurrent writer's update was silently clobbered. The corruption surfaced only at final verification, three tool calls later, with no error trace pointing back to the downgrade. The tell was buried in the reconnect transcript: the second `initialize` response carried `protocolVersion: "2024-11-05"` and a `tools/list` where `write_file.inputSchema.required` was `["path","content"]` rather than `["path","content","expected_sha256"]`. Nothing in the tool *result* indicated the downgrade. The evidence existed only in the negotiation frame the client had already consumed and discarded. ## Condition of Validity The guardrail—schema-continuity checking across reconnects—is valid and necessary under these conditions: 1. The client holds a negotiated schema across more than one tool invocation (i.e., it caches rather than re-fetches per call). 2. The agent's plan was compiled against that cached schema before the reconnect, so argument construction is schema-dependent. 3. The server's argument validation is *permissive* (ignores unknown fields) rather than *strict* (rejects them). Under strict validation, the stale call would have errored loudly and the failure would be self-announcing; the silent-degradation class only exists where the server tolerates schema drift. 4. The transport can re-establish against a different server instance or build (failover, autoscaling, rolling deploy). It does **not** apply when the client re-fetches `tools/list` and re-validates before every call (the cost is latency, but the class is eliminated), nor when the server pins a single immutable build per session ID and rejects reconnects to mismatched builds at the transport layer. ## Decision Boundary The decision the instance must make at every reconnect: **does the re-advertised capability surface equal the surface the in-flight plan was compiled against, field-for-field?** - If `protocolVersion` is unchanged AND the `tools/list` schema for every tool referenced by the in-flight plan is byte-identical (required-field sets, enum members, type constraints, and presence/absence of precondition fields), the plan may continue against cached state. - If any referenced tool's required-field set *shrank*, or a referenced tool vanished, or `protocolVersion` regressed, the cached plan is **invalid**: it was compiled against a contract no longer in force. The agent must not continue; it must re-plan against the new surface, or abort if the plan's correctness depended on a dropped field (as `expected_sha256` did). - The dangerous middle case—schema *widened* or a field *added*—is safe to continue only if the added field is optional. A newly-required field is a hard stop: cached calls will omit it and, under permissive parsing, silently proceed with a default. The boundary is not "did the reconnect succeed." It is "did the required-field set of every plan-referenced tool remain a subset of what the plan supplies." Downgrade shrinks the server's expectations, which is exactly why it fails silently: the client keeps sending fields the server no longer checks, and the check the plan depended on evaporates. ## Operational Effect Without a continuity check, transport downgrade produces **silent invariant loss**: preconditions the plan relied on stop being enforced, calls succeed, and the agent's success signal is a lie. The corruption is detected—if at all—downstream, decoupled from its cause, which makes it the worst class of agent failure to debug because the trace looks clean. The required architectural guardrail is a **schema-continuity gate** at the reconnect seam: on every re-`initialize`, diff the new `tools/list` against the cached schema for all tools in the active plan, and fail closed on any required-field regression or tool disappearance. The gate must treat "server accepted the call" as insufficient evidence of contract preservation. Two supporting invariants make it robust: (a) the client should send a schema fingerprint (hash of the normalized `tools/list`) in each call's metadata so the server can reject calls compiled against a different surface, and (b) the agent's plan object should record the schema fingerprint it was compiled against, so continuation is a comparison, not a guess. Graceful degradation is only graceful when the *degradation is announced*; a downgrade that succeeds silently is not degradation, it is corruption with a success code. ```python import hashlib import json from dataclasses import dataclass, field class SchemaContinuityError(RuntimeError): """Raised when a re-negotiated MCP capability surface no longer supports the schema an in-flight plan was compiled against.""" @dataclass class ToolSchema: name: str required: frozenset protocol_version: str def fingerprint(tools: dict) -> str: norm = { name: { "required": sorted(s.required), "protocol": s.protocol_version, } for name, s in sorted(tools.items()) } return hashlib.sha256(json.dumps(norm, sort_keys=True).encode()).hexdigest() @dataclass class Plan: referenced_tools: dict # name -> ToolSchema at compile time compiled_fingerprint: str = field(default="") def compile_plan(tools: dict, referenced: list) -> Plan: ref = {n: tools[n] for n in referenced} return Plan(referenced_tools=ref, compiled_fingerprint=fingerprint(ref)) def verify_continuity(plan: Plan, renegotiated: dict) -> None: """Called at every reconnect seam, before resuming the plan.""" for name, old in plan.referenced_tools.items(): new = renegotiated.get(name) if new is None: raise SchemaContinuityError( f"tool '{name}' vanished on reconnect; plan invalid" ) missing = old.required - new.required if missing: # The precondition the plan depended on is no longer enforced. raise SchemaContinuityError( f"tool '{name}' downgraded {old.protocol_version}->" f"{new.protocol_version}; required fields dropped: " f"{sorted(missing)}. Cached calls would silently skip these checks." ) added_required = new.required - old.required if added_required: raise SchemaContinuityError( f"tool '{name}' now requires {sorted(added_required)} " f"not present in cached plan; re-plan required." ) if fingerprint(renegotiated) != plan.compiled_fingerprint: # Surface drifted on unreferenced fields; safe but log it. pass ```