Fault-Domain Ledgers: Isolating MCP Tool Failures Without Losing Evidence
Build resilient MCP tool fleets with per-operation and per-server fault domains, end-to-end deadline budgets, fenced recovery, truthful degradation, and tenant-safe telemetry.
On this page
An AI agent can look healthy at the model layer and still become unusable because one remote tool never finishes. A dependency may return a successful HTTP response yet contain a tool-level error. A read may time out after consuming most of the turn's latency allowance. A worker may retry from a different replica, unaware that the shared upstream service is already struggling.
I would solve this as a fault-domain design problem, not by giving every MCP call the same timeout. In a system with several tool servers, the important distinction is whether the problem belongs to one operation, one trusted server connection, one tenant's quota, or the workflow as a whole.
This article proposes a fault-domain ledger for a hypothetical multi-tenant product-catalog assistant. The architecture and examples are original design sketches, not claims of a deployed system or measured performance. It complements my existing articles on system-wide agent backpressure, validated tool-call recovery, and provider failover. Here the concern is specifically multiple MCP endpoints with different reliability and business semantics.
The user request has a dependency graph, not a flat tool list
Imagine an agent that prepares a retailer's catalog item for publication. It reads product attributes from an internal MCP service, requests an image-rights assessment from an approved vendor tool, and optionally retrieves translation suggestions from a separate language service.
Not all three calls have equal significance. The product attributes and rights decision may be mandatory for publication. Translation suggestions can be skipped if the user opted into a language-fallback policy. If the image-rights service is down, the application must not make the model guess that the image is licensed.
This leads to a dependency contract:
| Tool dependency | Business importance | Authorized degraded behavior |
|---|---|---|
| Product attributes | Required | Mark verification incomplete; do not publish |
| Image-rights status | Required | Preserve an unresolved state for human or later review |
| Translation suggestions | Optional | Use previously approved copy or omit suggestions with disclosure |
The agent can choose a useful next step within those limits. It cannot redefine a required verification as optional merely because the tool is unavailable.
The MCP specification provides a mechanism to discover and invoke tools, but the application still owns its dependency reliability policy. The MCP tools specification defines tools/list and tools/call, separates complete results from input-required results, and permits tool-level errors in a complete response. None of those wire-level contracts establishes your product's maximum waiting time or safe fallback.
Three nested fault domains, with an independent run deadline
I would model the boundaries as a hierarchy:
~~~text Authenticated catalog workflow run deadline / risk policy | Protected dispatch broker | +-----------------+-----------------+ | | | Endpoint A Endpoint B Endpoint C catalog data image rights language transport transport transport health state health state health state | | | tool health tool health tool health / \ / \ | read search check status suggest | | | typed results mandatory proof optional result +-----------------+-----------------+ | Verified outcome assembler pass / incomplete / denied / unavailable
Origin-health failure blocks the endpoint. Operation-health failure blocks only the affected tool. Workflow deadline bounds every branch, including retries. ~~~
The endpoint health state addresses transport-level failures that affect every operation using the same authenticated destination. The operation health state covers a specific tool whose backend may be impaired while other tools at that endpoint remain usable. The workflow deadline bounds the complete user-facing operation; many individually bounded calls can still exceed it in sequence.
A tenant quota is not evidence that the MCP server is broken. Rate limits and authorization failures should be classified separately from transport health and the tool's own availability. Likewise, an unknown result after a write must be represented as uncertain rather than as a clean failure.
The resulting broker is more than a circuit breaker in front of a shared HTTP client: it is a decision point that knows which failure domains are implicated and what the workflow is permitted to do.
Build identities from trusted routing information
A circuit breaker keyed only by a tool's displayed name is dangerous. Two MCP endpoints can both expose search, and the protocol explicitly limits tool-name uniqueness to one server. The server-provided display name is not a trusted globally unique endpoint identity. <https://modelcontextprotocol.io/specification/2026-07-28/server/tools>
Instead, the application should create its own endpoint identifier from approved connector configuration, authenticated destination or deployment identity, tenant-isolation domain, and credential scope.
I would maintain three separate keys:
- Endpoint health: a protected connector identity and a shared upstream failure domain. Do not mix independent accounts or regions unless they genuinely share a dependency.
- Operation health: endpoint key plus versioned tool identity and, if necessary, a backend route identity.
- Request identity: authenticated workflow run, operation attempt, source version, and idempotency reference where applicable.
The distinction is operationally useful. A broken image-rights lookup should not block catalog reads on another MCP server. A transport outage at the image-rights endpoint, however, should prevent its different tools from each paying a full timeout in turn.
Health keys have a governance cost. A free-form key containing a tenant ID or URL can explode metrics cardinality and leak sensitive routing information. Keep the full key in a restricted state store; export a bounded connector class and failure category as telemetry dimensions.
Deadline admission must happen before each attempt
A per-call timeout is useful only within a larger allowance. If the user-facing workflow has 12 seconds left, starting a tool with a configured 30-second timeout does not create 30 seconds of useful budget.
For each operation, I would compute the permitted wait as the minimum of the operation's maximum, the remaining run time, and any allocated stage budget. Reject the call if that duration cannot satisfy the operation's minimum viable execution threshold, or if its dependency gate is already open.
The following TypeScript function creates a dispatch decision without doing any network I/O:
~~~typescript type Health = "closed" | "open" | "probe"; type Importance = "required" | "optional";
type OperationPolicy = Readonly<{ endpointKey: string; toolKey: string; importance: Importance; maxAttemptMs: number; minimumUsefulMs: number; readOnly: boolean; }>;
type Status = Readonly<{ endpoint: Health; operation: Health; // Probe permits must be assigned by a trusted, atomic lease service. hasProbePermit: boolean; }>;
type Decision = | Readonly<{ kind: "call"; attemptMs: number }> | Readonly<{ kind: "hold"; reason: string; required: boolean }>;
export function planAttempt( policy: OperationPolicy, health: Status, nowMs: number, runDeadlineMs: number, ): Decision { const required = policy.importance === "required"; const hold = (reason: string): Decision => ({ kind: "hold", reason, required });
if (!policy.endpointKey || !policy.toolKey || !Number.isSafeInteger(nowMs) || !Number.isSafeInteger(runDeadlineMs) || !Number.isSafeInteger(policy.maxAttemptMs) || !Number.isSafeInteger(policy.minimumUsefulMs) || policy.minimumUsefulMs <= 0 || policy.maxAttemptMs < policy.minimumUsefulMs) { return hold("invalid-dispatch-policy"); }
if (health.endpoint === "open") { return hold("endpoint-unavailable"); } if (health.operation === "open") { return hold("operation-unavailable"); } if ((health.endpoint === "probe" || health.operation === "probe") && !health.hasProbePermit) { return hold("recovery-probe-in-use"); }
const remaining = runDeadlineMs - nowMs; const attemptMs = Math.min(remaining, policy.maxAttemptMs); if (attemptMs < policy.minimumUsefulMs) { return hold("insufficient-run-budget"); } return { kind: "call", attemptMs }; } ~~~
This is a pure policy sketch. Health and the probe permit must originate from a trusted, concurrency-safe health manager, not from the agent. The readOnly field exists to support a later retry/effect policy; this function does not authorize or execute the operation. In a production wrapper, require an authenticated principal, exact approved tool version, and an additional check that the run is still active.
The caller should propagate the bounded deadline to the MCP transport, for example through a supported request signal or transport timeout in its SDK. Check the version actually deployed: the MCP TypeScript SDK migration guide says cancelling a modern Streamable HTTP call closes that request's response stream, whereas older transports may send a cancellation notification.
Cancellation is not proof of remote rollback. The server might have already completed a write before the client stopped waiting. The MCP PHP SDK transport documentation also warns that some blocking HTTP implementations cannot interrupt I/O promptly and that closing a response does not guarantee server-side work has stopped. Set underlying network and read timeouts, and test the actual transport rather than assuming that a promise timeout frees all connections.
The result classifier must inspect the protocol and the business contract
HTTP status does not tell the whole story. The client may receive a valid JSON-RPC response indicating a complete tool result that has isError=true, or an input-required result needing another protocol round trip. Neither is equivalent to a successful domain answer.
I would classify outcomes before updating breaker health:
| Outcome | Suggested health treatment | Agent-facing consequence |
|---|---|---|
| Transport connection or read deadline failed | Endpoint failure evidence when transport-wide; otherwise operation-specific | Dependency temporarily unavailable |
| Tool returns a documented transient upstream error | Operation failure evidence | Bounded recovery or unavailable |
| Tool reports invalid input or forbidden access | Not a dependency-health failure | Correct request or deny, without blind retry |
| Input required for a valid continuation | Not a completed call and not automatically a failure | Follow a supported authenticated input flow |
| Output violates the pinned schema | Tool contract violation; quarantine result and alert | Do not use data as verified evidence |
| Successful empty result | Ordinary completion if permitted by domain schema | Return “no records,” not “tool unavailable” |
| Local timeout after a potentially consequential write | Unknown side-effect outcome | Reconcile with destination before retry |
The adapter must validate the tool's versioned schema and trusted error taxonomy. A server can return isError=true for a business-level validation error; treating all such responses as signs of a sick dependency would incorrectly trip the circuit. Conversely, a forged successful result is not trustworthy simply because it arrived on HTTP 200.
This classification complements validating MCP schemas across model providers: schema acceptance and service availability are related but independent release contracts.
Recovery is an ownership protocol, not a timer
A basic circuit breaker has closed, open, and half-open states. Microsoft's Circuit Breaker pattern documents how limited half-open probes prevent a recovering dependency from being flooded.
Multi-replica agents add another requirement: if ten workers notice the cooldown expired, they must not all assume they own the one permitted probe. The health store needs an atomic lease or compare-and-swap ownership operation. A stale probe must not reset the breaker after a new failure epoch has opened it again.
Below is a Python state-transition example for a single endpoint or operation health record. It models a probe generation and rejects stale completions, while leaving the actual atomic compare-and-swap implementation to a real datastore.
~~~python from dataclasses import dataclass, replace from typing import Literal
State = Literal["closed", "open", "probe"]
@dataclass(frozen=True) class Health: state: State generation: int consecutive_failures: int opened_at_ms: int | None probe_owner: str | None = None
@dataclass(frozen=True) class Probe: owner: str generation: int
def admit_probe( health: Health, now_ms: int, cooldown_ms: int, owner: str, ) -> tuple[Health, Probe | None]: if not owner or cooldown_ms <= 0: raise ValueError("invalid probe policy") if health.state != "open" or health.opened_at_ms is None: return health, None if now_ms - health.opened_at_ms < cooldown_ms: return health, None
# Must be committed with a conditional write: # only one contender may transition this generation. updated = replace( health, state="probe", generation=health.generation + 1, probe_owner=owner, ) return updated, Probe(owner, updated.generation)
def complete_probe( health: Health, probe: Probe, success: bool, now_ms: int, ) -> Health: if (health.state != "probe" or health.probe_owner != probe.owner or health.generation != probe.generation): return health # Ignore late or superseded completion.
if success: return Health( "closed", health.generation + 1, 0, None, ) return Health( "open", health.generation + 1, health.consecutive_failures + 1, now_ms, )
initial = Health("open", 4, 3, 1_000) next_state, permit = admit_probe(initial, 22_000, 20_000, "w1") assert permit is not None and next_state.state == "probe" recovered = complete_probe(next_state, permit, True, 23_000) assert recovered.state == "closed" assert complete_probe(recovered, permit, False, 24_000) == recovered ~~~
The code does not implement concurrent state mutation, failure windows, retry policy, or request dispatch. In production, claim ownership and update the generation in one atomic transaction, expire abandoned probe leases under an explicit recovery policy, and fence old callbacks. Without that storage contract, two workers could still both execute the code and acquire apparent ownership.
Do not put every tenant in one breaker simply because they share a display URL. Conversely, a globally unavailable upstream may justify shared health across tenant cells if the evidence comes from a genuinely common failure domain. Define that grouping from routing and operational topology, not model text.
Retry is a separate budget and a separate danger
The AWS Builders' Library guidance on timeouts and retries explains why retries can amplify overload and why a timeout does not prove a side effect did not happen.
I would permit retries only when all of the following hold: the operation's outcome semantics permit replay; the failure class is transient; the endpoint and operation gates allow admission; enough run time remains; and the combined SDK, application, and workflow retry budgets have not been spent.
An SDK may already retry transport failures. Adding two retries in the application and additional retries in the agent planner can multiply the number of upstream attempts. Prefer a single owner for retry decisions and audit the SDK defaults before enabling another layer. Use provider hints or bounded exponential backoff with jitter where appropriate, never retry invalid-argument or permission-denied indefinitely.
For any state-changing tool, a timed-out response means outcome unknown until an authoritative reconciliation check establishes what occurred. Reusing a request key or business idempotency identity can reduce duplicate effects if the destination supports it, but does not retroactively make the first outcome known. See agent side-effect idempotency.
The long-running case belongs in a different contract. If a valid tool operation takes minutes and needs progress or later retrieval, use a supported durable task protocol or application-managed job handle rather than silently raising every synchronous call's timeout. See durable MCP Tasks.
Fail the *feature* that needed the tool, not the entire assistant
A dependency failure has two parts: transport availability and what the current user task requires. I would let the workflow contract decide whether to continue with a partial result.
For the catalog assistant:
- If the optional translation tool fails, continue with the previously approved language and mark generated translations unavailable.
- If image-rights verification fails, preserve the draft as incomplete; do not claim the image is licensed or invoke publication.
- If the product attribute source returns no record, distinguish a verified not-found from an unavailable service.
- If a safe alternate data source exists, require a documented equivalence and authorization policy before switching; “another tool has a similar name” is insufficient.
This is a key difference from model-provider failover. A stronger model cannot manufacture a missing legal or inventory fact. A circuit breaker should make a truthful degraded path possible; it must not let the model promote absence of evidence into evidence of safety.
An agent that can publish a draft still needs its own authorization and approval gate. The outage controller cannot override it.
Measure the boundary, not only average response time
The operational question is not simply “is the MCP server up?” It is: how much of the user's workflow budget is lost in one fault domain, and does the system tell the truth when that dependency cannot respond?
I would measure these separately:
| Measurement | What it shows |
|---|---|
| Operation latency by trusted connector class | Which tool class is consuming time |
| End-to-end turn deadline exceedance | Whether call-level bounds actually protect the workflow |
| Endpoint opens and operation opens | Whether a common transport fault or one tool is impaired |
| Half-open claim contention and stale completions | Whether recovery is fenced correctly |
| Required-evidence incomplete outcomes | User-visible correctness impact |
| Optional-feature degraded outcomes | Whether safe partial operation works |
| Timeouts with uncertain side effects | Unresolved safety/reconciliation work |
| Client cancellation vs confirmed server stop | Whether abort signals free real capacity |
| Retry attempt distribution by layer | Detect compounded SDK and planner retries |
| Probe success and subsequent relapse | Whether cooldown policies are too optimistic |
OpenTelemetry's RPC semantic conventions describe client spans covering a logical RPC and its retries; instrumentation should also make individual attempts observable where useful. Pin the conventions to the instrumented release, because some RPC attributes have release-candidate or development status.
Do not put raw tenant IDs, full tool arguments, access tokens, or sensitive endpoint addresses in ordinary metric labels. Keep detailed correlation IDs and protected routing identities in restricted traces. The telemetry export boundary applies to error reporting, too.
Treat a missing measurement as unknown, not as “no error.” A broken health reporter can make a bad dependency look healthy if the release controller assumes every absent span is a success.
Inject failures at two different layers
Before exposing this architecture to customer traffic, I would use a controlled MCP test server and a test transport that can independently simulate:
- One tool returns an application error while sibling tools at the same endpoint keep working.
- Every operation at the endpoint fails connection establishment.
- A tool returns HTTP 200 with
isError=true; the classifier does not mark it a successful business result. - A malformed or incompatible result fails output validation without being treated as a model hallucination.
- A legitimate input-required response pauses rather than trips the breaker.
- Several replicas request the same recovery probe; only one receives the durable permit.
- A stale probe completes after a new failure epoch; its success does not close the newer circuit.
- Client cancellation returns promptly while the server continues a write; the business outcome remains unknown until reconciled.
- Sequential tool calls each stay below their individual timeout but exhaust the workflow deadline.
- A required rights check is unavailable; the agent cannot publish an unverified item.
- An optional translation service fails; the user receives the allowed incomplete result with transparent status.
- Retry configuration differs across SDK, broker, and agent; tests catch unexpectedly multiplied attempts.
Run the same tests against the actual supported MCP transport and SDK revision in staging. A pure breaker unit test is useful, but it cannot establish that an HTTP client's cancellation signal actually interrupts blocking reads.
Measure the health of unaffected tools during the fault, too. A successful resilience experiment should show that an unrelated connector remains usable, not just that the failing one returns an error faster.
Roll out the smallest dependable version
I would first put a trusted, versioned deadline policy in the tool broker. Then implement transport-aware result classification and a single-source retry budget. Next add endpoint and operation health keys, with bounded shared recovery probes only where multiple replicas need a common view. Finally, connect the degraded result contract to the user-facing workflow.
For a single low-volume read-only MCP connector, per-call timeouts and clear error messages may be enough. A shared state store for every health transition can cost more than it protects. But when a multi-tenant agent fleet fans out across many independent tool services, failing to distinguish the endpoint, operation, and user task creates its own unnecessary outages.
The design objective is simple: one unhealthy dependency should consume a bounded portion of the workflow, and no unavailable dependency should cause the assistant to invent an authoritative result.
Primary technical references
- MCP: 2026-07-28 tool discovery, calls, and result semantics
- MCP TypeScript SDK: request cancellation across protocol eras
- MCP PHP SDK: transport cancellation and blocking-I/O limitations
- Microsoft: Circuit Breaker pattern
- AWS Builders' Library: Timeouts, retries, and backoff
- OpenTelemetry: RPC span semantics
Topic provenance: Viral Ruparel's November 2, 2026 article on slow MCP tool dependencies motivated this independent technical analysis. The product-catalog scenario, three-level fault-domain model, broker decisions, recovery fencing design, examples, diagrams, and failure-injection plan were developed separately. The proposed behavior is not presented as a benchmark or an observation from a deployed application.
KEEP READING
Related engineering notes
A Failover Route Is Not a Recovery Path: Proving Independence in AI Infrastructure
Two LLM providers can share the same failure domain. Build an evidence-backed recovery graph that checks cloud, networking, identity, control-plane and capacity dependencies before admitting fallback routes, then test correlated outages without weakening safety.
Read articleAn Eval Platform Sunset Can Erase Your Release Evidence: Build an Evidence-Escrow Migration Gate
When a hosted LLM evaluation platform retires, switching runners is not enough. Preserve the historical evidence, reconstruct grader semantics, validate scoring parity, and enforce a fail-closed release gate that survives the service shutdown.
Read articleWhen the Package Runs Before Your App: Quarantining AI Framework Releases
The 2026 agent-framework PyPI compromise exposed a blind spot in AI build pipelines: Python startup hooks execute before application imports. Design an artifact-quarantine gate, inspect wheels without installing them, separate credentials, and recover from suspected exposure.
Read article