ipynb_insert_cell
Add a new cell to an existing Jupyter Notebook at a given index. Specify the notebook path, cell position, content, and cell type (code, markdown, raw) to modify the file programmatically.
Instructions
Insert new cell at specified position in a Jupyter Notebook (.ipynb).
Args: ipynb_filepath: Path to Jupyter Notebook (.ipynb) file (absolute path preferred) cell_index: Position to insert cell (0-based indexing) content: Cell content (provide as raw string, no additional escaping needed) cell_type: Type of cell ('code', 'markdown', 'raw')
Returns: Dict with 'success' and 'new_cell_count' or 'error' key
Note: Indices of cells at or after the insertion point will shift by +1
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| cell_type | No | code | |
| cell_index | Yes | ||
| ipynb_filepath | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||