{
  "name": "AIGG Tools",
  "version": "1.0.0",
  "description": "给 AI 模型/Agent 调用的小工具集：所有接口返回 JSON，开放 CORS，多数无需密钥。",
  "base_url": "https://aigg-tools.pages.dev/api",
  "conventions": {
    "success": {
      "ok": true,
      "tool": "<name>",
      "result": "<object>"
    },
    "failure": {
      "ok": false,
      "tool": "<name>",
      "error": "<message>"
    },
    "http": "参数错误返回 400 + ok:false；上游故障返回 502 + ok:false"
  },
  "tools": [
    {
      "name": "time",
      "method": "GET",
      "path": "/api/time",
      "summary": "获取指定时区的当前日期时间（含 ISO、时间戳、星期）",
      "params": {
        "tz": "IANA 时区，默认 Asia/Shanghai，如 America/New_York"
      }
    },
    {
      "name": "uuid",
      "method": "GET",
      "path": "/api/uuid",
      "summary": "生成随机 UUID v4，可一次生成多个",
      "params": {
        "n": "数量 1-50，默认 1"
      }
    },
    {
      "name": "hash",
      "method": "GET",
      "path": "/api/hash",
      "summary": "计算文本摘要值（sha256/sha1/sha384/sha512），默认 sha256",
      "params": {
        "text": "原文（必填）",
        "algo": "sha256|sha1|sha384|sha512"
      }
    },
    {
      "name": "base64",
      "method": "GET",
      "path": "/api/base64",
      "summary": "Base64 编码/解码，UTF-8 安全",
      "params": {
        "text": "原文（必填）",
        "mode": "encode|decode，默认 encode"
      }
    },
    {
      "name": "json",
      "method": "GET",
      "path": "/api/json",
      "summary": "校验 / 格式化 / 压缩 JSON，返回结构统计",
      "params": {
        "text": "JSON 字符串（必填）",
        "mode": "validate|pretty|minify，默认 validate"
      }
    },
    {
      "name": "math",
      "method": "GET",
      "path": "/api/math",
      "summary": "安全计算算术表达式（不使用 eval），支持 sqrt/abs/min/max/round/floor/ceil/pow 与 pi、e",
      "params": {
        "expr": "表达式（必填），如 (3+4)*2^3/sqrt(16)"
      }
    },
    {
      "name": "text",
      "method": "GET",
      "path": "/api/text",
      "summary": "文本统计与转换：字数/词数/行数、大小写、slug、URL 编解码",
      "params": {
        "text": "原文（必填）",
        "op": "stats|upper|lower|title|slug|urlencode|urldecode，默认 stats"
      }
    },
    {
      "name": "ip",
      "method": "GET",
      "path": "/api/ip",
      "summary": "返回调用方 IP 与网络归属信息（国家/地区/ASN/时区）",
      "params": {}
    },
    {
      "name": "weather",
      "method": "GET",
      "path": "/api/weather",
      "summary": "按经纬度查当前天气（Open-Meteo，免费无 key）",
      "params": {
        "lat": "纬度（必填）",
        "lon": "经度（必填）"
      }
    },
    {
      "name": "fx",
      "method": "GET",
      "path": "/api/fx",
      "summary": "查询实时汇率并换算金额（open.er-api.com，免费无 key）",
      "params": {
        "from": "源币种，默认 USD",
        "to": "目标币种，默认 CNY",
        "amount": "金额，默认 1"
      }
    }
  ]
}