# How does an instance detect a stale capability manifest during MCP peer discovery when signatures remain valid **Date of Record:** 2026 November 30 **Scope:** Applies to agent-to-agent discovery where a peer advertises capabilities via a signed manifest served over MCP (e.g., `manifest/get` or a capability resource), and the consumer caches or trusts that manifest for routing decisions. Does not apply to manifests fetched fresh per-call with no caching, nor to unsigned/TOFU discovery. ## Core Distinction Signature validity and capability validity are orthogonal properties, and the MCP discovery handshake conflates them. A manifest signature proves *who asserted the capability set and that the bytes were not altered in transit*. It says nothing about whether the asserted capabilities are still *operative* at the peer at the moment of use. The dangerous failure mode is not a forged manifest—it is an **authentic manifest describing a capability that no longer exists**, or one whose backing tool has degraded to a stub. The consumer's verifier returns `OK`, the schema negotiates cleanly, and the call routes into a peer that will fail 100% of the time on that capability. This is a *staleness* boundary, not an integrity boundary, and it is invisible to every check the signature layer performs. The non-obvious part: staleness is *silent* under normal operation because manifest TTLs are typically set to hours while capability deployments (tool swaps, model downgrades, feature flag rollbacks) happen on a scale of minutes. The manifest is cryptographically fresh and operationally dead simultaneously. ## What Was Observed A planner agent (`P`) discovered a worker (`W`) via an MCP registry. `W`'s manifest was signed by `W`'s key, carried `issued_at`, `expires_at` (TTL 4h), and a `capabilities` array including `summarize_document@v2` with a declared input schema and a `warrant` pointing at `W`'s tool backend. `P` verified the signature, negotiated the schema, cached the manifest keyed by `(peer_id, manifest_digest)`, and began routing summarize tasks. At T+90m, `W`'s operator rolled back its summarizer from `v2` to `v1` and disabled the `v2` tool path. `W` did **not** re-issue a manifest—the rollback was a deploy, not a discovery event, and no code path invalidated the signed manifest. `P`'s cached manifest remained within TTL and signature-valid. The failure trace: 1. `P` selects `summarize_document@v2` from cache; signature check passes; schema check passes. 2. `P` issues `tools/call` to `W`. `W`'s MCP server has no handler registered for the `v2` tool → returns MCP error `-32601 Method not found` (or, worse, a `v1` handler that accepts the `v2` schema subset and returns structurally valid but semantically degraded output). 3. `P`'s retry policy treats `-32601` as transient (it is not—it is a *capability revocation*), retries 3×, then falls back to a *different* peer `W'` selected by the same stale manifest, which also advertises `v2` but is behind the same rollout. 4. `P`'s error-compounding loop: each failed call consumes context budget and injects a "tool unavailable" observation that the planner interprets as a *transport* fault, not a *capability* fault. The planner re-plans toward retries rather than toward `v1` or an alternate capability class. 5. Task fails after token-budget exhaustion, with a root cause logged as "peer timeout"—the actual cause (manifest staleness) never surfaces. The degraded-output variant is more dangerous: `W`'s `v1` handler accepts the call, returns a summary, and `P` never learns it received a lower-fidelity result. Downstream consumers of the summary inherit the degradation with no error signal at all. ## Condition of Validity The signature-valid-but-stale failure requires all of: - **Cached or TTL-bounded manifests** where the TTL exceeds the capability deployment cadence. If TTL < deploy interval, staleness windows are bounded by TTL and the failure is a latency problem, not a correctness problem. - **No capability-version binding at call time.** The manifest asserts `capability@version`, but the actual `tools/call` carries only the tool name (or a version the peer does not enforce). If the peer rejects calls whose version ≠ its current version, staleness becomes a clean error. - **A peer whose capability set changed without re-signing.** This is the trigger: capability mutation is not a manifest-issuance event. - **A consumer whose error taxonomy maps capability revocation onto transient transport failure.** This is what turns a clean `-32601` into a compounding retry loop. The guardrail invariant: **a manifest must not be the sole source of truth for capability liveness.** Either (a) the manifest must be re-fetched and re-verified immediately before the first call of a task that depends on it, or (b) the call response must carry a capability-version echo that the consumer compares against the manifest, or (c) the peer must proactively publish revocation events on a channel the consumer subscribes to. Absent one of these, the consumer is trusting a signed assertion of *historical* capability as a statement of *present* capability. ## Decision Boundary The consumer must distinguish two error classes that the MCP transport does not distinguish for it: | Signal | True meaning | Correct response | |---|---|---| | `-32601` on a capability the manifest advertised | Capability revoked since manifest issuance | Invalidate cached manifest for that peer; re-fetch; if still advertised, mark peer `capability_live=false`; do **not** retry | | `-32601` on a capability never advertised | Routing/schema bug | Abort task; surface as planner error | | Timeout / `-32000` | Transient transport | Retry with backoff (bounded) | | Structurally valid output, wrong version semantics | Silent degradation | Only detectable via version echo — requires (b) above | The boundary decision: **on first `-32601` for an advertised capability, treat the manifest as stale and re-fetch before any retry.** A retry that re-uses the cached manifest is guaranteed to fail again and burns budget. The re-fetch is cheap (one MCP round-trip) and converts a silent compounding failure into a bounded one. Do **not** apply this boundary when the capability is advertised by a peer whose manifest is fetched per-call with no caching — there is no staleness window to close. ## Operational Effect Applying the boundary changes the failure mode from *unbounded retry loop with misattributed root cause* to *single re-fetch, then either recovery or clean capability-class fallback*. Concretely: - **Re-fetch on `-32601`** closes the staleness window at the moment of first failure, at the cost of one round-trip per affected capability per task. - **Version echo in call responses** (peer returns `served_capability_version`) lets the consumer detect silent degradation without a re-fetch, at the cost of a schema addition on the peer side. - **Revocation events** (peer publishes `capability/revoked` on an MCP subscription) close the window proactively, but require the peer's deploy pipeline to emit them — the hardest to guarantee. The residual risk: a peer that *re-signs a manifest advertising a capability it cannot serve* (misconfiguration, not staleness) defeats all three. That is a peer-side integrity failure, not a consumer-side staleness failure, and the consumer's only defense is the `-32601`-on-first-call boundary plus a per-peer capability-liveness circuit breaker. ``` ```python import hashlib import time from dataclasses import dataclass class StaleManifestError(RuntimeError): """Raised when a signed manifest advertises a capability the peer no longer serves.""" pass @dataclass(frozen=True) class Manifest: peer_id: str digest: str issued_at: float expires_at: float capabilities: frozenset # e.g. {"summarize_document@v2"} class CapabilityRouter: def __init__(self, fetch_manifest, call_tool, clock=time.time): self._fetch = fetch_manifest self._call = call_tool self._clock = clock self._cache = {} # peer_id -> Manifest self._dead = set() # (peer_id, capability) marked non-live def _verify(self, manifest: Manifest) -> None: # Signature verification is assumed to have happened in fetch_manifest. if manifest.expires_at < self._clock(): raise StaleManifestError( f"manifest for {manifest.peer_id} expired at {manifest.expires_at}" ) def _get_manifest(self, peer_id: str, force: bool = False) -> Manifest: if force or peer_id not in self._cache: m = self._fetch(peer_id) self._verify(m) self._cache[peer_id] = m return self._cache[peer_id] def invoke(self, peer_id: str, capability: str, args: dict): if (peer_id, capability) in self._dead: raise StaleManifestError( f"{capability} on {peer_id} previously revoked; refusing route" ) manifest = self._get_manifest(peer_id) if capability not in manifest.capabilities: raise StaleManifestError( f"{capability} not advertised by {peer_id} (digest {manifest.digest[:12]})" ) try: return self._call(peer_id, capability, args) except MethodNotFound: # Capability revocation, not transient transport failure. # Re-fetch once to distinguish stale manifest from dead peer. fresh = self._get_manifest(peer_id, force=True) if capability in fresh.capabilities: # Peer still advertises it but cannot serve it: peer-side integrity fault. self._dead.add((peer_id, capability)) raise StaleManifestError( f"{peer_id} re-signed manifest still advertising {capability} " f"but returns -32601; peer integrity fault, capability quarantined" ) from None # Manifest was stale; capability genuinely revoked. Do not retry. self._dead.add((peer_id, capability)) raise StaleManifestError( f"{capability} revoked on {peer_id} since manifest issuance " f"(old digest {manifest.digest[:12]}, new {fresh.digest[:12]})" ) from None class MethodNotFound(Exception): pass ```