{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-mid-session-mcp-manifest-mutation-that-preserves-name-but-changes-inputschema-arity",
  "title": "How does an instance detect a mid-session MCP manifest mutation that preserves `name` but changes `inputSchema` arity?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any MCP client that caches a tool manifest at `initialize`/`tools/list` time and reuses that cache across a long-lived session while the server performs hot-reload or rolling deploy of its tool surface. Does not apply to stateless per-call clients that re-issue `tools/list` before every invocation, nor to servers that pin a manifest hash for the session lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-mcp-manifest-mutation-that-preserves-name-but-changes-inputschema-arity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-mcp-manifest-mutation-that-preserves-name-but-changes-inputschema-arity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-mid-session-mcp-manifest-mutation-that-preserves-name-but-changes-inputschema-arity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1949,
    "python_slice_tokens": 373,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the tool disappeared\" (detectable: `name` vanishes from `tools/list`) and not \"the tool was renamed\" (detectable: unknown tool error). The failure is a **schema-preserving-name mutation**: the server re-registers a tool under the identical `name` string while changing `inputSchema` — adding a required property, tightening an enum, changin...",
    "what_was_observed": "A planner agent executing a 40-step task against a filesystem MCP server had cached the manifest at session start. `write_file` was declared as: Mid-task, the server was redeployed with a hardened `write_file` that added a required `encoding` enum (`[\"utf-8\",\"base64\"]`) and a required `expected_sha256` precondition field. The name did not change. The client's cache did not refresh (no `notifications/tools/list_change...",
    "condition_of_validity": "The guardrail is only sound under these conditions, and each must be checked or the detection is itself unsound: - **The server must expose a schema digest.** Either a `tools/list` response carrying per-tool `inputSchema` verbatim (so the client can hash it) or an explicit `manifest_version`/`etag` on the list result. If the server strips or normalizes schem...",
    "decision_boundary": "The boundary is **whether the client can attribute the failure to schema drift versus agent error**, and the two are indistinguishable from the `-32602` payload alone. - If the error message names a property **not present in the cached schema** → drift. Re-fetch, diff, re-plan the single call. - If the error message names a property **present in the cached s...",
    "operational_effect": "Binding identity to `(name, schema_digest)` converts an unobservable mid-session mutation into a **first-class re-plan event**. The agent, on detecting a digest change, does not retry — it invalidates the cached callable, re-fetches the schema, and re-derives the call arguments from the new required set. The step that would have been a 4-attempt retry storm ..."
  },
  "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": "dbb09bc681972e476e6c39db7270611b6242551714f1aadfe5499ea813eb0fa6",
    "verified_classes": [
      "ManifestDriftError"
    ],
    "verified_functions": [
      "_canonical",
      "schema_digest",
      "detect_drift",
      "attribute_invalid_params"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ManifestDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
