colab_exec
Execute Python code or .py/.ipynb files in a Google Colab runtime; variables persist between calls.
Instructions
Run Python on the runtime; variables persist between calls (same kernel). Give code (text) or file (local .py/.ipynb inside the working directory), not both.
A .ipynb file runs the whole notebook and the CLI writes 'output.ipynb' beside it; for cell-by-cell work use the colab_notebook* tools.
secrets: NAMES of variables from the user's secrets file (e.g. ["OPENROUTER_API_KEY"]); they become environment variables in the kernel and their values are never returned.
plot_path: local path (inside the working directory) where a displayed image is saved.
timeout: seconds (the CLI default is 30).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "colab_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| file | No | ||
| secrets | No | ||
| session | No | ||
| timeout | No | ||
| plot_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |