overwrite_cell_source
To completely rewrite a notebook cell's code, replace its source and receive a diff of the modifications.
Instructions
Replace the entire source of a cell in the currently activated notebook. Returns a diff showing the changes made.
Use this when rewriting a cell completely. For small, targeted changes,
prefer edit_cell_source instead — it is safer for partial edits.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": {
"cell_index": "<cell_index>",
"cell_source": "<cell_source>"
},
"name": "overwrite_cell_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cell_index | Yes | Index of the cell to overwrite (0-based) | |
| cell_source | Yes | New complete cell source |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Success message with diff showing changes made |