colab_file_execute
Execute a Python file inside a Colab session to capture stdout, stderr, exit code, and execution time, with configurable timeout and environment variables.
Instructions
Execute a Python file in a Colab session.
Args: session: Session display name file_path: Path to Python file to execute timeout: Execution timeout in seconds (1-300, default: 30) env: Environment variables to set before execution
Returns: Execution result with stdout, stderr, exit_code, execution_time
Raises: ToolError: SESSION_NOT_FOUND, EXECUTION_TIMEOUT, KERNEL_ERROR, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| session | Yes | ||
| timeout | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stderr | Yes | Standard error from execution | |
| stdout | Yes | Standard output from execution | |
| exit_code | Yes | Process exit code (0 = success) | |
| execution_time | Yes | Execution time in seconds |