{
 "openapi": "3.1.0",
 "info": {
  "title": "TRAE石锱 · 三度空间 公开接口",
  "version": "1.3.0",
  "summary": "面向外部 AI 的只读检索与分诊接口：查厂商公开样本原文（带文件名与页码）、读资料库实况（段数/份数/字数，机采）、按工况分诊资料板块、查项目线索存档、提交交流留言。",
  "description": "所有工具共用单一入口 POST /api/v1/mcp/invoke。请求体 {\"tool_name\": 工具名, \"arguments\": {...}}，响应体 {\"ok\": true, \"tool\": 工具名, \"result\": {...}}。公开只读，无需密钥；按 IP 与工具分档限流，每小时：search_tech 150、site_stats 120、get_site_index 120、query_opportunities 60、route_inquiry 40、submit_cooperation 10，单 IP 合计 600 次。报数字前先调 site_stats，不引用快照；引用纪律：转述任何参数必须带文件名+页码，库内没有的不得推算。",
  "contact": {
   "name": "TRAE石锱 · 三度空间",
   "url": "https://shizi-ai.com.cn/"
  },
  "license": {
   "name": "对外可引用，须标注出处（文件名+页码）"
  }
 },
 "servers": [
  {
   "url": "http://192.144.182.89",
   "description": "当前可用入口（域名备案审核中，先用这个）"
  },
  {
   "url": "https://shizi-ai.com.cn",
   "description": "正式门牌，备案通过后启用，路径与入参不变"
  }
 ],
 "paths": {
  "/api/v1/mcp/invoke": {
   "post": {
    "operationId": "invokeTool",
    "summary": "调用任一工具（统一入口）",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvokeRequest"
       },
       "example": {
        "tool_name": "search_tech",
        "arguments": {
         "query": "注液车间 露点",
         "k": 3
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "调用成功（业务层未命中时 ok=true 且 result.found=0）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InvokeResponse"
        }
       }
      }
     },
     "400": {
      "description": "tool_name 缺失或参数不合法"
     },
     "429": {
      "description": "触发限流，请退避重试"
     }
    },
    "x-citation-rule": "引用 search_tech 结果时必须写明 file 与 page，禁止改写成「行业通常」"
   }
  },
  "/.well-known/mcp.json": {
   "get": {
    "operationId": "getToolManifest",
    "summary": "工具清单（6 个工具的入参 schema，MCP 标准 inputSchema）",
    "responses": {
     "200": {
      "description": "OK"
     }
    }
   }
  },
  "/llms.txt": {
   "get": {
    "operationId": "getLlmsIndex",
    "summary": "AI 分层索引（子文件路由）",
    "responses": {
     "200": {
      "description": "OK"
     }
    }
   }
  },
  "/llms-full.txt": {
   "get": {
    "operationId": "getLlmsFull",
    "summary": "全文口径（身份/八将/工具/铁律/FAQ 一次读完）",
    "responses": {
     "200": {
      "description": "OK"
     }
    }
   }
  },
  "/.well-known/agent-card.json": {
   "get": {
    "operationId": "getAgentCard",
    "summary": "Agent 身份卡（A2A 互认）",
    "responses": {
     "200": {
      "description": "OK"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "InvokeRequest": {
    "type": "object",
    "required": [
     "tool_name"
    ],
    "properties": {
     "tool_name": {
      "type": "string",
      "enum": [
       "search_tech",
       "site_stats",
       "route_inquiry",
       "query_opportunities",
       "get_site_index",
       "submit_cooperation"
      ]
     },
     "arguments": {
      "type": "object",
      "description": "各工具入参见 /.well-known/mcp.json"
     }
    }
   },
   "InvokeResponse": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "tool": {
      "type": "string"
     },
     "result": {
      "type": "object",
      "description": "search_tech 返回 {found, hits:[{series, file, page, score, text}]}；site_stats 返回 {chunks, files, series, chars, chars_wan, built, db_bytes, db_mtime, by_series:[{series, chunks}], calls:{total, by_tool}, checked_at, how}；route_inquiry 返回 {agent, agent_name, market, reason, hits, office, survey, pit, card}；query_opportunities 返回 {count, items}；get_site_index 返回 {site, resources, tracks}；submit_cooperation 返回 {reference, accepted}"
     }
    }
   }
  }
 }
}