Skip to main content
Glama

Retry missing pages

retry_book
Idempotent

Draws only the missing or failed pages of a finished book that get_job shows as partial or failed, keeping every page already drawn (it never redraws or deletes pages). Uses 1 page of balance per missing page (2 for a comic page, 1 per missing puzzle); spend_limit must cover estimated_cost. A book in any other state (drawing, paused at its preview, complete, cancelled) is refused with not_ready, its status, retryable (true only while it is still drawing: poll get_job, then retry if it ends partial or failed) and next_actions; a cancelled book can’t be retried, nor a puzzle book whose run was stopped (refused with not_ready too: get_job offers it plan_book). 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": "retry_book"
  }
}

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
retryingYes
next_actionsYes
pages_to_drawYes
estimated_costYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, so the safety profile is partly covered; the description adds real cost behavior beyond them — 1 balance page per missing page, 2 per comic page, 1 per puzzle, and that spend_limit must cover estimated_cost or the call is refused with limit_exceeded. It also discloses the refusal payload shape and the special-case prohibition on retrying cancelled books and stopped puzzle runs. Minor gap: it does not restate the busy/retry_after_seconds behavior, though the schema covers that for idempotency.

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 core action and its scope, then cost, then refusal semantics, then the next step — a sensible order with no filler sentences. It is dense and the middle clause about not_ready is packed with several ideas in one long sentence, which slightly hurts scanability.

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 mutation tool with a fixed 3-parameter contract, the description covers cost model, state preconditions, refusal codes, and the follow-up call; the output schema exists so return values need not be restated. The idempotency contract is fully specified in the schema, so nothing an agent needs is missing.

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, but the description earns above baseline by explaining what spend_limit actually measures (pages of balance, with per-page costs of 1 or 2 depending on page type) and how it relates to estimated_cost. job_id is only implied via get_job, which the schema already documents.

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 with precise scope: it draws 'only the missing or failed pages of a finished book that get_job shows as partial or failed,' and explicitly contrasts with the sibling get_job and with plan_book. The parenthetical 'never redraws or deletes pages' removes the main ambiguity an agent would have about a retry tool.

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 (job status partial or failed per get_job) and when-not (drawing, paused at preview, complete, cancelled are refused), plus the resulting not_ready status, retryable flag, and next_actions. It also names the escape hatch for a stopped puzzle book (get_job offers plan_book) and ends with an explicit 'Next: get_job' step.

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