api_plan
Run a JSON plan: an ordered list of API steps against the AHOOK API, executed server-side in one call. Steps can reference earlier steps' results ($.steps..) and iterate a list (for_each). Each step runs through the real API handler with your identity, so group membership and plan gates apply. GET steps read; POST/PUT/PATCH/DELETE steps write (body is a JSON object, references allowed inside string values). Plans with any write step are atomic by default: every write step must declare a compensate step, and the first failed write stops the plan and runs compensations in reverse order (explicit atomic: false keeps the partial-results semantics instead). PAP callers need api:read for GET steps and api:write for write steps. A failed step does not fail the plan unless it is a write step in an atomic plan — per-step results carry per-step errors.
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": {
"steps": "<steps>"
},
"name": "api_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | Ordered steps, max 10. Each step: { id (unique), method (GET, POST, PUT, PATCH, DELETE), path (may embed {$.steps.<id>.<field>} or {$.item.<field>} references), body (optional JSON object for write steps; references allowed inside string values), select (optional array of dot-separated field paths to keep), for_each (optional { from: "$.steps.<id>.<field>", as: "item" }), compensate (required on write steps in atomic plans: { method, path, body? }) }. | |
| atomic | No | Optional. Default true when the plan contains any write step, false otherwise. Atomic plans require every write step to declare compensate, and roll back (compensate in reverse) on the first failed write step. |