generate_api_code
Generate frontend API request code from YApi interface definitions. Specify path, method, query and path parameters to produce TypeScript axios or fetch calls with mock data.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "generate_api_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 接口路径 | |
| title | No | 接口标题 | |
| method | No | 请求方法,默认GET | |
| reqQuery | No | 查询参数数组 | |
| reqParams | No | 路径参数数组 | |
| requestLib | No | 请求库类型: axios | fetch,默认axios | |
| interfaceName | No | 接口类型名称 |