# resume_chain: Carry a chain on | AIM Previz

https://aimpreviz.com/developers/reference/resume_chain

[Previz](https://aimpreviz.com/) / [Tool reference](https://aimpreviz.com/developers/reference) / Tool reference · Shoot

# `resume_chain`

Published 4 Nov 2026Updated 5 Nov 2026by the PREVIZ team

Carry a chain on

## What it does

Carry on a chain that stopped or is waiting on a person. A stopped chain's failed step is tried again when its last attempt charged nothing and it has attempts left (3 in all), and the steps behind it follow; a parked step runs once the person has pressed. Everything runs inside the total the chain was quoted at, under the authority it was started with, at the prices and engine policy it was quoted under — a price or policy that has moved stops the step, and replay_job then quotes the chain afresh. Refused for a cancelled chain, one that has ended, and one whose quote is more than 24 hours old. Free to call; steps are billed as they land.

- **Access class** — `spend` · Can spend credits: called without a quoteToken or an idempotencyKey it answers with a quote and runs nothing; called with the quote's token, or with your own idempotency key, it runs once and is charged once. A key whose access its owner has set spends only under a monthly credit cap.
- **Cost** — Free.
- **Project** — Not tied to one project.

A key holds only the access classes its owner gave it, set in Account → API keys → the key's Access: a new key holds read and write, and spend needs a monthly credit cap. tools/list shows only the tools a key holds, and a call to any other is refused with INSUFFICIENT_SCOPE. A key made before access classes existed keeps what it could do then (read, write, spend and live) until its owner sets its access; produce is given, never inherited.

## Price

Free. This tool never spends credits.

## Arguments

- **`jobId`

string · required** — The chain's jobId (run_chain's answer, or list_jobs).
- **`dryRun`

boolean · optional** — true: answer what this call WOULD do — the route its engines would take under the project's policy, its price in every mode, whether it writes — and run nothing: nothing is written, nothing is charged.
- **`idempotencyKey`

string · optional** — Your own id for this change (1–200 printable characters): the same key with the same arguments changes nothing twice and answers the first call's answer; with different arguments it is refused (IDEMPOTENCY_CONFLICT).

Unknown arguments are refused by name rather than ignored, so a misspelling never runs quietly.

## Answer

The fields this tool's answer declares. They arrive as structuredContent, and as the same JSON in the first text block for clients that read text.

- **`jobId`** — The chain's job: get_job reads it on, cancel_job stops it, resume_chain carries it on.
- **`status`** — running | input_required (a person's press is needed before the next step) | landed | stopped | cancelled.
- **`steps`** — Each step: id, tool, status (waiting, running, settling, parked, landed, failed, skipped, cancelled), attempt, creditsQuoted, creditsCharged, its own jobId, and outputs once it landed.
- **`receipt`** — Credits: quoted (the total the chain may cost), billed (what landed steps cost), held (steps running now), unspent (what was quoted and never charged, once the chain has ended).
- **`partial`** — true when the chain ended with a step skipped or failed.
- **`approvalUrl`** — On input_required: the PREVIZ page to hand the person.
- **`approvalId`** — On input_required: the request a person is asked to approve (await_approval waits for the press).
- **`note`** — A sentence for the agent about what the answer means or what to do next.
- **`resumed`** — How many steps were put back to run.

## Behaviour hints

The hints the tool declares to clients, so an agent can decide what needs a person's approval.

- Read-only

  No
- Destructive

  No
- Idempotent

  No
- Reaches outside PREVIZ

  No

## Call it

The JSON-RPC message, then the same call over HTTPS. Placeholders are in capitals.

tools/call

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "resume_chain",
    "arguments": {
      "jobId": "YOUR_JOB_ID"
    }
  }
}
```

curl

```
curl -s https://mcp.aimpreviz.com \
  -H "Authorization: Bearer $PVZ_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"resume_chain","arguments":{"jobId":"YOUR_JOB_ID"}}}'
