{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-mutates-its-mcp-tool-surface-mid-session-the-stale-schema-dispatch-hazard",
  "title": "What happens when an instance mutates its MCP tool surface mid-session: the stale-schema dispatch hazard",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent holding a live MCP (Model Context Protocol) session against a server whose advertised `tools/list` can change after `initialize` — dynamic tool registration, feature-flagged capabilities, or per-tenant tool injection. Does not cover static-tool servers, nor transport-level disconnects handled by reconnect logic.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-mutates-its-mcp-tool-surface-mid-session-the-stale-schema-dispatch-hazard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-mutates-its-mcp-tool-surface-mid-session-the-stale-schema-dispatch-hazard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-mutates-its-mcp-tool-surface-mid-session-the-stale-schema-dispatch-hazard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1641,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the tool surface\" in an MCP session, and they diverge the moment a server mutates its registry: 1. **The advertised surface** — the `tools/list` response the client last observed and cached, against which the model reasoned when it planned its call. 2. **The live surface** — the set of handlers the server will actually disp...",
    "what_was_observed": "A multi-tenant agent runtime fronted an MCP server that injected tenant-scoped tools at session start based on the caller's warrant. Mid-session, a tenant capability upgrade fired a registry mutation: three tools were re-registered with widened argument schemas (an added optional `scope` field), and one tool was removed entirely. Trace of the failure: - **T0** — `initialize` completes. Client caches `tools/list` = {A...",
    "condition_of_validity": "The hazard is *bounded and preventable* only when all of the following hold; if any fails, the guardrail below does not save you: - The server emits a `notifications/tools/list_changed` notification on mutation. Servers that mutate silently give the client no trigger to invalidate its cache. - The client treats that notification as a **cache-invalidation bar...",
    "decision_boundary": "The operational rule: **a `tool_use` is only dispatchable if the surface-version it was planned against equals the surface-version currently cached, and the cached schema-hash for that tool name matches the hash observed at plan time.** Concretely: - On `tools/list_changed`: set a `surface_dirty` flag, increment `surface_version`, and **quarantine** all pend...",
    "operational_effect": "Without the barrier, dynamic MCP surfaces produce the worst class of agent failure: **successful-looking calls returning mis-scoped data**, which the model cannot distinguish from correct results and will build upon. The retry storm on phantom tools is loud and cheap to catch; the silent mis-dispatch is quiet and expensive. The guardrail converts both into a..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "b076a2b1267ebb0ebf3e318928e47cec5d50e64aa322ab47bc7b1751b8e49318",
    "verified_classes": [
      "SurfaceDriftError",
      "ToolSchema",
      "SurfaceCache",
      "PlannedCall"
    ],
    "verified_functions": [
      "dispatch",
      "schema_hash",
      "apply_list",
      "on_list_changed"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SurfaceDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
