Tools · Files and code

notebook_edit

Changes things

Read, 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 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

NameTypeDescription
path*stringNotebook path
action*string—listreadeditadddeleteclear_outputs
indexintegerCell index (list shows them)
sourcestringNew cell source (edit/add)
cell_typestringCell type for `add` (default code)codemarkdown

* required

Read, search and edit the project; run commands, code and git.