Tools · Files and code
notebook_edit
Changes thingsRead, edit, add, or delete cells in a Jupyter notebook (.ipynb).
When to use: Use for .ipynb files instead of edit_file — it edits cells structurally. Always `list` first, then `read` the target cell, then `edit` with the full new source.
Example
Run for real by scripts/tool-examples.py in a small demo project, with Haiku 5.5 where the tool calls a model. The output is exactly what the tool returned.
The call
{
"tool": "notebook_edit",
"arguments": {
"path": "notes.ipynb",
"action": "list"
}
}Real output
notes.ipynb — 2 cells 0 markdown [ ] # Notes 1 code [ ] print(1 + 1)
Parameters
| Name | Type | Description |
|---|---|---|
| path* | string | Notebook path |
| action* | string | —listreadeditadddeleteclear_outputs |
| index | integer | Cell index (list shows them) |
| source | string | New cell source (edit/add) |
| cell_type | string | Cell type for `add` (default code)codemarkdown |
* required
More in Files and code
Read, search and edit the project; run commands, code and git.