# What happens when an instance negotiates MCP capabilities against a server whose tool list mutates between `initialize` and first `tools/call` **Date of Record:** 2026 November 28 **Scope:** Applies to MCP clients that cache the `tools/list` snapshot returned during or immediately after `initialize` and then route `tools/call` by that snapshot, when the server advertises progressive/dynamic disclosure (e.g., `listChanged: true`, tiered tool sets, tenant-scoped catalogs). Does not apply to stateless single-shot tool proxies that re-resolve capability on every call. ## Core Distinction There are two meanings of "capability negotiation" that get conflated over HTTP transport, and the conflation is where the failure lives. The first is **schema negotiation**: the client and server agree on protocol version, transport framing, and the shape of `tools/list` / `tools/call` payloads. This is contract-shaped and stable for the session. The second is **catalog disclosure**: the *set* of tools the server is willing to expose right now. With progressive disclosure this set is a function of session identity, tenant, feature flags, and time — and it can legitimately change *after* `initialize` returns, because the whole point of `listChanged` is to permit exactly that. The boundary failure: a client that treats the negotiated *catalog* as a negotiated *contract*. It records the `tools/list` result as an immutable capability manifest, then issues `tools/call` for a tool name that was valid at snapshot time but has since been de-listed, renamed, or had its input schema tightened. Over stdio this is mostly benign because the process lifetime bounds the drift. Over HTTP, with session resumption, connection pooling, and long-lived bearer tokens, the window between snapshot and call can span hours and multiple server deploys. ## What Was Observed A client agent completed `initialize` against an MCP server exposing a progressive catalog. The server returned a `tools/list` with 14 tools, `listChanged: true`, and a session id. The client persisted this snapshot into its episodic memory as the authoritative capability set for the session — a reasonable-looking optimization to avoid re-listing on every turn. Forty minutes and two server-side deploys later, the agent attempted `tools/call` on `write_workspace_file`. The server had, in the interim, split that tool into `create_workspace_file` and `append_workspace_file` to tighten the input schema (the old tool's `mode` field had been a source of ambiguous writes). The server had also raised the schema version and begun emitting `notifications/tools/list_changed`. The client had subscribed to no such notification — over HTTP it had not opened the SSE channel that carries server-initiated messages, because it had treated the session as request/response. So the `list_changed` notification went nowhere. The `tools/call` for `write_workspace_file` returned a JSON-RPC error with code `-32602` (invalid params) and a message naming the *new* tool. The agent's reasoning loop interpreted `-32602` as "my arguments were malformed," not "the tool no longer exists." It then entered a repair loop: it re-serialized the same arguments with different field orderings, tried adding a `mode` field, tried omitting optional fields, and re-issued the call four times. Each retry consumed tokens and a tool-call slot. On the fifth attempt the agent's token budget for the task was exhausted mid-execution, and the checkpoint it wrote recorded the task as "blocked on schema validation" — a diagnosis that was false. The actual condition was "tool deleted; catalog stale." The compounding failure is the important part. The *first* error was a clean, recoverable signal (`-32602` with a renamed-tool hint). The agent's misclassification of that signal as a local argument problem turned a one-step recovery into a budget-exhausting loop, and the false checkpoint poisoned every subsequent resume. ## Condition of Validity The invariant that was violated: > A cached `tools/list` snapshot is valid only until the first server-initiated `list_changed` notification, the first `-32601`/`-32602` on a tool drawn from that snapshot, or the session's declared catalog TTL — whichever comes first. After any of these, the snapshot MUST be discarded and re-resolved before the next `tools/call`. This holds regardless of transport. Over HTTP it is *load-bearing* because the notification channel and the request channel are decoupled: a client can be perfectly healthy on the request path while silently dropping every `list_changed`. The invariant therefore has a precondition the client must actively satisfy — **either** keep an SSE/streamable channel open for `notifications/tools/list_changed`, **or** treat every `tools/call` as a capability re-check and never trust a snapshot older than the last successful call. The failure is *not* valid to attribute to the server. The server did the correct thing: it emitted `list_changed`, it returned a descriptive error, it kept the old tool's name in the error message. The server upheld its half. The client violated the invariant by (a) not subscribing to the notification channel and (b) not treating the first `-32602` as a catalog-invalidation trigger. ## Decision Boundary The decision the agent must make, stated as a boundary rather than a heuristic: - **If** a `tools/call` returns `-32601` (method not found) or `-32602` (invalid params) **and** the tool name was drawn from a cached snapshot **then** invalidate the snapshot, re-issue `tools/list`, and re-resolve the tool by *semantic intent* against the fresh catalog — do not retry the original call with mutated arguments. - **If** the fresh `tools/list` does not contain a tool matching the intent **then** halt and surface a capability-gap error to the orchestrator. Do not synthesize a substitute tool name and do not fall back to a differently-named tool without an explicit mapping. - **If** the client cannot maintain a notification channel **then** it must set a catalog TTL of zero (re-list before every call) or accept the retry cost — there is no third option where a stale snapshot is safe. The boundary is sharp because the two error codes have opposite meanings that *look* similar to a probabilistic reasoner. `-32602` from a malformed-arguments call means "fix your arguments." `-32602` from a de-listed tool means "the tool is gone." A model that has been trained to treat `-32602` as a self-correction signal will, absent an explicit disambiguator, always choose the first interpretation. The disambiguator is the snapshot age and the presence of a `list_changed` since snapshot — both of which the client must track explicitly because the model cannot infer them from the error text alone. ## Operational Effect The reclassification changes the cost profile of the agent loop. Without the invariant, a stale-catalog miss costs O(retries) tool calls plus a false checkpoint that misleads the resume path — in the observed case, four wasted calls and a poisoned checkpoint. With the invariant, the same miss costs exactly one `tools/list` round-trip and one re-resolved call, and the checkpoint records the truth ("catalog re-resolved; tool renamed from `write_workspace_file` to `create_workspace_file`"). The deeper effect is on **checkpoint semantics**. A checkpoint written under a stale-catalog misdiagnosis is worse than no checkpoint, because the resume path trusts it. The invariant forces the client to distinguish "my inputs were wrong" from "my world model was wrong" *before* writing state — which means the capability snapshot must be a first-class, versioned object in agent memory, not a transient field on the session. When the snapshot is versioned, a `-32602` can be tagged with the snapshot version that produced it, and the resume path can tell whether the failure was a local reasoning error or a world-model staleness. That tagging is the actual guardrail; everything else is bookkeeping around it. ```python import time from dataclasses import dataclass, field from typing import Callable class StaleCatalogError(RuntimeError): """Raised when a tool call is attempted against a catalog snapshot that has been invalidated by a list_changed notification, a prior -32601/-32602, or TTL expiry. Callers must re-resolve the catalog before retrying.""" pass class CapabilityGapError(RuntimeError): """Raised when re-resolution succeeds but no tool in the fresh catalog matches the original intent. Must surface to the orchestrator; the agent must NOT synthesize a substitute tool name.""" pass @dataclass class CatalogSnapshot: version: int tools: dict[str, dict] # name -> input schema captured_at: float ttl_seconds: float invalidated: bool = False def is_valid(self, now: float | None = None) -> bool: now = time.monotonic() if now is None else now return (not self.invalidated) and (now - self.captured_at) < self.ttl_seconds @dataclass class MCPClient: list_tools: Callable[[], dict[str, dict]] call_tool: Callable[[str, dict], dict] snapshot: CatalogSnapshot | None = None _version: int = field(default=0) def refresh(self) -> CatalogSnapshot: self._version += 1 self.snapshot = CatalogSnapshot( version=self._version, tools=self.list_tools(), captured_at=time.monotonic(), ttl_seconds=60.0, ) return self.snapshot def on_list_changed(self) -> None: if self.snapshot is not None: self.snapshot.invalidated = True def invoke(self, tool_name: str, args: dict, intent: str) -> dict: if self.snapshot is None or not self.snapshot.is_valid(): self.refresh() assert self.snapshot is not None if tool_name not in self.snapshot.tools: raise StaleCatalogError( f"tool {tool_name!r} absent from snapshot v{self.snapshot.version}; " f"re-resolve before call" ) try: return self.call_tool(tool_name, args) except Exception as exc: code = getattr(exc, "code", None) if code not in (-32601, -32602): raise # A -32601/-32602 on a snapshot-drawn tool is a catalog-invalidation # trigger, not an argument-repair trigger. self.snapshot.invalidated = True fresh = self.refresh() replacement = self._resolve_by_intent(intent, fresh.tools) if replacement is None: raise CapabilityGapError( f"intent {intent!r} has no match in catalog v{fresh.version} " f"after {tool_name!r} returned {code}; halting for orchestrator" ) return self.call_tool(replacement, args) @staticmethod def _resolve_by_intent(intent: str, tools: dict[str, dict]) -> str | None: # Semantic resolution against the fresh catalog. In production this is # an embedding match or an explicit rename map; the point is that it # consults the NEW catalog, never the stale snapshot. for name, schema in tools.items(): if intent in name or intent in schema.get("description", ""): return name return None ```