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
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": {
"ipynb_filepath": "<ipynb_filepath>",
"cell_index": "<cell_index>",
"content": "<content>"
},
"name": "ipynb_insert_cell"
}
}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 | |||