Many writes, one transaction
apply_data_writesApply up to 200 add, update, or move writes in one all-or-nothing transaction instead of one call per row; any failure rolls back the batch.
Instructions
Apply up to 200 writes in ONE transaction — for applying many known rows in one go instead of one call per row. Each command is exactly what you would send to data_add_item / data_update_item / data_move_item, as {type, ...args}: type is add_item | update_item | move_item. Deletion is not one of them: a delete needs its own confirmation, which an all-or-nothing batch cannot give per row, so it goes through data_delete_item. All or nothing: the first failure rolls back everything and names which command failed. The reply is one line per command ({id, seq}) — not the rows, which you already have.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actor | No | ||
| commands | Yes | [{type: "add_item", collection, fields, group?}, {type: "update_item", id, fields}, …] — same arguments as the single-write tools | |
| command_id | Yes | idempotency key — generate a fresh uuid per action |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| eot | No | ||
| seq | No | the batch's last ledger position — pass it to data_changes as `since` | |
| note | No | ||
| count | No | ||
| reason | No | ||
| results | No | ||
| failed_index | No |