ashlr

ashlr__notebook_edit

Edit one Jupyter notebook cell and return it with nearby cells.

ashlr__notebook_edit edits one cell in a Jupyter notebook (.ipynb) and returns the edited cell with its neighbors. Unrelated cells are elided.

Parameters

ParameterTypeRequiredDescription
notebookPathstringyesAbsolute or working-directory-relative path to the notebook, within an allowed project root.
cellIndexintegeryesZero-based index of an existing cell.
newSourcestringyesNew source content for the cell.
cellTypestringnocode or markdown; omitted preserves the existing type.

Cell outputs are preserved unless cellType is set to markdown, which removes outputs and execution count. Invalid arguments and failed edits return MCP tool errors. For plain text files, use ashlr__edit.

On this page