yapi_interface_add
Add new API interfaces to YAPI documentation by specifying path, method, parameters, and response details for automated API management.
Instructions
新增接口
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": {
"catid": "<catid>",
"title": "<title>",
"path": "<path>",
"method": "<method>"
},
"name": "yapi_interface_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | YAPI 接口页面 URL(可选),如 https://yapi.xxx.com/project/1009/interface/api/108375,会自动解析出项目 ID、接口 ID 等参数 | |
| project | No | 项目 ID(可选,不传则使用默认项目) | |
| catid | Yes | 接口分类 ID | |
| title | Yes | 接口名称 | |
| path | Yes | 接口路径,如:/api/user | |
| method | Yes | 请求方法,如:GET、POST、PUT、DELETE | |
| desc | No | 接口描述(可选) | |
| status | No | 接口状态:done(已完成)、undone(未完成) | |
| req_params | No | 路径参数 | |
| req_query | No | 查询参数 | |
| req_headers | No | 请求头 | |
| req_body_type | No | 请求体类型:form、json、file、raw | |
| req_body_form | No | 表单类型的请求体 | |
| req_body_other | No | 其他类型的请求体(JSON 字符串) | |
| res_body_type | No | 返回数据类型:json、raw | |
| res_body | No | 返回数据(JSON 字符串) |