```

From an agent client you never write this by hand: connect it once ([Claude Code](https://aimpreviz.com/developers/connect/claude-code), [Cursor](https://aimpreviz.com/developers/connect/cursor), [TypeScript or Python](https://aimpreviz.com/developers/connect/http)) and ask for what you want.

## When it fails

What the door answers instead, and what to do next. A refusal never charges.

- **A call from a web page on an origin that is not allowed** — HTTP 403, JSON-RPC error -32003, before the body or the key is read. Call the door from a server, a terminal or a desktop client.
- **A body that is not one JSON-RPC 2.0 message, or a batch** — HTTP 400, JSON-RPC error -32700 (unparseable) or -32600 (invalid or a batch), before the key is read. Send one message per POST with "jsonrpc": "2.0", a method and a string or number id.
- **No key, a malformed key or a revoked key** — HTTP 401 with a WWW-Authenticate challenge, before any method runs, the handshake included. Stop and ask your person for a key; retrying will not help.
- **An MCP-Protocol-Version header naming a version this door does not speak** — HTTP 400, JSON-RPC error -32600, naming the versions it supports. A request with no such header is accepted. Send the protocolVersion that initialize returned, or leave the header off.
- **An unknown method** — JSON-RPC error -32601, "Unknown method" with the method's name. Use initialize, ping, tools/list or tools/call.
- **An unknown tool** — JSON-RPC error -32602, "Unknown tool", naming tools/list. Call tools/list for the tools this door offers.
- **Arguments that do not match the tool's input schema** — Protocol 2025-06-18: JSON-RPC error -32602 with the issues. Protocol 2025-11-25: a tool answer with isError set, naming each issue. Fix the named arguments. Unknown arguments are named, never ignored; confirm sent as the text "true" is refused, never coerced.
- **A tool whose access class the key does not hold** — A tool answer with isError set, beginning INSUFFICIENT_SCOPE, naming the class the tool needs and the classes the key holds. Nothing ran and nothing was charged. Ask the key's owner to add it in Account → API keys → the key's Access; spend needs the key's monthly cap first.
- **A refusal only a person can lift: the person's credits ran out (INSUFFICIENT_CREDITS), a monthly cap is missing or reached, a key lacks an access class, a freeze, or a spending agreement that was revoked, expired or does not cover the call** — The refusal carries actionUrl and actionLabel: the exact PREVIZ page for the person to press on, behind their own sign-in. For an agreement to sign again, the page opens with the old agreement's numbers suggested. A run answered by a job handle (a queued job, a long render) carries the same two fields on its job: get_job, list_jobs and the job's event. Nothing ran and nothing was charged. Hand the person actionUrl as it is. After they act, send the same call again with the same quoteToken or idempotencyKey. Two cases take a new idempotencyKey instead: a key whose first call already ran under an earlier agreement, and a queued job that has ended.
- **A spend sent with your own idempotencyKey by an API key that has neither a monthly credit cap nor a signed spending agreement covering the call** — A tool answer with isError set, beginning CAP_REQUIRED, with actionUrl (the key's cap) and agreementUrl (the signing page). It is answered before anything is written, so the idempotencyKey is not used up. Nothing ran and nothing was charged. Hand the person either page. Once they have set a cap or signed an agreement, send the same call again with the same idempotencyKey.
- **A webhook endpoint whose URL is not https on port 443, carries a user name, or resolves to a private address; or a call for an endpoint this key did not subscribe** — A tool answer with isError set, beginning URL_REFUSED (subscribe_webhook; nothing was subscribed), WEBHOOK_NOT_FOUND, WEBHOOK_INVALID (an unknown event kind) or WEBHOOK_LIMIT (ten endpoints per key). Give a public https URL that answers 2xx itself (a redirect is never followed), name kinds or families from the subscribe_webhook reference, and read list_webhooks for this key's endpoints.
- **A replay that cannot be made exactly: a job whose request is no longer kept, a tool that changed shape, a policy that now leaves it no engine, or stale work that changed since its quote** — A tool answer with isError set, beginning REPLAY_UNAVAILABLE and saying which. Nothing ran and nothing was charged; PREVIZ never runs it on a different engine or from a guess. For replay_stale, call it again for a new plan and quote. For replay_job, call the tool yourself with the arguments you want.
- **A tool that a rule for agents says is never run: the organisation's rule, or the person's own** — A tool answer with isError set, beginning GOVERNANCE_DENIED, naming whose rule it is. The call is refused before its arguments are read: nothing was priced, run or charged. get_governance lists every rule that binds this credential. An owner or admin changes the organisation's rule in PREVIZ; a person changes their own in their account.
- **resume_chain on a chain that cannot carry on: cancelled, ended, past its quote, or stopped on a step that was charged or has used its attempts** — A tool answer with isError set, beginning CHAIN_STATE (or CHAIN_NOT_FOUND for a chain this credential did not start). Nothing ran and nothing was charged. replay_job on the chain's jobId quotes the same chain afresh; get_job reads what the chain already made.

## Related

### Concepts

- [Jobs and events](https://aimpreviz.com/developers/concepts/jobs)

### Also in shoot

- [`generate_frame`](https://aimpreviz.com/developers/reference/generate_frame)
- [`edit_frame`](https://aimpreviz.com/developers/reference/edit_frame)
- [`animate_frame`](https://aimpreviz.com/developers/reference/animate_frame)
- [`check_take`](https://aimpreviz.com/developers/reference/check_take)
- [`estimate_depth`](https://aimpreviz.com/developers/reference/estimate_depth)
- [`decompose_frame`](https://aimpreviz.com/developers/reference/decompose_frame)
- [`inpaint_frame`](https://aimpreviz.com/developers/reference/inpaint_frame)
- [`relight_frame`](https://aimpreviz.com/developers/reference/relight_frame)
- [`split_plate`](https://aimpreviz.com/developers/reference/split_plate)
- [`generate_mesh`](https://aimpreviz.com/developers/reference/generate_mesh)
- [`check_mesh`](https://aimpreviz.com/developers/reference/check_mesh)
- [`start_production`](https://aimpreviz.com/developers/reference/start_production)
- [`say`](https://aimpreviz.com/developers/reference/say)
- [`answer`](https://aimpreviz.com/developers/reference/answer)
- [`decide`](https://aimpreviz.com/developers/reference/decide)
- [`stop`](https://aimpreviz.com/developers/reference/stop)
- [`resume`](https://aimpreviz.com/developers/reference/resume)
- [`get_production`](https://aimpreviz.com/developers/reference/get_production)
- [`list_productions`](https://aimpreviz.com/developers/reference/list_productions)
- [`production_settings`](https://aimpreviz.com/developers/reference/production_settings)
- [`queue_edit`](https://aimpreviz.com/developers/reference/queue_edit)
- [`get_take_frame`](https://aimpreviz.com/developers/reference/get_take_frame)
- [`convert_voice`](https://aimpreviz.com/developers/reference/convert_voice)
- [`speak_line`](https://aimpreviz.com/developers/reference/speak_line)
- [`get_take_audio`](https://aimpreviz.com/developers/reference/get_take_audio)
- [`separate_audio`](https://aimpreviz.com/developers/reference/separate_audio)
- [`generate_sfx`](https://aimpreviz.com/developers/reference/generate_sfx)
- [`generate_music`](https://aimpreviz.com/developers/reference/generate_music)
- [`replay_stale`](https://aimpreviz.com/developers/reference/replay_stale)
- [`replay_job`](https://aimpreviz.com/developers/reference/replay_job)
- [`run_chain`](https://aimpreviz.com/developers/reference/run_chain)
- [`run_template`](https://aimpreviz.com/developers/reference/run_template)

[All tools](https://aimpreviz.com/developers/reference) [Developers home](https://aimpreviz.com/developers) [Mint a key](https://aimpreviz.com/account)
