kernel_restart
Restart a notebook kernel to clear in-memory state like variables and imports while preserving saved cell outputs. Optionally switch to a different Python interpreter on restart.
Instructions
Restart the kernel for a notebook. Clears all in-memory state (variables, imports, etc.). Cell outputs saved to the .ipynb file are not affected.
python_path: optionally switch to a different Python interpreter on restart.
"" or omitted: keep using the same Python the kernel was started with.
Absolute path: e.g. "/home/user/project/.venv/bin/python"
Name on PATH: e.g. "python3.11" If python_path differs from the current kernel's Python, the kernel is fully replaced rather than just restarted in-place.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| python_path | No |