查询指定 MCP 服务提供的工具名称、描述和入参 schema。
接口
GET /api/v1/mcp/servers/{mcpCode}/tools
返回指定 MCP 服务当前可用的工具列表。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| mcpCode | string | 是 | MCP 编码 |
响应
data 为工具数组,每个工具包含以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| name | string / null | 工具名称 |
| description | string / null | 工具描述 |
| inputSchema | object / null | 工具入参 schema |
| inputSchema.type | string / null | 通常为 object |
| inputSchema.properties | map<string,object> / null | 参数定义 |
| inputSchema.required | array<string> / null | 必填参数名 |
| inputSchema.additionalProperties | boolean / null | 是否允许额外参数 |
示例
错误
| HTTP 状态码 | error_code | 说明 |
|---|---|---|
| 400 | - | 服务未开通、实例异常或工具列表为空,错误码由 MCP 服务返回 |
| 500 | InternalError | 服务内部错误 |
One Key MCP 服务无需提前开通。首次查询工具或调用工具时,服务可能自动完成开通。