Skip to main content
Glama

colab_execute_notebook

Run Python code on Google Colab with GPU/TPU acceleration. Collects generated files (images, CSVs, models) by zipping and downloading them to a local directory.

Instructions

Execute Python code on Colab GPU/TPU and collect generated artifacts.

Runs the code, then scans the runtime for output files (images, CSVs, models, etc.), zips them, and downloads to a local directory. Use this when your code produces files you need to retrieve locally.

After execution:

  • Check artifact_files in the response for collected output filenames.

  • Files are extracted to the specified output_dir.

  • For files larger than 50 MB, use colab_execute with drive_save instead.

Common issues:

  • No artifacts collected: ensure your code writes files to /tmp, /content, or the current working directory.

  • Each artifact file must be under 50 MB (base64 transfer limit).

Args: code: Python code to execute on the Colab runtime. output_dir: Local directory to save the artifacts zip and extracted files. accelerator: Hardware accelerator type. Default: "T4". GPU types: "T4" - NVIDIA Tesla T4 (16 GB, free-tier) "L4" - NVIDIA L4 (24 GB, Colab Pro) "A100" - NVIDIA A100 (40 GB, Colab Pro/Pro+) "H100" - NVIDIA H100 (80 GB, Colab Pro+) "G4" - NVIDIA G4 (Colab Pro+) TPU types: "V5E1" - TPU v5e-1 (Colab Pro+) "V6E1" - TPU v6e-1 (Colab Pro+) high_memory: Enable high-memory runtime (more RAM). Default: False. timeout: Max execution time in seconds (10-3600). Default: 300.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo
output_dirYes
acceleratorNoT4
high_memoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description details what the tool does after execution: scans runtime for artifacts, zips them, and downloads to local directory. It discloses file size limits (50 MB per artifact) and expected artifact locations. Annotations provide no contradictory info, and description adds significant behavioral context beyond them.

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?

The description is well-structured with clear sections (after execution, common issues, args) and is front-loaded with purpose. It is slightly lengthy but every sentence serves a purpose. Could be marginally tightened.

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

Completeness5/5

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

Given the tool's complexity (5 parameters, artifact handling, output schema), the description covers all necessary aspects: what the tool does, how to use it, parameter details, expected outputs, common issues, and even limitations. The existence of an output schema is acknowledged by mentioning response fields.

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

Parameters5/5

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

Despite 0% schema description coverage, the description extensively documents each parameter: code, output_dir, accelerator (with full list of GPU/TPU types and their VRAM/plan), high_memory, and timeout. This adds crucial meaning beyond the bare schema titles.

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

Purpose5/5

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

The description clearly states the tool executes Python code on Colab GPU/TPU and collects generated artifacts. It distinguishes itself from siblings by focusing on artifact retrieval, and includes a usage directive: 'Use this when your code produces files you need to retrieve locally.'

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

Usage Guidelines5/5

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

The description explicitly tells when to use this tool (when producing files) and when not (for files >50MB, use colab_execute with drive_save). It also provides post-execution steps and common issues, offering clear guidance on alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mio-github/mcp-colab-gpu'

If you have feedback or need assistance with the MCP directory API, please join our Discord server