Snapback

io.github.ra1labsworkx-wq由 GitHub 帳號 ra1labsworkx-wq 發布v1.8.4更新於 Oct 24, 2026

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

已驗證Streamable HTTP可網頁執行開發者工具安全與監控AI 與機器學習

概覽

AI 產生的概覽

Snapback 是託管型 MCP 伺服器,用來診斷 AI 代理執行失敗的原因,並回傳附有修復建議的結構化結論。

可以做什麼
診斷故障:診斷單一 trace、最多 20 筆的批次 trace 或晦澀的基礎設施錯誤,並依 id 或 trace id 取回既有結論。執行前指引:列出某套設定的已知失敗模式,找出錯誤串聯中的真正根因,並給出重試、切換或停止的建議。監看即時執行:開啟工作階段、回報步驟、偵測重複的工具呼叫迴圈,並檢查 token、成本、上下文與步驟預算。參考歷史:查看此代理反覆出現的失敗類別,以及其他代理對某類失敗的匿名化處理結果。管理回饋循環:評價結論、回報修復結果、請求新增模式,並查看請求狀態、用量與影響。把原始日誌轉換成 trace,並檢索文件。
適用情境
適合執行 AI 代理、希望快速取得結構化失敗說明、執行中迴圈或預算超支警示,以及不穩定服務商路由建議的情境。可用於事後批次分析失敗 trace,也可在執行前對照已知陷阱做檢查。
執行需求
遠端 Streamable HTTP 端點,不需在本機執行。多數工具據稱免費且不需權杖;診斷、結論、回饋與用量類工具按量計費,需要入門權杖或 x402 付款。README 中可選的攔截器是一個 Python 檔案,透過 SNAPBACK_MCP 環境變數設定。
安裝前請注意
部分工具按量計費,可能產生費用,批次呼叫會以多次診斷計費,大量使用前請先查看用量。回饋評分與模式請求會更新共享的匿名化模式庫,結果回報也會進入共享遙測。可選攔截器能自動套用修復並重試,但文件稱對 mutate 或 destructive 類修復會升級給人工處理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Snapback,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.ra1labsworkx-wq%2Fsnapback/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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).

來源:README.md,提交 18fcc9d

工具

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).

輸入參數trace必填

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.

輸入參數traces必填

get_verdict

Get Verdict

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

輸入參數trace_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.

輸入參數tagslimitagent_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.

輸入參數notecorrect必填verdict_id必填

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.

輸入參數request_id必填

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.

無需輸入參數。

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.

無需輸入參數。

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.

輸入參數errorfailure_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.

輸入參數fixfamilyfix_idsucceeded必填confidenceaction_classfailure_class必填

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).

輸入參數error必填current_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.

輸入參數errors必填

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.

輸入參數tokens_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.

輸入參數kindcontextmessage必填verdict_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.

輸入參數steps必填threshold

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.

輸入參數agent_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.

輸入參數step必填counterssession_id必填loop_threshold

session_end

Session End

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

輸入參數session_id必填

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.

輸入參數limit

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.

輸入參數steptaskformatmax_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.

輸入參數hintsource必填

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.

輸入參數limitquery必填

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.

輸入參數error必填actionformatcontext

版本歷史

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

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。