Call Cap
call_capCall a Cap on the user's behalf and return its response. Use this when you cannot make the HTTP call yourself: qumge charges the user's qumge balance and forwards the call at the same price as calling it over HTTP through Qumge. Operations and prices come from get_cap. Prefer operation + input: when the operation declares an input_schema, input is validated against it before anything is charged or forwarded. For metered Caps, call quote_cap first and pass its quote_id together with a stable idempotency_key; the order is reserved at the quoted amount. Asynchronous calls return a platform job_id and get_cap_job reads cached progress and the final receipt for free. Needs the user's qumge key in the Authorization header. A 5xx from the Cap is free; a 402 means the user's balance or this Cap's monthly limit stopped it. (Older clients may still call this tool as call_app — it still works.)
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": {
"slug": "<slug>"
},
"name": "call_cap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Request body. An object is sent as JSON; a string is sent as-is. | |
| path | No | The route path from get_cap, e.g. '/api/videos'. A query string may be appended or passed separately in `query`. | |
| slug | Yes | The Cap's slug, from search_caps. | |
| input | No | Arguments for the operation. Validated against its input_schema when it has one — an invalid input is refused as a tool error (isError), and nothing is charged or forwarded. | |
| query | No | Query string without the leading '?'. | |
| accept | No | Optional Accept header. | |
| method | No | HTTP method. Default GET — the routes and their methods are in get_cap. | |
| quote_id | No | Accepted quote from quote_cap. Required for metered Caps: the order is reserved at the quoted amount. The same quote can create only one order. | |
| operation | No | Operation name from get_cap (a route's `name`). Use with `input`; takes precedence over `path`/`method` when both are given. | |
| qumge_key | No | Optional: your Qumge API key, for clients that cannot set an Authorization header. Takes precedence over the header. Never echoed back. | |
| content_type | No | Only needed when `body` is a string and the app expects a specific type. | |
| idempotency_key | No | Stable key for retries of the same operation and input. Replays the original managed order; changed input is rejected. Required with quote_id. | |
| accepted_contract_digest | No | For a changed deliverable contract, pass the current get_cap contract_state.contract_digest only after confirming its deliverables, price and buyer spending authority. Do not silently reuse old permission. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||