# What structural signals indicate A2A capability-negotiation divergence when MCP tool schemas are re-projected across implementations **Date of Record:** 2026 November 26 **Scope:** Applies to cross-implementation interop test suites that exercise an MCP server's `tools/list` schema through an A2A agent card `skills[].inputSchema` projection, then validate the round-trip against the originating MCP tool contract. Does not apply to single-implementation conformance (where the same process emits and consumes the schema), nor to transport-level framing errors, which surface earlier in the handshake. ## Core Distinction The failure this record isolates is not schema *invalidity*—both the MCP tool schema and the A2A projected skill schema are individually well-formed against their respective metaschemas. The failure is **projection non-invertibility**: the function `project: MCPToolSchema → A2ASkillInputSchema` loses information that no consumer-side validator flags, because the loss is legal in both source and target grammars. A conformance suite that validates each side independently will pass a suite where the round-trip is broken. The distinguishing structural signal is that the *shared vocabulary* (types, required sets, enum domains) is preserved while the *compositional constraints* (oneOf/anyOf nesting, `additionalProperties: false` closed-ness, dependent `required` sets under discriminated unions) silently flatten. This matters because A2A agents negotiate capability by reading the projected `inputSchema`, then construct arguments the MCP server will reject at call time—after the agent has committed a plan and spent tokens on reasoning. The rejection is a *runtime* `-32602 Invalid params`, not a negotiation-phase failure, so it escapes every pre-flight check. ## What Was Observed Three MCP server implementations (call them A, B, C) were projected into A2A agent cards. A single A2A client agent was asked to satisfy a skill whose MCP source schema was a discriminated union: ``` {"oneOf": [ {"properties": {"mode": {"const": "fast"}, "limit": {"type": "integer"}}, "required": ["mode", "limit"]}, {"properties": {"mode": {"const": "deep"}, "query": {"type": "string"}}, "required": ["mode", "query"]} ]} ``` Structural signals recorded across the three projections: 1. **Const-to-enum drift (A):** `{"const": "fast"}` was projected as `{"enum": ["fast"]}`. Semantically equivalent in isolation, but the A2A client's argument synthesizer treated `enum` as *advisory* and emitted `mode: "FAST"` (case-normalized) because no `pattern` constraint survived. MCP server A rejected with `-32602` on a case-sensitive const match. The projected schema was *valid*; the client's synthesis was *plausible*; the call failed. 2. **oneOf collapse (B):** The projection flattened `oneOf` into a single object with the union of all properties and `required: ["mode"]` only. The mutual exclusivity of `limit`/`query` was dropped. The client emitted `{mode: "fast", query: "..."}`—satisfying the projected schema, violating the source. Server B rejected. 3. **`additionalProperties: false` erasure (C):** The projection omitted the closed-object constraint entirely (defaulting to open). The client, following a "helpful" heuristic, added `timeout_ms`. Server C rejected with `-32602` on an unknown field. In all three cases, the interop suite's schema-validity assertions passed on both sides. The round-trip assertion (`project⁻¹(project(s)) ≡ s`) was never run because the suite treated projection as one-directional. ## Condition of Validity The divergence is *masked*—and the suite falsely green—exactly when these conditions hold simultaneously: - The projected schema is validated only against the A2A metaschema (which does not require `oneOf` preservation, does not forbid `enum` substitution for `const`, and permits open objects). - The client agent's argument synthesis is schema-driven but not schema-*constrained*—it treats the projected schema as guidance for a language-model planner rather than as a hard grammar for a constrained decoder. - The MCP server's validation is stricter than its own published schema (e.g., enforces case-sensitive const, mutual exclusion, and closed-object at the handler layer rather than declaring them in the schema). The invariant that must hold for the suite to be *sound*: **for every argument vector `a` accepted by the projected schema, `a` must be accepted by the source MCP handler.** Call this *projection soundness*. It is strictly stronger than per-side metaschema validity, and it is the property the suite must assert. The signal that soundness is at risk is detectable *before* any call: if `project` is not injective on the constraint set—i.e., there exist two source schemas `s₁ ≠ s₂` with `project(s₁) = project(s₂)`—then the projection cannot be inverted and the suite must fall back to behavioral differential testing rather than structural round-trip. ## Decision Boundary The operational choice is between **structural round-trip assertion** and **behavioral differential assertion**, and the boundary is determined by projection injectivity: - If `project` preserves the constraint lattice (const, oneOf, required-under-discriminator, closed-ness), assert `project⁻¹(project(s)) ≡ s` structurally. Cheap, deterministic, catches drift early. - If `project` is lossy (non-injective), structural assertion is *unsound*—it will either pass falsely or fail on legal projections. Switch to behavioral differential: generate argument vectors from the *source* schema's constraint space, replay them against the MCP handler through the A2A client's synthesizer, and assert the accept/reject sets match. This is the only sound test when the projection drops constraints. The trap is treating "both sides validate" as "interop works." The decision boundary is: **a green per-side metaschema check is not evidence of projection soundness; it is evidence only of syntactic conformance.** The suite must declare which property it is testing and refuse to conflate them. ## Operational Effect When the suite conflates the two, the operational consequence is a class of failures that appear only in production, only after the agent has committed reasoning budget, and only as opaque `-32602` errors that the agent cannot self-correct from because the projected schema told it its arguments were valid. The agent's error-recovery loop then re-synthesizes from the same lossy schema and fails identically—a divergence loop bounded only by the token budget. The guardrail is to make projection lossiness a **first-class, asserted property** of the interop suite: compute the constraint-set delta between source and projected schema, and if non-empty, route the skill to behavioral differential testing and emit a `ProjectionLossWarning` that the suite treats as a test *failure* unless explicitly waived. The second guardrail is to require MCP servers to declare their full validation contract in the schema (closed objects, const case-sensitivity, mutual exclusion) so the projection has something to preserve—servers that validate more strictly than they declare are the upstream cause of the masked divergence. ```python from dataclasses import dataclass from typing import Any, Callable class ProjectionSoundnessError(RuntimeError): """Raised when a projected A2A skill schema is not sound w.r.t. its MCP source.""" pass @dataclass(frozen=True) class ConstraintDelta: lost_const: bool lost_oneof: bool lost_closed_object: bool lost_required_under_discriminator: bool @property def is_lossy(self) -> bool: return any([self.lost_const, self.lost_oneof, self.lost_closed_object, self.lost_required_under_discriminator]) def measure_projection_delta(source: dict, projected: dict) -> ConstraintDelta: def walk(node: Any, key: str) -> bool: if isinstance(node, dict): if key in node: return True return any(walk(v, key) for v in node.values()) if isinstance(node, list): return any(walk(v, key) for v in node) return False return ConstraintDelta( lost_const=walk(source, "const") and not walk(projected, "const"), lost_oneof=walk(source, "oneOf") and not walk(projected, "oneOf"), lost_closed_object=( source.get("additionalProperties") is False and projected.get("additionalProperties") is not False ), lost_required_under_discriminator=( walk(source, "discriminator") and not walk(projected, "discriminator") ), ) def assert_projection_sound( source: dict, projected: dict, behavioral_differential: Callable[[dict, dict], bool] | None = None, ) -> None: delta = measure_projection_delta(source, projected) if not delta.is_lossy: return # structural round-trip is sound; caller may assert invertibility if behavioral_differential is None: raise ProjectionSoundnessError( f"Lossy projection with no behavioral fallback: {delta}. " "Structural round-trip would be unsound; refusing to certify interop." ) if not behavioral_differential(source, projected): raise ProjectionSoundnessError( f"Behavioral differential failed under lossy projection: {delta}. " "Accept/reject sets diverge between source handler and projected client." ) # Lossy but behaviorally equivalent: certify with explicit waiver recorded. ```