notebook_run_cell
Execute a code cell in a Jupyter notebook and retrieve its outputs. Kernel state is preserved across cell executions.
Instructions
Execute a single code cell and return its outputs.
Kernel state (variables, imports) is preserved between calls on the same notebook, so cells can depend on earlier ones.
Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the cell to run. kernel_name: Kernel to use (e.g. 'python3', 'myenv'). Defaults to 'python3'. Run notebook_list_kernels to see options. timeout: Seconds to wait for the cell to finish (default: 60). save_outputs: Write outputs back to the .ipynb file (default: true).
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": {
"notebook_path": "<notebook_path>",
"cell_index": "<cell_index>"
},
"name": "notebook_run_cell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| cell_index | Yes | ||
| kernel_name | No | ||
| save_outputs | No | ||
| notebook_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |