Skip to main content
Glama

colab_execute_file

Execute a local .py script on a Google Colab GPU/TPU runtime. Supports T4, L4, A100, H100 accelerators.

Instructions

Execute a local Python file on a Google Colab GPU/TPU runtime.

Reads the file contents and sends them for execution on a Colab runtime. Use this instead of colab_execute when you already have a .py script file ready to run.

After execution:

  • Check exit_code and cell outputs in the response.

  • If you need to collect output files (models, images), use colab_execute_notebook instead.

Common issues:

  • Only .py files are accepted (security restriction).

  • File must exist at the given path on the local machine.

Args: file_path: Path to a local .py file to execute on Colab. 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
timeoutNo
file_pathYes
acceleratorNoT4
high_memoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses security restriction (only .py files), file existence requirement, and response structure (exit_code, cell outputs). Could add more on runtime side effects, but annotations are minimal so description adds significant value.

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

Conciseness5/5

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

Well-structured with clear sections, front-loaded purpose, and no redundant information. Every sentence adds value.

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?

Covers purpose, usage, parameters, execution flow, and post-execution steps. Output schema exists, so return details are not needed. Complete for a 4-param tool with sibling context.

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?

Schema has 0% coverage, but description provides full parameter details including accelerator options with availability tiers, high_memory, timeout, and required file_path. Compensates completely.

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?

Clearly states the tool executes a local Python file on Colab with specific hardware. Differentiates from sibling tools colab_execute and colab_execute_notebook.

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?

Provides explicit when-to-use (for .py files) and when-to-use alternatives (colab_execute_notebook for output files). Includes common issues and post-execution instructions.

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