batch
Run up to 200 ordered board operations in one request as a single undo step, with results reusable by later calls and optional all-or-nothing rollback.
Instructions
Runs several tool calls in ONE request (1 to 200 operations, in order), on one board, as a single undo step in the application. Use it to build or rework a board quickly instead of one call per object. Each operation is {"tool": "add_shape", "args": {...}} with the arguments the tool normally takes (but never path, output or source: the batch-level path applies to all). An operation can reuse what an earlier one returned: a string that is EXACTLY "$N.key" (N = index from 0 of an earlier operation, then keys or list indexes separated by dots, e.g. "$0.id" or "$3.ids.1") is replaced by that value of the result of operation N before the operation runs; text that only contains "$0.id" inside a longer string stays literal, and a text that is exactly like "$3.99" would be taken for a reference. An operation without page acts on the batch-level page (default: the first page), whatever the previous operations did. atomic (default true): at the first error everything already done is undone, the board is unchanged, and the error gives the operation index, its error and the results obtained before the rollback. With atomic: false the batch stops at the first error and keeps what succeeded, answering {applied, failed: {index, error}, results} (not an error). Success answers {results: [one result per operation], applied}. Not allowed inside a batch: batch, create_board, save_board, board_changes, export, render.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page: number (from 1) or name. Defaults to the first. | |
| path | No | Path of the board file (.inkboard; .inkboard.json and .tableau.json also accepted). Optional when the application is open: the tool then acts live on the displayed board (undoable with Ctrl+Z). | |
| atomic | No | All or nothing (default true). false: keep the operations done before the first error. | |
| operations | Yes | Operations to run in order, e.g. [{"tool": "add_shape", "args": {"geom": "rect", "text": "A"}}, {"tool": "add_shape", "args": {"geom": "rect", "text": "B"}}, {"tool": "add_connector", "args": {"from": "$0.id", "to": "$1.id"}}]. |