Skip to main content
Glama

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
fileNo
secretsNo
sessionNo
timeoutNo
plot_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does meaningful work: kernel-state persistence across calls, secrets injected as env vars whose values are never returned, and the .ipynb side-effect of writing '<name>_output.ipynb'. It omits blocking/error behavior and whether execution can modify or destroy runtime state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose and persistence trait, then walks parameters in a scannable line-per-parameter structure with no filler. Slightly dense but every line carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is rightly omitted, and the description covers execution modes, secrets, plotting, and timeouts. The undocumented `session` parameter and the timeout default discrepancy keep it from being fully complete for a 6-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it documents 5 of 6 parameters (code, file, secrets, plot_path, timeout) with semantics the bare schema lacks. The `session` parameter is never explained, and the stated timeout CLI default (30) conflicts with the schema default (120).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Run Python on the runtime") and highlights the key scope trait (variables persist between calls in the same kernel). It names the colab_notebook_* family as the alternative for cell-by-cell work, though it does not disambiguate from the similarly-named sibling colab_run.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit mutual-exclusion rule ("Give `code` or `file`, not both") and routes notebook-per-cell users to colab_notebook_* tools. It stops short of stating when to prefer this over colab_run or colab_install, so the routing is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.