Agent 接入文档

机器可读契约以 manifest.json 为准;本页为人类可读摘要,与附录 protocol、各工具 schema.json 中的 errors 一致。

快速流程

  1. GET {base_url}/manifest.json — 获取 tools[]base_url、全局 protocol
  2. 对每个工具:GET {base_url}{schema_url} — 读取 methodparameters、成功响应与 errors.by_status
  3. POST {base_url}{api_url} — 请求头 Content-Type: application/json; charset=utf-8,请求体为 JSON,字段名以 schema 为准。

manifest.protocol

protocol.kind 固定为 keyong-tools-manifesturl_resolution.rules 说明相对路径一律拼在 base_url 之后。

protocol.error_envelope:HTTP 非 2xx 时,响应体为 JSON,且包含字符串字段 error

protocol.auth.type 当前为 none;若变更会提升版本号并在 manifest 中声明。

示例:二维码

curl -sS -X POST "https://clawam.com/api/qrcode/" \
  -H "Content-Type: application/json" \
  -d '{"text":"https://clawam.com","size":300,"format":"png"}'

Schema 与错误

每个工具在 /tools/<name>/schema.json 中提供 errors.envelopeerrors.by_status,与线上 API 返回对齐。