Skip to main content
Glama

Approve a book preview

approve_preview
Idempotent

Approves the preview pages of a storybook or comic that get_job shows as waiting_for_approval (show preview_images to the person first), which draws the rest of the book. Uses the remaining pages of the book (storybook 1 per page, comic 2 per page); spend_limit must cover estimated_cost or nothing starts (limit_exceeded). To stop instead, use cancel_book. A book that is not waiting at its preview (a coloring or puzzle book never has one) is refused with not_ready, its status, retryable (true while it is still drawing towards its preview: poll get_job and approve once it waits; false when it never will, as for a coloring or puzzle book, a book started without a preview, or a finished or cancelled one) and next_actions. Next: get_job.

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": {
      "job_id": "<job_id>",
      "spend_limit": "<spend_limit>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "approve_preview"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesThe book’s job_id from create_book or list_active_jobs (job_book_…).
spend_limitYesThe most pages of balance this call may use. The call is refused (limit_exceeded) when the estimate is higher.
idempotency_keyYesA unique label for this request (e.g. a UUID, 8-120 characters). Reuse it, with the same arguments, to retry safely: a repeat never does the work twice and returns the first call’s result as it was then (its text says Replayed, and the result’s _meta has colorcraft/replayed: true and colorcraft/first_called_at, the first call’s time), not the current state; read that with get_job. The same key with different arguments is refused with idempotency_conflict (a different request needs a new idempotency_key), and so is a repeat after a first call that failed part-way (its message says what to check before a new key); while the first call is still running, a repeat answers busy with retry_after_seconds. A key is remembered per tool and per account: the same key sent to a different tool is a separate request, never a replay of or a conflict with the other tool’s.

Output Schema

NameRequiredDescriptionDefault
job_idYes
approvedYes
next_actionsYes
estimated_costYesPages of balance the rest of the book will use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say it is a non-read-only, non-destructive, idempotent call; the description adds far more: it burns remaining pages (1/page storybook, 2/page comic), it is atomic on cost ('spend_limit must cover estimated_cost or nothing starts'), and it documents the not_ready refusal with status, retryable semantics and next_actions. That retryable distinction (true while still drawing vs false for coloring/puzzle/finished/cancelled books) is exactly the operational context annotations cannot carry.

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?

Front-loaded with the happy path and precondition before the error semantics, and the parentheticals are dense with real information rather than filler. The error clause runs long and packs several conditions into one sentence, which costs some scannability but no sentence is wasted.

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 mutating, cost-bearing approval call, the description covers prerequisites, the pages/balance consequence, failure modes with retryability, and the follow-up tool. Return values need no explanation because an output schema exists, so nothing an agent needs before calling is missing.

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

Parameters3/5

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

Schema coverage is 100% and the schema already explains all three parameters in detail, including limit_exceeded for spend_limit and the full replay/conflict behavior of idempotency_key. The description restates the spend_limit refusal and adds the useful framing that the limit is measured in pages of remaining book, but adds little else parameter-specific. Baseline 3 applies when the schema does the heavy lifting.

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?

States a specific verb and resource ('Approves the preview pages of a storybook or comic') plus the exact precondition that selects it ('that get_job shows as waiting_for_approval') and the effect ('draws the rest of the book'). An agent can distinguish it from cancel_book and get_job without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (only when the job is waiting at its preview, and only after showing preview_images to the person), an explicit alternative for the opposite intent ('To stop instead, use cancel_book'), and an explicit next step ('Next: get_job'). It even tells the agent what to do when the call is premature: poll get_job and retry.

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.

Resources