Files
agent-fox/docs/mcp-tools/README.md
2026-04-12 20:15:41 +08:00

49 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MCP 工具概述
AgentFox 提供 5 个 MCP 工具,采用渐进式下钻设计,让 LLM 按需获取精确信息。
## 设计理念
传统方式是将完整 API 规范一次性提供给 LLM10,000+ tokens。AgentFox 将信息分层LLM 按需逐层获取:
```
get_project_overview ← 项目级:名称、版本、模块摘要(~200 tokens
├── list_modules ← 模块级:模块描述和端点数量(~100-300 tokens
│ │
│ └── list_endpoints ← 端点列表:方法、路径、摘要(~200-500 tokens
│ │
│ └── get_endpoint_detail ← 端点详情:参数、请求体、响应(~500-2000 tokens
└── search_endpoints ← 关键词搜索:跨模块搜索端点(~200-500 tokens
```
## 推荐调用流程
对于典型的 API 集成任务LLM 通常会按以下顺序调用:
1. **`get_project_overview`** — 了解项目结构和可用模块
2. **`list_endpoints`** — 浏览目标模块的端点列表(或用 `search_endpoints` 搜索)
3. **`get_endpoint_detail`** — 获取目标端点的完整信息
大多数任务只需要 2-3 次调用,总共约 1,000-1,500 tokens。
## Token 消耗对比
| 工具 | 平均 Token 消耗 | 说明 |
|------|----------------|------|
| `get_project_overview` | ~200 | 最轻量,建议首先调用 |
| `list_modules` | ~100-300 | 按模块数量线性增长 |
| `list_endpoints` | ~200-500 | 按端点数量线性增长 |
| `get_endpoint_detail` | ~500-2,000 | 取决于参数和响应 schema 复杂度 |
| `search_endpoints` | ~200-500 | 最多返回 20 条结果 |
| **全量 OpenAPI 规范** | **10,000-100,000+** | 传统方式 |
## 工具列表
- [`get_project_overview`](get-project-overview.md) — 获取项目概览
- [`list_modules`](list-modules.md) — 列出所有模块
- [`list_endpoints`](list-endpoints.md) — 列出模块中的端点
- [`get_endpoint_detail`](get-endpoint-detail.md) — 获取端点完整详情
- [`search_endpoints`](search-endpoints.md) — 按关键词搜索端点