NotebookEdit
A built-in definition supplied to the request when the tools option was omitted.
Captured description
Replaces, inserts, or deletes a single cell in a Jupyter notebook (.ipynb file).
Usage:
- You must use the Read tool on the notebook in this conversation before editing — this tool will fail otherwise.
notebook_pathmust be an absolute path.cell_idis theidattribute shown in the Read tool’s<cell id="...">output. It is required forreplaceanddelete.edit_modedefaults toreplace. Useinsertto add a new cell after the cell with the givencell_id(or at the beginning of the notebook ifcell_idis omitted) —cell_typeis required when inserting. Usedeleteto remove the cell.
Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"notebook_path": {
"description": "The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)",
"type": "string"
},
"cell_id": {
"description": "The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified.",
"type": "string"
},
"new_source": {
"description": "The new source for the cell",
"type": "string"
},
"cell_type": {
"description": "The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required.",
"type": "string",
"enum": [
"code",
"markdown"
]
},
"edit_mode": {
"description": "The type of edit to make (replace, insert, delete). Defaults to replace.",
"type": "string",
"enum": [
"replace",
"insert",
"delete"
]
}
},
"required": [
"notebook_path",
"new_source"
],
"additionalProperties": false
} Independent estimate
~607 tokens
The captured tool object was counted against the common baseline. This value supports comparison and is not additive.