Skip to main content
Glama

api_plan

Destructive

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

NameRequiredDescriptionDefault
stepsYesOrdered 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? }) }.
atomicNoOptional. 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true and non-idempotent, and the description goes well beyond them: default atomicity, mandatory compensation steps, reverse-order rollback on first failed write, per-step error isolation ('A failed step does not fail the plan unless it is a write step in an atomic plan'), identity/permission gates, and hard limits (10 steps, 20 iterations). That is exactly the operational context an agent needs before issuing a destructive multi-step call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence and the rest is dense with non-redundant constraints. A few clauses restate the obvious (that GET reads and POST/PUT/PATCH/DELETE writes), but the description is information-dense rather than padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, nested, multi-step execution tool with no output schema, the description covers execution model, atomicity semantics, failure behavior, result granularity ('per-step results carry per-step errors'), permissions, and size limits. Nothing material is left for the agent to guess.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns more by explaining the interplay between parameters rather than restating them — that write steps must declare compensate when the plan is atomic, that compensations cannot nest, and how $ references resolve (whole-string scalar substitution vs embedded interpolation). It largely mirrors the schema's own field descriptions, which caps it below 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb and resource ('Run a JSON plan: an ordered list of API steps against the AHOOK API') plus the execution model ('executed server-side in one call'). This is unmistakably distinct from siblings like api_describe or the CRUD tools, which operate on single resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear conditional guidance: GET steps read, write steps require compensate in atomic plans, and 'explicit atomic: false keeps the partial-results semantics' tells the agent which mode to choose. It also names the permission prerequisites (api:read vs api:write) that gate usage. It stops short of saying when to prefer this over making the equivalent calls individually or consulting api_describe first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.