42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
# 工具列表 API
|
||
|
||
该接口用于让 API 调用方获知服务端“工具分类”与“每个分类下的工具名称”。
|
||
|
||
鉴权:需要 `Authorization: Bearer <TOKEN>`
|
||
|
||
---
|
||
|
||
## GET `/api/v1/tools`
|
||
|
||
成功响应(200):
|
||
|
||
```json
|
||
{
|
||
"success": true,
|
||
"categories": [
|
||
{
|
||
"id": "network",
|
||
"label": "网络检索",
|
||
"default_enabled": true,
|
||
"silent_when_disabled": false,
|
||
"tools": ["web_search", "extract_webpage", "save_webpage"]
|
||
},
|
||
{
|
||
"id": "terminal_command",
|
||
"label": "终端指令",
|
||
"default_enabled": true,
|
||
"silent_when_disabled": false,
|
||
"tools": ["run_command", "run_python"]
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
字段说明:
|
||
|
||
- `categories[].id`:工具分类 id(服务端内部标识)
|
||
- `categories[].label`:分类展示名
|
||
- `categories[].tools`:该分类下具体工具名称列表(用于前端渲染/筛选/白名单提示)
|
||
- `default_enabled/silent_when_disabled`:用于 UI/策略展示(并不等于“你一定能调用到该工具”,真实可用性仍取决于服务端策略与运行时环境)
|
||
|