insert_cell
Insert a new cell before a specified index in a Jupyter notebook, supporting code, markdown, or raw types. Optionally include a summary and prevent overwrites with expected revision.
Instructions
Insert a new cell BEFORE index (index == cell count appends).
cell_type must be one of: code, markdown, raw. Indices are 0-based.
Optionally pass summary: a short description stored in cell metadata that
becomes the cell's summary in list_cells (takes precedence over any leading
# comment). Set it so later list_cells calls stay informative.
Optionally pass expected_rev (from notebook_rev or a prior write) to refuse
the write if the file changed on disk since then. Returns the new rev.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| index | Yes | ||
| source | Yes | ||
| summary | No | ||
| cell_type | Yes | ||
| expected_rev | No |