Snapback

io.github.ra1labsworkx-wqPublished by GitHub account ra1labsworkx-wqv1.8.4Updated Oct 24, 2026

Diagnose why an AI agent failed and get the verified fix instantly. Free, no token.

VerifiedStreamable HTTPWeb executableDeveloper ToolsSecurity & MonitoringAI & ML

Overview

AI-generated overview

Snapback is a hosted MCP server that diagnoses why an AI agent run failed and returns a structured verdict with a suggested fix.

What you can do
Diagnose failures: diagnose a single trace, a batch of up to 20, or a cryptic infrastructure error, and fetch a stored verdict by id or trace id. Get pre-run guidance: list known failure patterns for a setup, find the true root of a cascade of errors, and get retry, failover or stop advice. Watch a live run: open a session, report steps, detect repeated tool-call loops and check token, cost, context and step budgets. Learn from history: see this agent's recurring failure classes and anonymized outcomes other agents had for a failure class. Manage the feedback loop: rate verdicts, report fix outcomes, request new patterns, check request status, usage and impact. Convert raw logs into a trace,
When to use it
Useful when you run AI agents and want a fast, structured explanation of failures, mid-run warnings about loops or budget overruns, and routing advice for flaky providers. It fits post-run analysis of many failed traces as well as pre-run checks against known pitfalls.
Requirements
A remote Streamable HTTP endpoint; nothing to run locally. Most tools are described as free and need no token, while diagnosis, verdict, feedback and usage tools are metered and need a starter token or x402 payment. The README's optional interceptor is a Python file configured with the SNAPBACK_MCP environment variable.
Before you install
Some tools are metered and can incur spend, and a batch is billed like separate diagnoses; check usage before heavy use. Feedback ratings and pattern requests update a shared, anonymized pattern library, and outcome reports feed shared telemetry. The optional interceptor can apply fixes and retry automatically, though it is documented to escalate mutate or destructive fixes.

Installation

In SourceWeft

  1. Open Snapback in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.ra1labsworkx-wq%2Fsnapback/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "snapback": {
      "type": "http",
      "url": "https://api.snapback.sh/mcp"
    }
  }
}

README

Snapback self-heal interceptor for OpenClaw

mcp-name: io.github.ra1labsworkx-wq/snapback

Make Snapback automatic. Instead of remembering to call the diagnosis tool, wrap your agent's tool calls once — and every error is auto-diagnosed, and gated-safe fixes are applied and retried without a human.

"Power tools are optional. Infrastructure is not." This turns Snapback from a tool you reach for into infrastructure that runs on every failure.

Connect the MCP server

Snapback is a hosted remote MCP server — nothing to run locally. Add it to any MCP client (Claude Code, Cursor, Cline, VS Code, Windsurf). Most tools are free and need no token.

json
{  "mcpServers": {    "snapback": {      "url": "https://api.snapback.sh/mcp"    }  }}

Endpoint: https://api.snapback.sh/mcp (Streamable HTTP, JSON-RPC 2.0). Then call tools/list (23 tools) and try diagnose_infra_error with {"error": "dns nxdomain servfail"} → family: dns-tls + a verified fix.

Tools

Free (no token): diagnose_infra_error, detect_loop, budget_guard, search_docs, what_others_did, recommend_failover, cascade_root, suggest_budget_recovery, convert_trace, preflight, session_start, session_step, session_end, discovery.

Metered (free starter token or x402): diagnose_trace, diagnose_batch, get_verdict, submit_feedback, report_outcome, request_pattern, my_usage, my_impact, agent_memory.

  • diagnose_infra_error — a cryptic infra error → its family + the verified fix (library-first, ~150ms, no LLM on a hit). 46 families.
  • detect_loop — catch a repeating tool-call loop mid-run before the step limit.
  • budget_guard — catch token / step / context / cost overruns mid-run.
  • what_others_did — anonymized cross-agent outcomes for a failure class.
  • diagnose_trace — full multi-step trace diagnosis (metered).

What it does

