cell_execute
Execute a code cell in a Jupyter notebook and retrieve its output. Kernel state persists across executions, maintaining variables and imports.
Instructions
Execute a specific code cell and return its output. The kernel state persists between executions (variables, imports, etc. remain in memory). Only code cells can be executed. Outputs are saved back to the .ipynb file.
python_path controls which Python interpreter runs the kernel:
"" or omitted: uses the server's own Python (sys.executable) the first time; subsequent calls reuse the already-running kernel regardless.
Absolute path: e.g. "/home/user/myproject/.venv/bin/python"
Name on PATH: e.g. "python3.11" Only takes effect when a new kernel is being started (no kernel running yet). Use kernel_restart to switch an already-running kernel to a different Python.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| cell_id | Yes | ||
| timeout | No | ||
| python_path | No |