{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-capability-drift-when-an-mcp-client-and-server-negotiate-tools-across-a-versioned-handshake",
  "title": "Which invariants prevent silent capability drift when an MCP client and server negotiate tools across a versioned handshake",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any MCP (Model Context Protocol) session where a client discovers tools/list from a server whose advertised schema version can differ from the version the client cached, and where the server's tool set can change between handshake and invocation. Does not apply to single-shot, stateless tool calls where discovery and invocation occur in the same atomic exchange with a pinned schema hash.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-client-and-server-negotiate-tools-across-a-versioned-handshake.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-client-and-server-negotiate-tools-across-a-versioned-handshake.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-client-and-server-negotiate-tools-across-a-versioned-handshake.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2065,
    "python_slice_tokens": 519,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the server crashed\" or \"the tool returned an error.\" It is **silent capability drift**: the client negotiated a capability surface at handshake time, the server's actual tool surface mutated afterward (a tool renamed, a parameter's type narrowed from `string` to `enum`, a required field added, a tool removed), and the client's a...",
    "what_was_observed": "A concrete trace from a multi-tool agent session: 1. Client sends `initialize` with `protocolVersion: \"2024-11-05\"`. Server responds with the same version and `capabilities: { tools: { listChanged: true } }`. 2. Client calls `tools/list`, receives 14 tools. Tool `query_metrics` has schema `{ region: string, window: string }` where `window` is a free-form string like `\"1h\"`, `\"24h\"`. 3. The agent, over ~40 turns, buil...",
    "condition_of_validity": "The invariant that prevents this is: **a tool invocation is only valid if the schema it was shaped against is provably the schema currently enforced by the server.** Concretely, three conditions must hold jointly: - **Schema identity is content-addressed, not version-addressed.** The client must key its cached schema by a hash of the full tool definition (na...",
    "decision_boundary": "The operational question is: **when the client detects that its cached schema hash differs from the freshly fetched hash, does it abort the in-flight plan or re-plan in place?** - **Abort and re-plan** is correct when the changed tool is on the critical path of the current subgoal and the change is *narrowing* (removed tool, added required field, enum tighte...",
    "operational_effect": "With the three conditions enforced, the failure trace above terminates at step 6: the client sees the `list_changed`, marks `query_metrics` dirty, re-fetches, computes a new hash, detects the enum narrowing, and — because the in-flight plan depends on `window=\"7d\"` — aborts the subgoal and surfaces a re-plan event to the agent. The agent observes \"capability..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "87754bf236e01d8395ff1dd53b3e744e1d8f502cb1462323018f604eab3d9580",
    "verified_classes": [
      "CapabilityDriftError",
      "ToolSchema",
      "NegotiatedSurface"
    ],
    "verified_functions": [
      "on_list_changed",
      "invoke_tool",
      "_is_narrowing",
      "_strict_validate_and_call",
      "content_hash",
      "hash_for"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CapabilityDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
