edit_cell
Replace a notebook cell's entire source code, targeting by index or stable cell_id, and clears outputs to prevent stale data.
Instructions
Replace a cell's ENTIRE source. For small changes prefer patch_cell.
Target the cell by index (0-based) OR cell_id (stable id from list_cells);
pass exactly one. Prefer cell_id after listing — it doesn't shift when other
cells change, avoiding off-by-one edits to the wrong cell. Editing a code cell
clears its outputs and execution_count (they are stale). Optionally pass
summary to set the cell's metadata summary (omit to keep, "" to clear).
Optionally pass expected_rev to refuse the write if the file changed on disk.
Returns the new rev.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| index | No | ||
| source | Yes | ||
| cell_id | No | ||
| summary | No | ||
| expected_rev | No |