# What happens when an instance negotiates a tool schema that mutates mid-session: the silent capability-drift boundary in MCP **Date of Record:** 2026 November 20 **Scope:** Applies to MCP clients holding a live `tools/list` snapshot across a long-running session where the server's tool registry, input schema, or capability flags change after the initial handshake. Does not apply to stateless one-shot request/response calls that re-list tools on every turn, nor to servers whose tool surface is provably immutable for the process lifetime. ## Core Distinction There are two categorically different things an MCP client can mean by "the tool schema": 1. **The negotiated schema** — the `tools/list` payload captured during initialization (or the first successful listing), which the client caches and uses to build its tool-call arguments, validate its own generated JSON, and decide which tools exist. 2. **The served schema** — what the server will actually accept *at the moment a `tools/call` arrives*, which may have diverged because the server hot-reloaded a tool, added a required parameter, renamed an enum member, tightened a `pattern`, or removed a tool entirely. The failure mode is not that the two differ. It is that MCP's `tools/list_changed` notification is **advisory and droppable**: a client that misses it, ignores it, or races it will keep emitting calls shaped against the stale negotiated schema. The server then rejects them with a validation error that is *indistinguishable at the client's reasoning layer from a legitimate tool failure* — so the agent retries the same malformed call, or "fixes" it by hallucinating a parameter that never existed. The invariant that must hold is: **a tool call is only well-formed relative to a schema version the client can prove is still live.** Nothing in the base protocol forces that proof. ## What Was Observed A deployment with a filesystem-plus-search MCP server and a planning agent running multi-step tasks (median 40 tool calls per task). The server was configured to reload tool definitions from disk on a file-watch event — a normal operational practice for iterating on tool descriptions and adding optional parameters. At 14:02 the server reloaded and changed `search_files`: - Before: `{ "query": string, "root": string }`, both required. - After: `{ "query": string, "root": string, "glob": string, "max_results": integer (1..500) }`, with `max_results` now **required** and `glob` newly required. The server emitted `notifications/tools/list_changed`. The client's transport had a bounded notification queue (depth 16) that was saturated by a burst of `notifications/message` log frames from a concurrent long-running index build. The `list_changed` frame was dropped at the queue boundary. No error surfaced anywhere — dropping is silent by design. The trace that followed, on a single in-flight task: 1. Agent emits `search_files({"query": "config", "root": "/repo"})` — well-formed against the cached v1 schema. 2. Server validates against v2, rejects: `-32602 Invalid params: missing required property 'glob'` and `'max_results'`. 3. The client surfaces this to the model as a generic tool error string. The model has no schema-version concept; it reads "missing required property" as *"I forgot to pass something."* 4. Model retries with a **fabricated** `glob: "*"` but still no `max_results` (it was never in its cached schema, so it has no token to invent). Rejected again. 5. Model, now in an error-compounding loop, tries `max_results: 100` guessed from the error text but drops `glob`. Rejected. 6. After three failures the planner marks `search_files` "broken" in its working memory and reroutes to a fallback shell tool — a semantic degradation that persists for the rest of the session because nothing re-lists tools on failure. Net: a single dropped 40-byte notification produced a 6-call error spiral and a permanent, silent downgrade of the agent's toolset. The agent's own episodic memory recorded "search_files is unreliable," which is a *false* semantic memory distilled from a transport artifact. The non-obvious part: **the error message was technically correct and operationally poisonous.** `-32602` is a *protocol-level* signal about argument shape, but it was delivered on the same channel and in the same envelope as *tool-level* failures ("file not found," "permission denied"). The model cannot distinguish "your call was malformed against a schema you don't have" from "the operation failed." These demand opposite recovery strategies — re-negotiate vs. retry-differently — and the protocol collapses them. ## Condition of Validity The drift boundary is only inert (safe) when **all** of the following hold. If any is violated, the client is operating on unverified schema state: - The client re-lists `tools/list` and diffs against its cache **before the first call of any new task**, not merely at session init. Task-scoped re-validation, not connection-scoped. - The transport's notification channel is **lossless and ordered** with respect to `tools/list_changed`, or the client treats a *gap* in notification sequence numbers as a forced re-list. A bounded drop-oldest queue violates this by construction. - The server treats schema mutation as a **versioned event**: it bumps a schema version (in tool `_meta` or a server-level field) and rejects calls carrying a stale version with a *distinct* error code, not `-32602`. - The client maps that distinct code to a **re-negotiate** action, never to a model-visible retry. The invariant, stated precisely: *for every `tools/call`, the client must be able to name the schema version it validated against, and the server must be able to confirm that version is current, before the call is dispatched.* If either side cannot, the call is unsound regardless of how well-formed the JSON looks. ## Decision Boundary The decision the engineer must make is **where schema-version authority lives**, and the boundary is sharp: - **Client-authoritative caching** (list once, trust forever) is only valid for immutable tool surfaces. The moment a server can hot-reload, this is unsound and the failure is silent. - **Server-authoritative versioning** (every response echoes the schema version; stale-version calls get a dedicated `SCHEMA_STALE` code) is the correct default for any mutable registry. It costs one integer per tool in `_meta` and one branch in the dispatcher. - **Re-list-on-every-call** is correct but pays a full `tools/list` round-trip per call; acceptable for low-frequency, high-stakes tools, pathological for tight loops. The boundary condition that decides between them: **does the server's tool registry mutate during a session's lifetime?** If yes → server-authoritative versioning is mandatory, because client-side caching cannot detect a mutation it wasn't told about, and the notification that would have told it is exactly the thing that gets dropped under load. If no → client caching is fine and versioning is overhead. A second, subtler boundary: **error-code partitioning.** A `-32602` that can mean either "malformed against your schema" or "malformed against *my* schema" is a decision boundary violation at the protocol layer. The dispatcher must partition: shape errors against the client's declared version → `SCHEMA_STALE` (re-negotiate); shape errors against the current version → `-32602` (model's fault, retry). Conflating them is what turned a transport drop into a false semantic memory. ## Operational Effect Downstream of getting this wrong, three things degrade in ways that are hard to attribute: 1. **False semantic memory.** The agent distills "tool X is broken" from what was actually a stale-schema rejection. This memory outlives the session and poisons future task planning. The remediation is not in the memory layer — it's in never letting a schema error reach the model as a tool failure. 2. **Silent capability narrowing.** Tools quietly fall out of the usable set as the model reroutes around "broken" tools. The agent appears to work; it is working with a strictly smaller toolbox than negotiated, and nothing reports the delta. 3. **Error-compounding retries.** Each retry against a stale schema burns a turn and a token budget, and the model's invented parameters (`glob: "*"`, guessed `max_results`) can *succeed* under a later schema revision with unintended semantics — a fabricated argument that happens to validate is worse than one that fails, because it corrupts the operation silently. The guardrail that bounds all three: **schema version is a first-class field on every call and every error, and a stale-version rejection is a control-flow event, not a content event.** It must never be rendered into the model's context as prose. The client intercepts `SCHEMA_STALE`, re-lists, diffs, updates its cache, and *re-issues the original call* — or, if the diff is incompatible with the in-flight plan, raises a hard stop rather than letting the model improvise against a schema it cannot see. ```python import hashlib import json from dataclasses import dataclass, field class StaleSchemaError(RuntimeError): """Raised when a tool call is validated against a schema version the server no longer serves. Must be handled as control flow (re-negotiate), never surfaced to the model as a tool failure.""" pass class SchemaDriftUnrecoverable(RuntimeError): """Raised when re-negotiation cannot produce a schema compatible with the in-flight plan, forcing a hard stop instead of model improvisation.""" pass @dataclass class NegotiatedSchema: version: str tools: dict = field(default_factory=dict) @classmethod def from_listing(cls, listing: dict) -> "NegotiatedSchema": blob = json.dumps(listing, sort_keys=True).encode() version = hashlib.sha256(blob).hexdigest()[:16] return cls(version=version, tools={t["name"]: t for t in listing["tools"]}) class VersionedMCPClient: def __init__(self, transport): self.transport = transport self.schema = NegotiatedSchema.from_listing(transport.list_tools()) def _relist(self) -> NegotiatedSchema: return NegotiatedSchema.from_listing(self.transport.list_tools()) def call_tool(self, name: str, args: dict, task_plan_tools: set[str]): # Invariant: every dispatch names the schema version it validated against. if name not in self.schema.tools: raise SchemaDriftUnrecoverable( f"tool {name!r} absent from negotiated schema {self.schema.version}" ) try: return self.transport.call( name, args, schema_version=self.schema.version ) except StaleSchemaError: # Control-flow recovery: re-list, diff, then decide. fresh = self._relist() dropped = task_plan_tools - set(fresh.tools) if dropped: # Plan depends on tools the new schema removed: hard stop. raise SchemaDriftUnrecoverable( f"re-negotiation removed tools required by plan: {dropped}" ) self.schema = fresh # Re-issue the ORIGINAL call against the verified-live schema. return self.transport.call( name, args, schema_version=self.schema.version ) ```