apifacts

io.github.Illouminus由 GitHub 帳號 Illouminus 發布v0.2.1更新於 Oct 27, 2026

Verified facts and typed fixes for failing third-party API calls (Stripe, GitHub, Google…)

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

提供一個 check 工具,在第三方 API 呼叫失敗時回傳經查證、附日期的行為事實與具型別的修正建議。

可以做什麼
  • 查詢失敗的第三方 API 呼叫:送出目標、方法、狀態碼與回應內容片段,取得相符的已查證事實與具型別的修正。
  • 查看排程探測對已登錄端點範本的觀測結果,無相符項目時給出未知原因。
  • 使用隨套件附帶的快照離線作答,不送出任何內容。
  • 掃描日誌中由 requests、httpx、gh、axios 或 curl -f 印出的失敗 HTTP 呼叫並逐一查詢。
適用情境
適合在助理排查 Stripe、GitHub、Google 等第三方 API 錯誤、而官方文件無法解釋實際行為時使用;也適合 CI 建置因 HTTP 呼叫失敗時快速呈現已知陷阱。
執行需求
以 Python 套件形式透過 uvx 在本機以 stdio 執行(apifacts 加上 mcp 附加元件),需要 Python 與 uv。未宣告任何驗證、環境變數或標頭。線上查詢需能連線至 apifacts.dev 介面;離線模式不需網路。
安裝前請注意
線上 check 請求會被視為貢獻:若目標符合已登錄範本,會儲存一筆正規化觀測,但不含回應內容、標頭、查詢字串與原始 IP。送出的錯誤回應片段會傳送至 apifacts.dev 服務。離線模式不傳送任何內容。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

apifacts

A verified changelog of reality for AI agents. An open registry of typed, dated facts about what third-party machine interfaces (HTTP APIs, SDK packages, CLIs) actually do today, as opposed to what their docs say.

Why

Interfaces change, docs lag, and nobody tells the agent. Every session pays tokens to rediscover the same traps: a 200 with an empty array instead of a 429, a rate limit reported as status: 0 in the body, an SDK release that silently dropped a field. Documentation tools answer "give me the right docs"; apifacts answers "the docs are wrong about this endpoint right now, here is the verified difference".

Install

bash
pip install apifacts-pytest   # pytest plugin: a test failing on an HTTP error prints the known factsuvx apifacts check https://api.stripe.com/v1/charges -X GET --status 401   # CLI (and library)npx skills add Illouminus/apifacts   # agent skill: on an API error, ask the registry first

Both packages are on PyPI, carry the same version and ship together from one tag (release). The plugin sends nothing until a test fails. The skill (skills/apifacts/SKILL.md) tells Claude Code and other agents when to call apifacts check and how to read the answer.

CI

Agents that fix a red build read the failing step's log, the annotations and the job summary. The GitHub Action puts the known facts in all three (action/README.md):

yaml
- uses: Illouminus/apifacts/action@v0  with:    run: pytest -q   # same exit code as without the action; scanned only when it fails

Anywhere else, pipe a log through apifacts scan (uvx apifacts scan build.log): it finds the failed HTTP calls that requests, httpx, gh, axios and curl -f print, and asks about each.

MCP

One tool, check(target, method, status, body), over stdio; no resources, no prompts. Claude Code:

bash
claude mcp add apifacts -- uvx --from 'apifacts[mcp]' apifacts mcp

Claude Desktop, Cursor and other clients (mcpServers in their JSON config):

json
{"mcpServers": {"apifacts": {"command": "uvx", "args": ["--from", "apifacts[mcp]", "apifacts", "mcp"]}}}

apifacts mcp --offline answers from the snapshot packaged in the wheel and sends nothing.

How a fact is verified

  • One fact per YAML file in facts/<service>/, with a kind (error_meaning, rate_limit, breaking_change, ...), the exact error signal, a one-sentence claim, dimensions (env, plan, region, account_state) and evidence.
  • Truth comes only from deterministic probes: declarative HTTP steps and assertions that our runner executes on a schedule. No language model is called anywhere in the verification path.
  • Fixes are data, not advice: members of a closed vocabulary with typed parameters (no free text, no shell, no foreign URLs), rendered to one English sentence by us.
  • A probe in another environment never refutes a fact; it adds a dimension.

Calling check()

One endpoint answers and learns at the same time: the request is the contribution. Send the target and, optionally, the error you got; receive matching facts with typed fixes and what the probes observe. If the target matches a registered template, a normalized observation is stored (no bodies, headers, query strings or raw IPs).

bash
curl -s https://apifacts.dev/v0/check \  -H 'Content-Type: application/json' \  -d '{"target": {"method": "POST", "url": "https://api.stripe.com/v1/payment_intents"},       "error": {"status": 400, "body_excerpt": "Keys for idempotent requests can only be used with the same parameters they were first used with."}}'

The response is never empty: facts, observed, and an unknown.reason when nothing matches.

Status

The API is live at https://apifacts.dev (/v0/check, /v0/services, /openapi.json, /healthz; facts.baillot.dev, the old address, redirects there). The registry covers the services and facts listed at apifacts.dev/registry, each fact page showing how it was established; /llms.txt describes the API for agents. Design contracts live in docs/specs/.

Running your own copy: the API reads facts/ and services/ once, at startup, so after a git pull restart it; ops/deploy.sh checks out, syncs and restarts in one step.

Contributing

Calling check() is contributing. Pull requests are for humans and API producers: see CONTRIBUTING.md. Producer signatures are always free.

License

Code: MIT. Data (facts/ and the generated fact pages): CC BY 4.0.

來源:README.md,提交 98e9701

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

1
  1. v0.2.1最新Oct 26, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分