Cancel a book
cancel_bookStops 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
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The book’s job_id from create_book or list_active_jobs (job_book_…). | |
| idempotency_key | Yes | A 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
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| status | Yes | ||
| message | Yes | ||
| cancelled | Yes | True 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_id | Yes | ||
| cost_charged | Yes | Pages of balance charged so far. Final unless more_may_be_charged. | |
| more_may_be_charged | Yes | True 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. |