upsert_api_endpoint
Document an endpoint: creates it, or updates the existing one for the same method + path. Use it whenever you add or change a route in the code, so the docs stay true. Only the fields you send change. path may use :id, {id} or {{id}} for variables. folder is created by name if missing. Send version (from get_api_endpoint) to avoid overwriting a teammate's edit; a stale version is rejected.
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": {
"collection_id": "<collection_id>",
"method": "<method>",
"path": "<path>"
},
"name": "upsert_api_endpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Example request body, any JSON, e.g. {"amount": 1000}. null clears it. | |
| kind | No | `event` for a webhook your app sends. | |
| name | No | Short title, e.g. Create a charge. Defaults to METHOD /path. | |
| path | Yes | Route path as written in the code, e.g. /v1/charges/:id or /v1/charges/{id}. | |
| folder | No | Folder name, e.g. Charges. | |
| method | Yes | HTTP method, e.g. POST. For an `event`, the method it is delivered with. | |
| params | No | Documented fields. | |
| headers | No | Request headers to send, e.g. [{"name": "Authorization", "value": "Bearer {{token}}"}]. | |
| version | No | The endpoint's `version` from get_api_endpoint. Omit for a new endpoint. | |
| description | No | What the endpoint does and when to call it. | |
| collection_id | Yes | Id from list_api_collections. |