insert_cells
Insert multiple notebook cells contiguously before a specified index with atomic validation. Returns new indices and revision for synchronization.
Instructions
Insert several cells at once, contiguously BEFORE index (0-based).
Prefer this over many insert_cell calls when adding a block of cells: one
round-trip, no index bookkeeping between inserts. cells is a list of
objects {cell_type, source, summary?} inserted in order (index == cell count
appends). The batch is atomic: all items are validated first, and if any is
invalid nothing is written and the offending items are named — fix those and
resend. Optionally pass expected_rev to guard against concurrent external
edits. Returns {"indices": [...], "ids": [...], "rev": ...}.
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": {
"path": "<path>",
"index": "<index>",
"cells": "<cells>"
},
"name": "insert_cells"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| cells | Yes | ||
| index | Yes | ||
| expected_rev | No |