← All posts
Fix

Cryptic error from an agent tool call? Map it to a root cause and fix in one call

For developers and autonomous AI agents · ~6 min read

An agent hits a tool error like "unable to get local issuer certificate" or a bare 410 or a Kafka CommitFailedException, and the model does the confident-but-wrong thing: it retries, or re-authenticates, or blames itself — when the real fix was something else entirely. These errors are cryptic on purpose, and the base model's first guess is often the trap.

Why the base model gets these wrong

The hardest infrastructure errors are the ones that look like a different problem. The surface text points one way; the correct fix points another:

410 Gone
Looks like auth. Actually means the sync token is dead — do a FULL re-sync, don't re-authenticate.
unable to get local issuer certificate
Looks like a missing root CA. Actually an incomplete served chain — serve the intermediate cert.
Kafka CommitFailedException
Looks retryable. Actually you were rebalanced — don't retry the commit, or you silently duplicate.
Amadeus 34651
Looks transient. Actually availability changed between search and book — re-price, don't retry the stale offer.

Retrying the wrong diagnosis doesn't just fail — for some of these (an unauthorized ACH return, a rebalanced queue commit) a blind retry actively makes it worse. The model needs the real cause, not its first guess.

Map any cryptic error to its fix — free

diagnose_infra_error takes the error string and returns the matching family, the root cause, and the verified fix — instantly, with no token and no LLM. It covers 46 families across payments, banking, on-chain, protocol, infra, messaging, data, enterprise, travel, and auth — the errors chosen precisely because the base model tends to misdiagnose them:

diagnose_infra_error({error: "unable to get local issuer certificate"})
// → { family: "dns-tls", root_cause: "incomplete served chain, not a missing root",
//      fix: "serve the intermediate certificate in the chain", confidence }

diagnose_infra_error({error: "CommitFailedException poll interval"})
// → { family: "message-queue", fix: "don't retry the commit — you were rebalanced; reduce max.poll.records" }

It's deterministic and free, so an agent can call it the moment it hits an error it can't instantly solve — and self-correct with the right fix instead of looping on the wrong one. Miss? It says so, and you fall back to diagnose_trace for a full LLM diagnosis.

Wire it into the loop

The pattern for a self-healing agent: on any cryptic tool error, call diagnose_infra_error first (free, instant). If it matches, apply the fix and retry correctly. If it misses, escalate to diagnose_trace. Either way the agent acts on the real cause — which is the whole point of catching these before a wrong retry compounds the problem.

Browse the full coverage in the failure encyclopedia, or the machine-readable family list in /llms.txt.

For AI agents

Machine-readable guide: https://snapback.sh/llms.txt · Tool discovery: https://snapback.sh/.well-known/mcp.json · MCP endpoint: https://api.snapback.sh/mcp. Free tools need no token; pay-per-call diagnosis via x402 on Solana or EVM (~$0.0032 USDC).

Try Snapback freeRead the docs