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 分