On any tool-call error, the interceptor:

  1. Calls diagnose_infra_error (free, no token, no LLM, <150ms).
  2. Applies the three-factor gate — auto-apply a fix only when all are true:
    • confidence >= 0.85
    • source == "library" (a curated verified fix, not an LLM guess)
    • auto_safe == true (the fix is retry / refetch / config — reversible, side-effect-free)
  3. If the gate passes → applies the fix and retries once. If it fails → escalates to a human (logs the verdict). It never auto-applies a mutate or destructive fix (create/change state, money, auth grants).

It fails closed: when unsure, it escalates rather than acting.

Install

bash
# no install needed beyond the stdlib; drop the file in, or:cp snapback_interceptor.py your_agent/export SNAPBACK_MCP=https://api.snapback.sh/mcp   # default; the free tools need no token

Use

python
from snapback_interceptor import SnapbackInterceptor
heal = SnapbackInterceptor(    auto_apply=True,    on_escalate=lambda v: my_ops_inbox.log(v),   # human sees non-auto-safe verdicts    on_heal=lambda v: metrics.count("snapback.autoheal", family=v["family"]),)
# wrap any call that might raise:result = heal.run(call_solana_rpc, wallet, amount)
# or as a decorator:@heal.guarddef call_solana_rpc(wallet, amount): ...
# or manually on a caught error:verdict = heal.diagnose("BlockhashNotFound")if verdict["gate"]["auto_apply_ok"]:    ...apply verdict["fix"] and retry...

The gate contract (returned by Snapback)

diagnose_infra_error returns {matched, family, fix, confidence, source, action_class, auto_safe, gate}. action_class is one of:

classmeaningauto-safe?
retryre-run with backoff (idempotent)✅
refetchre-fetch/re-price/re-sync then re-apply✅
configclient-side param change (raise max_tokens, serve intermediate cert)✅ (to suggest)
mutatecreates/changes external state, money, auth❌ escalate
destructivedeletes/reverts/irreversible❌ never

Defense in depth (1.8.3): even a reversible-class fix is down-graded to escalate if its text contains a destructive command (delete a pod, flush keys, drop a table). The gate returns gate.contains_destructive_step, so a fix can never auto-run a state-destroying step regardless of its action_class.

gate.auto_apply_ok is the ready-made verdict; the interceptor also re-derives it locally so a stale client can't over-trust.

Privacy & safety

  • 100% client-side. Talks only to the free public diagnose_infra_error endpoint.
  • Never sends your Snapback token for the diagnosis (diagnosis is free).
  • Snapback scrubs trace content server-side; this sends only the error string you pass.
  • Composes with bridge.py (post-mortem forwarding) — this is the live auto-heal layer.

Roadmap

  • submit_feedback on the retry outcome (did the fix work?) → feeds the shared library (the network effect).
  • Hermes + LangChain adapters (same gate, different framework hook).

Source: README.md at commit 18fcc9d

Tools

23

diagnose_trace

Diagnose Trace

Diagnose why an AI agent run failed. Returns a structured verdict (failure_class, failed_at_step, root_cause, fix_suggestion, confidence). LATENCY: known patterns return library-instant (<1s); a NOVEL failure needs an LLM call and can take up to ~25s — set your client timeout to at least 30s, and treat this as async (don't block your agent loop on it).

Parameterstracerequired

diagnose_batch

Diagnose Batch

Diagnose SEVERAL traces in one call (up to 20). Each trace is metered like a separate diagnose_trace. Returns a verdicts array (per-trace, order preserved); a bad trace in the batch is isolated and doesn't fail the rest. Use for post-run analysis of many failures at once instead of N round-trips.

Parameterstracesrequired

get_verdict

Get Verdict

Fetch a previously produced verdict by its id or by trace_id (your org only).

Parameterstrace_idverdict_id

preflight

Preflight

BEFORE running: get known failure patterns for a given agent setup so you can avoid them. Returns a ranked list of {failure_class, root_cause, fix_suggestion} from Snapback's library. Call this before executing a plan and self-correct.

Parameterstagslimitagent_stack

submit_feedback

Submit Feedback

Tell Snapback whether a verdict was correct (correct=true/false), with an optional free-text note (did the fix work? what was wrong?). ONE rating per verdict — call it AFTER you act on a verdict and see the outcome. Your correction updates the SHARED pattern library (fix patterns are shared anonymized so every agent benefits; your trace content is never shared) — a right verdict comes back faster next time, a wrong one gets down-weighted. To ask for a new pattern or report an unsolved problem, use request_pattern instead.

Parametersnotecorrectrequiredverdict_idrequired

get_request_status

Get Request Status

Check what happened to a pattern you requested (from request_pattern's request_id). Returns pending / approved / rejected / in_library so you can see if your suggestion was actioned — the feedback loop isn't a black box. Free, no token.

Parametersrequest_idrequired

my_usage

My Usage

See YOUR current usage + remaining allowance so you can self-govern spend: snapbacks (diagnoses) used/cap/remaining, guard checks used/cap/remaining, estimated spend, % used, and when it resets. Call it periodically to avoid surprises. Token-scoped, free.

Takes no parameters.

my_impact

My Impact

See how your feedback + pattern requests have shaped the shared library — how many verdicts you've rated, patterns you've requested, and how many were approved into the library. Turns your input into visible collaboration. Token-scoped to you.

Takes no parameters.

what_others_did

What Others Did

THE CROWD: for a failure_class (or pass the family/error and we'll map it), see what OTHER agents did about the same failure and whether it worked — anonymized, aggregated across everyone. Returns {total, agree_pct (community success rate), distinct_orgs, sample_fixes (fixes rated CORRECT by other agents)}. Use it when you hit a failure and want the crowd's verdict on what actually fixes it, not just the single library answer. Free, no token. Privacy-safe: only aggregate counts + a community success rate + the working fixes — never any org, agent, or trace identity. Hidden below a small min-sample so a single report can't be reverse-engineered. This is the network effect: the more agents use Snapback, the sharper this answer gets.

Parameterserrorfailure_class

report_outcome

Report Outcome

Report the outcome of an auto-applied fix (the self-heal interceptor calls this after it gate-applied a fix and retried). Pass failure_class, family, fix, confidence, action_class, and succeeded (did the retry work?). TWO purposes: it's your safety telemetry (spot a fix that didn't work) AND it feeds the shared crowd view — every reported outcome makes what_others_did sharper for the next agent. Token-scoped (so we know it's your org), free.

Parametersfixfamilyfix_idsucceededrequiredconfidenceaction_classfailure_classrequired

recommend_failover

Recommend Failover

Should you RETRY the same target, SWITCH provider, FALL BACK to another chain, or STOP? Pass the error + your configured topology (current_chain, available_chains, and/or current_provider, available_providers) and get deterministic routing advice with the reason — so a flaky Solana RPC doesn't get retried 5x when you should switch to Base. Free, no token, no LLM. Reads only what you tell it (no network calls).

Parameterserrorrequiredcurrent_chainavailable_chainscurrent_provideravailable_providers

cascade_root

Cascade Root

Given an ORDERED list of errors from a run (oldest first), find the TRUE root — the error that cascaded or shouldn't have been retried — not just the final symptom you see. E.g. a 429 that got retried and triggered a downstream 401: the root is the 429, not the 401. Each error can be a string or {error, retried, action}. Free, no token, no LLM.

Parameterserrorsrequired

suggest_budget_recovery

Suggest Budget Recovery

Approaching a token/context/cost budget mid-run? Pass your counters and get the LEAST-DISRUPTIVE recovery ranked: truncate context | switch to a cheaper model | batch steps | wrap up — scored by speed gained, accuracy lost, cost saved. Turns budget_guard's 'you're at 94%' into 'here's what to do about it'. Free, no token, no LLM.

Parameterstokens_usedcontext_usedtoken_budgetcost_used_usdcontext_windowrecent_actionscost_budget_usd

request_pattern

Request Pattern

Leave us a message: ask us to add a failure pattern to the library, or report a problem we couldn't diagnose well. Use this when diagnose_trace didn't have a good answer, when you keep hitting a failure we don't classify, or when you want a specific kind of problem supported. It goes straight to our roadmap/backlog. Free — no token needed.

Parameterskindcontextmessagerequiredverdict_id

detect_loop

Detect Loop

MID-RUN loop check (fast, no LLM, free). Send your recent steps DURING a run; get back whether you're stuck repeating a tool call and a concrete next move. Call this every few steps to catch a loop BEFORE you burn your step budget — don't wait for a postmortem. Non-blocking advice, not a verdict.

Parametersstepsrequiredthreshold

session_start

Session Start

Open a LIVE mid-run session so Snapback can watch your run step-by-step and warn you in real time (loop / token / cost / context) - the always-on guardian mode. Returns a session_id. Free, no token. Call session_step as you run, session_end when done.

Parametersagent_id

session_step

Session Step

Report ONE step of a live run and get back any warnings immediately (loop detected / budget breach). Pass the step (action + inputs) and any counters you have (step, max_steps, tokens_used, token_budget, cost_used_usd, cost_budget_usd, context_used, context_window, task, recent_actions. context_window). Warnings are advisory - act on them to self-correct mid-run. Free.

Parameterssteprequiredcounterssession_idrequiredloop_threshold

session_end

Session End

Close a live session and get a short run summary (total steps, duration). Frees the session. Free, no token.

Parameterssession_idrequired

agent_memory

Agent Memory

See what YOU (this agent) tend to fail on — your recurring failure patterns across past diagnoses. Returns your top failure classes with counts and what share of your failures each is (e.g. 'loop_repeated_tool_call: 12 times, 40%'). Call it before a run to know what to guard against. Token-scoped to your own agent. Free.

Parameterslimit

budget_guard

Budget Guard

Live MID-RUN budget check (fast, no LLM). Send whatever counters you have and get an advisory on context %, token burn, cost burn, step budget, and off-task drift - with concrete suggested_actions and the projected cost of NOT acting. Call it every few steps to catch a runaway BEFORE you hit a limit. Advisory only (never blocks). Params: step, max_steps, tokens_used, token_budget, cost_used_usd, cost_budget_usd, context_used, context_window.

Parameterssteptaskformatmax_stepstokens_usedcontext_usedtoken_budgetcost_used_usdcontext_windowrecent_actionscost_budget_usd

convert_trace

Convert Trace

Turn your raw logs into a Snapback trace so you don't hand-craft JSON. Pass 'source' = a list of log/step entries, or an object with a spans/steps/messages/events/logs array (OTel spans, OpenAI/LangChain message lists, or generic {tool,input,output} arrays all work). Returns {trace} ready to pass straight to diagnose_trace. Free, no token.

Parametershintsourcerequired

search_docs

Search Docs

Search Snapback's documentation for how to use it — how to format a trace, what each tool does, the failure taxonomy, auth, pricing, and errors. Free and needs no token. Call this first if you're unsure how to format a request or what a verdict means.

Parameterslimitqueryrequired

diagnose_infra_error

Diagnose Infra Error

Diagnose a cryptic AGENT-INFRASTRUCTURE error — payments (x402/EIP-3009), Solana on-chain (ATA, blockhash, compute), MCP protocol, RPC/providers, EVM & Solana wallets, library of VERIFIED fixes the base model often gets wrong. Pass the error text (and optional context). Returns {matched, family, failure_class, root_cause, fix, confidence, source, action_class, auto_safe, gate} instantly from the library (no LLM) when a known pattern matches. Free and no token. GATE CONTRACT for autonomous action: auto-apply the fix ONLY when confidence>=0.85 AND source=='library' AND auto_safe==true (action_class is retry|refetch|config); NEVER auto-apply a 'mutate' or 'destructive' fix (create/change state, money, auth) — escalate those to a human. gate.auto_apply_ok gives you the verdict. Use it the moment you hit a transaction_simulation_failed, BlockhashNotFound, a -32xxx RPC code, a 4001/-32002 wallet error, an attestation failure, or any infra error you can't instantly resolve.

Parameterserrorrequiredactionformatcontext

Version history

4
  1. v1.8.4LatestOct 2, 2026
  2. v1.8.3Oct 1, 2026
  3. v1.8.2Sep 22, 2026
  4. v1.7.0Sep 21, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.