Skip to main content
Glama

Cancel a book

cancel_book
DestructiveIdempotent

Stops a book that is drawing or paused at its preview, for good. Pages already drawn, and what they cost, stay in the project. A book stopped while drawing can still finish the few pages it was drawing and charge for them (more_may_be_charged), so cost_charged is the charge so far; get_job on the job_id shows the final one. It can’t be undone or retried afterwards (plan a new book instead). A book that had already drawn every page, or was already cancelled, is left as it is: cancelled is false and nothing changes. A partial or failed book is marked cancelled (its pages stay), so it can no longer be retried. Free.

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>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "cancel_book"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesThe book’s job_id from create_book or list_active_jobs (job_book_…).
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
statusYes
messageYes
cancelledYesTrue when this call stopped the book (or marked a partial or failed one cancelled); false when it had already drawn every page or was already cancelled (nothing changed).
project_idYes
cost_chargedYesPages of balance charged so far. Final unless more_may_be_charged.
more_may_be_chargedYesTrue when the pages the book was drawing can still finish and be charged (a few at most): this call stopped it while drawing, or it was already cancelled within the last 15 minutes while drawing (not paused at its preview, nor a partial or failed book that had already stopped). get_job shows the final cost_charged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: pages and their cost persist, a book still drawing may keep finishing and charging (more_may_be_charged), and no-op cases return cancelled false with nothing changed. The irreversibility and the partial/failed-book marking are exactly the context destructiveHint alone cannot convey, though it does not mention permission or account-level constraints.

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

Conciseness5/5

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

Front-loads the core action and outcome in the first sentence, then layers the cost, irreversibility, and no-op cases in descending importance. Every clause carries information (the trailing "Free." answers an obvious cost question), with no filler or repetition of annotations.

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?

Covers the full decision surface for a destructive, idempotent mutation: what is destroyed, what persists, what the charge means, what the response flags indicate, and what to do instead. An output schema exists, so the brief references to cancelled and cost_charged are bonus nuance rather than a gap.

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 a point by telling the agent what job_id is for after the call ("get_job on the job_id shows the final one"). Idempotency_key semantics are left entirely to the schema, which is acceptable because that field's schema description is unusually thorough.

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 plus its precondition ("Stops a book that is drawing or paused at its preview, for good"), and implicitly separates itself from retry_book by saying a cancelled book "can no longer be retried" and that a new book must be planned instead. An agent can distinguish it from get_job and retry_book 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 Guidelines4/5

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

Gives clear contextual guidance: use get_job on the job_id to see the final charge, and "plan a new book instead" once a book is cancelled. It also warns of the irreversible consequence for partial or failed books, which functions as a when-not-to-use caution, though it never explicitly names retry_book as the alternative for a failed book.

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