Where must an instance halt when an MCP tool schema mutates between `tools/list` and `tools/call`: the silent argument-coercion trap
**Date of Record:** 2026 December 1
**Scope:** Applies to any LLM agent operating as an MCP client that caches or reasons over a tool's `inputSchema` obtained from `tools/list` and later invokes it via `tools/call` against a server whose schema has evolved (field added, renamed, narrowed, or type-widened) between negotiation and execution. Does not cover transport-level failures (dropped stdio, HTTP 5xx) or pure authorization rejections, which surface as explicit errors rather than silent coercion.
Core Distinction
The failure we are isolating is not "the server rejected a bad call." It is the opposite: **the server accepted a call that the client believed conformed to an older schema, and the server's newer schema reinterpreted the arguments into a different valid call.** The distinction is between *rejection* (loud, recoverable, the agent sees an error and re-plans) and *coercive acceptance* (silent, the agent's plan proceeds on a corrupted premise). An MCP client that treats a 200-equivalent `tools/call` result as confirmation that its cached schema was current has confused *execution success* with *schema agreement*. These are independent facts, and only the second one bounds correctness.
The concrete mechanism: JSON Schema's `additionalProperties` defaults to `true`, and most MCP servers do not set it to `false`. When a server evolves a tool by *renaming* `query` → `search_term` and *adding* `search_term`, an old client that sends `{"query": "..."}` still validates — because `query` is an allowed additional property and `search_term` is absent-but-not-required. The server receives no `search_term`, applies a default (often the empty string or a wildcard), and returns a plausible-looking result set. The agent's cached schema said "send query," the server's live schema said "send search_term," and the call *succeeded* against a query the agent never intended.
What Was Observed
A retrieval agent negotiated with an MCP filesystem-search server at session start. `tools/list` returned:
{"name": "search", "inputSchema": {
"type": "object",
"properties": {"query": {"type": "string"}, "limit": {"type": "integer"}},
"required": ["query"]}}
Mid-task, the server was hot-redeployed to a schema where `query` was split into `path_prefix` (required) and `pattern` (required), and `query` was retained as a deprecated alias that the server mapped to `pattern` only — `path_prefix` defaulting to `/`. The agent, holding the cached schema, issued `tools/call {"query": "*.py", "limit": 50}`. The server accepted it: `query` was still a declared property (deprecated), `path_prefix` defaulted to `/`, `pattern` was populated from the alias. The call returned 50 results from the *entire filesystem*, not the intended subdirectory. The agent, seeing well-formed results, incorporated them into its reasoning and never re-fetched `tools/list`. Three subsequent calls compounded the error because the agent's working memory now contained "facts" from the wrong path scope.
The tell was not an error. It was a *plausible* result set with a subtly wrong scope. The failure trace: (1) cached schema S₀ at t=0; (2) server schema mutated to S₁ at t=1; (3) agent emits call conforming to S₀; (4) server validates against S₁, which is *permissive* because `additionalProperties` is unset and the deprecated alias is retained; (5) server executes a call semantically different from the agent's intent; (6) result is well-formed and enters agent context; (7) no signal exists in the response to indicate schema divergence.
Condition of Validity
The trap requires the conjunction of four conditions, and removing any one bounds it:
- **Permissive schema evolution** — the server's new schema accepts the old schema's arguments, either via `additionalProperties: true` (default) or via a retained deprecated alias. If the server sets `additionalProperties: false` *and* removes the old field, the old call is rejected loudly and the failure is recoverable.
- **Client-side schema caching** — the client does not re-fetch `tools/list` before each call, or does not compare a schema version/hash. The MCP spec does not mandate a schema version field; servers that add one (e.g., `schemaVersion` in tool metadata) give clients a handle, but most do not.
- **No semantic assertion on the result** — the agent does not verify that the result matches the *intent* of the call (e.g., that returned paths are under the intended prefix). If it did, the scope violation would be caught.
- **Default-filling on the server** — the server fills missing required-in-S₁ fields with defaults rather than erroring. A server that errors on missing `path_prefix` would surface the divergence.
The invariant that must hold: **a `tools/call` result is evidence of execution, not evidence of schema agreement.** The only sound way for a client to know its schema is current is to re-fetch `tools/list` and compare, or to have the server echo a schema version/hash in the call response. Absent either, the client must treat every result as potentially-scoped-wrong and assert on result semantics.
Decision Boundary
The boundary is: *when must the client re-negotiate versus when may it trust its cache?* The answer is not "always re-fetch" (that doubles round-trips and is impractical for high-frequency tools) nor "never" (that is the trap). The defensible boundary is:
- **Re-fetch `tools/list` when the tool is state-mutating or scope-sensitive** (writes, deletes, searches with path/tenant scoping, anything where a wrong default silently widens blast radius). For these, the cost of a stale schema is a corrupted action, not a wasted call.
- **Trust the cache only for pure, idempotent, narrow-scope reads** where the worst case of a coerced call is a redundant read, and where the agent asserts result semantics anyway.
- **Always assert on result semantics at the boundary the agent controls** — if the agent intended `path_prefix=/src`, it must check that returned paths are under `/src`, regardless of schema freshness. This is the guardrail that survives even a correct schema, because it catches server-side bugs too.
The decision to *halt* rather than *proceed-and-assert* is triggered when the agent cannot construct a semantic assertion for the tool (e.g., an opaque ML-inference tool where the result is a float with no checkable provenance). For those, schema staleness is unbounded and the only safe move is re-fetch-before-call or refuse.
Operational Effect
The operational consequence is a reclassification of MCP client responsibilities. A client that treats `tools/list` as a one-time handshake has an unbounded correctness hole for the lifetime of the session. A client that treats it as a *lease* — valid until a semantic assertion fails or a scope-sensitive tool is invoked — bounds the hole to the assertion's coverage. The practical guardrail set:
- **Schema fingerprinting**: hash `inputSchema` at negotiation; on any error *or* any result that fails a semantic assertion, re-fetch and diff. A diff that changes `required` or renames a property invalidates the lease.
- **Result-scope assertions**: for scope-sensitive tools, the client wraps the call in a predicate that checks the result lies within the intended scope (path prefix, tenant ID, time range). This is the last line of defense and catches coercive acceptance even when the schema is current.
- **Deprecated-alias awareness**: when a schema diff shows a field demoted to alias, the client must treat the alias as *semantically lossy* (it may map to only one of several new fields) and re-plan, not just re-send.
- **Halt on unassertable scope-sensitive tools**: if a tool is scope-sensitive and the client cannot assert on its result, the client must re-fetch `tools/list` before every call or refuse the tool.
The failure mode is not exotic; it is the *default* behavior of any MCP client that caches schemas against a server that evolves permissively. The invariant to encode: **execution success ≠ schema agreement; only a schema fingerprint match or a semantic result assertion can establish agreement.**
class SchemaLeaseViolation(RuntimeError):
"""Raised when a tool call's result cannot be reconciled with the cached
schema lease — either the schema mutated under us, or the result's
semantics fall outside the scope the cached schema implied."""
pass
def guarded_tool_call(client, tool_name, args, expected_scope, lease):
"""Invoke an MCP tool under a schema lease, asserting result scope.
lease: {"schema_hash": str, "required": set[str], "scope_field": str | None}
expected_scope: value the scope_field must match in every result row,
or None if the tool is not scope-sensitive.
"""
# 1. If scope-sensitive and we cannot assert, we must re-negotiate first.
if expected_scope is not None and lease.get("scope_field") is None:
raise SchemaLeaseViolation(
f"tool {tool_name!r} is scope-sensitive but lease carries no "
f"scope_field; refusing to call on a stale schema"
)
result = client.call_tool(tool_name, args)
# 2. Coercive-acceptance detection: the server may have accepted args that
# conformed to an old schema and reinterpreted them. Check result scope.
if expected_scope is not None:
field = lease["scope_field"]
for row in result.get("rows", []):
if row.get(field) != expected_scope:
# Schema diverged or server default-filled a widened scope.
fresh = client.list_tools()
fresh_hash = hash_schema(fresh[tool_name]["inputSchema"])
if fresh_hash != lease["schema_hash"]:
raise SchemaLeaseViolation(
f"schema for {tool_name!r} mutated mid-session "
f"({lease['schema_hash']} -> {fresh_hash}); result "
f"scope {row.get(field)!r} != expected "
f"{expected_scope!r}. Re-plan required."
)
raise SchemaLeaseViolation(
f"result for {tool_name!r} escaped scope {expected_scope!r} "
f"despite stable schema; server-side default-fill suspected"
)
return result
def hash_schema(input_schema):
import hashlib, json
return hashlib.sha256(
json.dumps(input_schema, sort_keys=True).encode()
).hexdigest()