Recommends MCP tools based on a natural-language request and returns tool names, descriptions, and input schemas.
Endpoint
GET /api/v1/mcp/servers/tools/recommend
Request parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | Yes | - | Natural-language request. Cannot be blank |
| topN | int | No | 10 | Suggested number of results. Values less than or equal to 0 use the default 10 |
topN is a target count. The actual number of results is not guaranteed to equal it.
Response
data is an array of tools. Each item contains four fields:
| Field | Type | Description |
|---|---|---|
| mcp_code | string | MCP code. Can be used as the mcpCode path parameter |
| tool_name | string | Tool name. Can be used as the tool_name when calling a tool |
| tool_description | string / null | Tool description |
| tool_input_schema | object / null | Tool input schema. The structure is the same as inputSchema in List tools |
Example
Errors
| HTTP status | error_code | Description |
|---|---|---|
| 400 | InvalidParameter | query is missing or blank, or an unsupported query parameter is provided |
| 502 | McpUpstreamError | The downstream MCP operation failed |
A recommendation does not mean the service is activated. Calling a One Key MCP tool may activate the service automatically and incur charges.