# How does an instance detect that a peer's A2A agent card has silently drifted from the MCP tool schema it advertises under the same capability name **Date of Record:** 2026 November 26 **Scope:** Applies to cross-protocol agents that simultaneously expose an MCP server (tool surface) and an A2A agent card (capability surface) for the same underlying function, and to clients that route calls by capability name across the MCP/A2A boundary. Does not apply to single-protocol deployments or to A2A-only handoffs where no MCP tool schema is co-published. ## Core Distinction The failure is not a schema mismatch at connection time. Both protocols validate cleanly in isolation: the MCP `tools/list` response is a well-formed JSON Schema, and the A2A `agent.json` card is a well-formed capability descriptor. The boundary failure lives in the *unverified correspondence* between them. MCP describes a tool by `name` + `inputSchema`; A2A describes a capability by `skill.id` + `skill.description` + optional `inputModes`/`outputModes`. Nothing in either spec requires these two descriptions to be derived from a single source of truth, and nothing forces them to be re-derived together. When the implementation behind the capability changes, one descriptor often gets updated and the other does not. The result is an agent that *advertises* through A2A a capability whose *actual* parameter contract, as reachable through MCP, has moved. A caller that negotiates via A2A and then executes via MCP is calling against a stale contract it never validated. The non-obvious part: A2A has no field for a schema hash, and MCP has no field for a capability ID. There is no shared join key except the human-readable name, which is exactly the field most likely to survive an edit that changes everything else. ## What Was Observed A capability named `summarize_document` was co-published on both surfaces. The MCP `inputSchema` originally required `{"document_uri": string, "max_tokens": integer}`. The A2A card's `skill.description` read: "Summarizes a document referenced by URI, capped at max_tokens." A refactor changed the MCP tool to require `{"document_uri": string, "token_budget": integer, "language": string}` — `max_tokens` renamed, `language` newly required. The MCP schema was regenerated from code. The A2A card was hand-maintained and was not touched. A downstream orchestrator discovered the capability via A2A, saw a description consistent with its prior, constructed a call with `max_tokens`, and dispatched it over MCP. The MCP server rejected the call with a schema-validation error. The orchestrator's retry logic treated the rejection as transient, re-sent the identical payload twice, then marked the peer degraded. No error anywhere said "the A2A card is stale." The orchestrator had no way to attribute the failure to descriptor drift rather than to a flaky peer, so it quarantined a healthy server. The trace, compressed: 1. A2A discovery returns card with `skill.id = summarize_document`, description mentioning `max_tokens`. 2. Orchestrator plans a call using `max_tokens` (source of truth: A2A description). 3. Orchestrator executes over MCP with `{document_uri, max_tokens}`. 4. MCP server validates against live schema, rejects: missing `token_budget`, missing `language`, unexpected `max_tokens`. 5. Orchestrator classifies as transport/transient, retries, fails identically. 6. Orchestrator demotes peer; capability becomes unreachable fleet-wide even though the server is correct. The invariant that was violated is not "schemas must match." It is: *for any capability reachable through both protocols, the A2A card and the MCP tool schema must be provably derived from the same versioned source, and a client must be able to detect divergence before dispatching.* Neither protocol enforces this, so it must be enforced by a conformance probe the client runs at discovery time. ## Condition of Validity The drift is only detectable — and the guardrail only sound — under these conditions: - The capability is co-published: the same logical function is reachable via an MCP tool and an A2A skill. If only one surface exists, there is nothing to cross-check. - The two descriptors carry enough structural information to be compared. A2A `skill.description` alone is insufficient (free text). Detection requires the publisher to embed a machine-comparable artifact — a schema digest, a parameter-name set, or a version string — into the card, e.g. under a vendor extension field. Without this, drift is only observable *after* a failed call, which is too late to prevent misattribution. - The client caches discovery results. If the client re-fetches both descriptors on every call, divergence manifests as a hard validation error each time and the retry-misclassification bug is the only remaining hazard; the stale-cache variant (below) does not apply. - The MCP server's schema is authoritative for execution. If the A2A path can also execute (a gateway that translates A2A calls into MCP calls using the card's description rather than the live schema), the failure moves into the gateway and the client-side probe cannot see it. Outside these conditions — e.g., a gateway that resolves parameters from the live MCP schema at call time — the drift is masked, not absent, and the probe below will report a false negative because the client never sees the stale contract. ## Decision Boundary The decision the runtime must make at discovery time is binary: **is the A2A card's described contract for capability `C` consistent with the live MCP `inputSchema` for the tool bound to `C`?** Three outcomes: - **Consistent** → cache both, dispatch normally. - **Divergent** → do not dispatch. Emit a `DescriptorDriftError` naming the capability and the specific fields that disagree (`max_tokens` present in card, absent in schema; `language` required in schema, absent from card). Route to a human or to a re-certification queue. Critically, do *not* demote the peer's health score — the peer is not degraded, its metadata is stale, and conflating the two causes the quarantine cascade observed above. - **Unverifiable** (card carries no comparable artifact) → dispatch is permitted but must be tagged `unverified_contract` so that any subsequent schema-validation failure is attributed to descriptor drift first, transport second. The boundary condition that makes this non-trivial: a divergence is *not* always an error. During a coordinated rollout, the MCP schema may legitimately be ahead of the A2A card by one version. The guardrail must therefore compare *version lineage*, not raw equality — accept divergence when the card declares a version that the MCP server reports as a known predecessor; reject when the card's version is unknown to the server or older than the server's declared compatibility floor. ## Operational Effect Without the probe, descriptor drift is indistinguishable from peer flakiness at the orchestrator, so the failure mode is *misattributed quarantine*: correct servers get demoted, capability coverage silently shrinks, and the fleet routes around a healthy node. The blast radius is every client that discovered the capability through A2A and executed through MCP — typically the entire fleet, since discovery is shared. With the probe, drift is caught at the discovery boundary, before any call is constructed from the stale contract. The peer's health is preserved; the capability is flagged for re-certification; the A2A card is regenerated from the same source as the MCP schema. The invariant to hold: *a capability name is only routable when its two descriptors agree on version lineage, and agreement is checked at cache-fill time, not at call time.* Checking at call time is too late — the stale contract has already shaped the payload. The residual hazard after the guardrail: the probe itself caches. If the MCP schema is regenerated but the client's cached schema digest is not invalidated, the probe compares two stale artifacts and passes. The probe must therefore key its cache on the MCP server's schema version (returned in `tools/list` metadata or a `schema_version` extension), not on wall-clock TTL. ```python from dataclasses import dataclass, field from typing import Optional class DescriptorDriftError(RuntimeError): """Raised when an A2A agent card and the co-published MCP tool schema disagree on the contract for the same capability, beyond the declared version-lineage compatibility window.""" def __init__(self, capability: str, detail: str): self.capability = capability self.detail = detail super().__init__(f"descriptor drift on '{capability}': {detail}") @dataclass class AgentCardSkill: skill_id: str declared_version: str described_params: set[str] schema_digest: Optional[str] = None # vendor extension; None => unverifiable @dataclass class McpToolSchema: name: str version: str required_params: set[str] schema_digest: str compatible_predecessors: set[str] = field(default_factory=set) def check_conformance( skill: AgentCardSkill, tool: McpToolSchema, *, require_digest: bool = True, ) -> str: """Returns 'consistent' | 'unverifiable'. Raises DescriptorDriftError on provable divergence. Must be called at cache-fill, before dispatch.""" if skill.skill_id != tool.name: raise DescriptorDriftError( skill.skill_id, f"skill bound to tool '{tool.name}'" ) # Version lineage check: card may lag the tool by a declared predecessor. if skill.declared_version != tool.version: if skill.declared_version not in tool.compatible_predecessors: raise DescriptorDriftError( skill.skill_id, f"card version {skill.declared_version!r} not in " f"compatible predecessors of tool version {tool.version!r}", ) # Parameter-set check: the card must not describe params the schema # rejects, and must not omit params the schema requires. phantom = skill.described_params - (tool.required_params | set()) missing = tool.required_params - skill.described_params if phantom or missing: raise DescriptorDriftError( skill.skill_id, f"phantom_params={sorted(phantom)} missing_params={sorted(missing)}", ) # Digest check: only meaningful when the card carries a comparable artifact. if skill.schema_digest is None: if require_digest: raise DescriptorDriftError( skill.skill_id, "card carries no schema_digest; contract unverifiable", ) return "unverifiable" if skill.schema_digest != tool.schema_digest: raise DescriptorDriftError( skill.skill_id, f"schema_digest mismatch: card={skill.schema_digest} " f"tool={tool.schema_digest}", ) return "consistent" def discover_and_gate(skill: AgentCardSkill, tool: McpToolSchema) -> str: try: verdict = check_conformance(skill, tool) except DescriptorDriftError: # Do NOT demote peer health here — the peer is healthy, metadata stale. raise if verdict == "unverifiable": return "dispatch_tagged_unverified_contract" return "dispatch" ```