Colab MCP Adapter
Allows managing Google Colab sessions and executing Python code or files within them, including creating, listing, inspecting, and stopping sessions, retrieving session URLs, and accessing session logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Colab MCP AdapterCreate a Colab session with a GPU and run a quick Python sanity check"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Colab MCP Adapter
A local, Windows-compatible stdio MCP server for the Google Colab CLI.
Authentication: Uses the existing Colab CLI OAuth2 flow. The adapter never reads, copies, prints, or modifies CLI credential files.
No GCP/ADC required — wraps the local colab CLI instead of the hosted Colab API.
This adapter is a local interactive-compute integration, not a distributed worker. Google Colab's free managed runtimes prohibit running distributed-computing workers; do not use this adapter as part of a worker pool.
Features (8 Tools)
Phase C: Session Lifecycle
Tool | CLI Command | Description |
|
| Create a new Colab session |
|
| List all active sessions |
|
| Get session status |
|
| Stop (terminate & delete) session |
Phase D: Code/File Execution
Tool | CLI Command | Description |
|
| Execute Python code via stdin pipe |
|
| Execute a Python file |
Phase E: URL/Log
Tool | CLI Command | Description |
|
| Get browser URL for session |
|
| Get session history logs |
Related MCP server: colab-cli-mcp
Architecture
OpenCode v2 (MCP Client)
│ stdio transport (clean JSON-RPC)
▼
Colab MCP Adapter (FastMCP 2.14.7)
│ subprocess (no shell=True)
▼
Colab CLI 0.7.5 (OAuth2 via ~/.config/colab-cli/token.json)
│ HTTPS
▼
Google Colab Free TierRequirements
Python ≥3.11 (tested on 3.12.15, 3.15.1)
uvpackage managerGoogle Colab CLI 0.7.5+ (
uv tool install google-colab-cli)Colab CLI authenticated (
colab login)
Installation
# Clone and install
git clone <repo-url>
cd colab-mcp-adapter
uv sync --extra dev
# Run tests
uv run pytest
# Run server
uv run colab-mcp-adapterOpenCode Integration
For OpenCode v2, add the MCP server to ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"servers": {
"colab": {
"type": "local",
"command": ["uv", "run", "colab-mcp-adapter"],
"cwd": "C:\\Users\\<user>\\Projects\\colab-mcp-adapter",
"timeout": 30000
}
}
}
}OpenCode v2 agents use ordered permission rules. This example allows routine inspection and code execution, while requiring approval for file execution and destructive session termination:
{
"agents": {
"colab-researcher": {
"description": "Conduct computational research using Colab sessions",
"mode": "primary",
"system": "Use existing sessions when possible. Never print secrets. Ask for explicit approval before file execution or stopping a session.",
"permissions": [
{ "action": "colab_colab_session_list", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_session_get", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_session_get_url", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_session_log", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_session_create", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_code_execute", "resource": "*", "effect": "allow" },
{ "action": "colab_colab_file_execute", "resource": "*", "effect": "ask" },
{ "action": "colab_colab_session_stop", "resource": "*", "effect": "ask" }
]
}
}
}These configuration examples target OpenCode v2. OpenCode v1 uses a different configuration schema; use documentation matching the installed version.
Safeguards
Safeguard | Implementation |
No | Argument arrays only ( |
No token exposure | Never reads |
Session ID validation | Regex |
Defensive parsing | Regex with fallbacks, skips |
Error mapping | CLI stderr → MCP codes (404, 409, 408, 401, 429, 500) |
Bounded timeouts | Per-call configurable (1–300s) |
Separate stdout/stderr | Independent capture in |
Destructive stop gated | Explicit warning, termination verified |
Testing
# All tests (71 passing)
uv run pytest
# Protocol tests only
uv run pytest tests/test_stdio_protocol.py -v
# Unit tests only
uv run pytest tests/test_adapter.py -vProject Structure
colab-mcp-adapter/
├── pyproject.toml
├── uv.lock
├── README.md
├── PHASE-B-VERIFICATION.md
├── PHASE-C-VERIFICATION.md
├── PHASE-D-VERIFICATION.md
├── PHASE-E-VERIFICATION.md
├── PHASE-F-VERIFICATION.md
├── RELEASE-MANIFEST.md
├── RELEASE-READINESS.md
├── USAGE-PLAN.md
├── src/
│ └── colab_mcp_adapter/
│ ├── __init__.py
│ ├── __main__.py
│ ├── contracts.py # Pydantic models & error classes
│ ├── parser.py # CLI output parsing
│ ├── adapter.py # Core subprocess wrapper
│ └── server.py # FastMCP server with 8 tools
└── tests/
├── test_adapter.py # 69 unit tests (mocked CLI)
└── test_stdio_protocol.py # 2 protocol tests (real server)Verification Reports
Phase | Report |
B | |
C | |
D | |
E | |
F |
License
MIT
Available Tools
8 toolscolab_code_executeA
Execute Python code in a Colab session via stdin pipe.
Args: session: Session display name code: Python code 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
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| code | Yes | ||
| session | Yes | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does substantial work: it enumerates concrete failure modes (SESSION_NOT_FOUND, EXECUTION_TIMEOUT, KERNEL_ERROR, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR) and states the timeout bounds 1-300. It omits whether code runs in a persistent kernel state or is idempotent/reversible, which matters for an arbitrary-code execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One front-loaded sentence establishes the operation, followed by structured Args/Returns/Raises blocks. No filler, though the Returns block partially duplicates the output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-parameter code-execution tool with no annotations, the definition supplies argument meanings, timeout bounds, return fields, and a full error taxonomy. An agent has enough to invoke it correctly without opening the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 does: all four parameters are addressed, including the timeout range and default (1-300, default 30) which the schema omits. The 'env' description ('Environment variables to set before execution') is brief but conveys the semantics the bare schema lacks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence names a specific verb and resource ('Execute Python code in a Colab session') plus the transport mechanism (stdin pipe). It doesn't explicitly differentiate from the sibling colab_file_execute, so an agent must infer the distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No statement of when to use this versus colab_file_execute or when a session must first be created. The 'via stdin pipe' clause hints at mechanism but does not guide tool selection or state prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_file_executeA
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
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| session | Yes | ||
| timeout | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden: it usefully lists return fields and named error conditions such as SESSION_NOT_FOUND, EXECUTION_TIMEOUT, KERNEL_ERROR, AUTH_EXPIRED, QUOTA_EXCEEDED, and CLI_ERROR. However, it does not disclose side effects, permission requirements, or whether execution mutates session state.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the purpose and then organized into Args, Returns, and Raises sections. Every section adds useful information without excessive verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all parameters, return shape, and error cases, which is strong for a 4-parameter execution tool with no annotations. It is only missing explicit guidance about when to use this tool versus `colab_code_execute` and any side-effect or permission disclosure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must document all four parameters, and it does: session display name, file path, timeout with range/default, and environment variables. This adds clear semantics beyond the bare schema types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Execute a Python file in a Colab session.' The 'file' wording implicitly distinguishes it from the sibling `colab_code_execute`, though it does not explicitly name or compare against that alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the distinction between executing a file versus executing code, but the description never explicitly says when to choose this tool over `colab_code_execute`. It also gives no prerequisites or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_createA
Create a new Colab session.
Args: name: Optional session name (auto-generated if omitted) gpu: GPU variant: T4, L4, G4, H100, A100 tpu: TPU variant: v5e1, v6e1 high_mem: Request high-RAM machine shape (requires Pro/Pro+)
Returns: Session info including name, session_id, hardware, shape, variant, status
Raises: ToolError: SESSION_ALREADY_EXISTS, QUOTA_EXCEEDED, AUTH_EXPIRED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
| gpu | No | ||
| tpu | No | ||
| name | No | ||
| high_mem | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | |
| shape | Yes | |
| status | No | |
| variant | Yes | |
| hardware | Yes | |
| session_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does add real value by disclosing the failure modes (SESSION_ALREADY_EXISTS, QUOTA_EXCEEDED, AUTH_EXPIRED, CLI_ERROR) and the Pro/Pro+ gate on high_mem. However it omits key behavioral facts: what hardware is provisioned by default, whether gpu and tpu can be combined, and what the cost/lifetime implications of a created session are.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The docstring layout is front-loaded with the action verb first, then Args/Returns/Raises, and every line carries usable information. The Returns block is mildly redundant given an output schema exists, but the structure is efficient overall.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-parameter creation tool with no annotations, the description covers parameters, return shape, and error cases — enough to call it correctly. Missing the default hardware profile and gpu/tpu compatibility keeps it short of complete, though the existing output schema reduces the need to explain return values in detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate — and it does, enumerating the concrete accepted values (gpu: T4, L4, G4, H100, A100; tpu: v5e1, v6e1) that the bare schema lacks entirely, plus explaining that name is auto-generated if omitted. The remaining gap is that gpu/tpu interaction (mutual exclusivity vs. both allowed) is never stated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Create a new Colab session') that an agent can immediately distinguish from siblings like colab_session_list, colab_session_get, and colab_session_stop. It does not explicitly name a sibling or contrast with alternatives, but the create/get/list/stop family is unambiguous from the name and the verb.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: an agent infers it must create a session before colab_code_execute or colab_session_get_url can work. The only explicit guidance is the prerequisite note that high_mem 'requires Pro/Pro+'. Nothing states whether gpu and tpu are mutually exclusive or what the default hardware is if neither is supplied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_getB
Get status of a specific Colab session.
Args: name: Session display name
Returns: Session info including name, session_id, hardware, shape, variant, status
Raises: ToolError: SESSION_NOT_FOUND, AUTH_EXPIRED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | |
| shape | Yes | |
| status | Yes | |
| variant | Yes | |
| hardware | Yes | |
| session_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It helpfully discloses error conditions (SESSION_NOT_FOUND, AUTH_EXPIRED, CLI_ERROR) and returned fields, and 'Get status' implies a read-only operation, but it does not explicitly describe permissions, auth handling, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose and uses a clean Args/Returns/Raises structure. It is reasonably concise, though the Returns section partially duplicates information already available via the output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple getter with one parameter and an output schema, the description covers the parameter meaning and important error cases. It lacks guidance on alternatives and session-name semantics, which are needed for reliable tool selection.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It clarifies that 'name' means the session display name, which is useful, but it does not explain format, constraints, or how display name relates to session_id.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb and resource: get status of a specific Colab session. It is distinguishable from sibling tools like colab_session_list because it targets one named session, but it does not explicitly name sibling alternatives or contrast use cases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by 'specific Colab session': use this when you already have a session name and need its status. However, the description does not state when to prefer this over colab_session_list, colab_session_get_url, or colab_session_log, nor does it mention prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_get_urlB
Get the browser URL for a Colab session.
Args: session: Session display name host: Optional Colab frontend host (default: https://colab.research.google.com)
Returns: Full Colab browser URL for the session
Raises: ToolError: SESSION_NOT_FOUND, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| session | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| url | Yes | Full Colab browser URL for the session |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does add real value by enumerating the failure modes (SESSION_NOT_FOUND, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR) and stating the return value. However, it doesn't say whether the call has any side effects, what auth is required beyond the AUTH_EXPIRED hint, or whether URL retrieval triggers session start.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the purpose, then cleanly structured Args/Returns/Raises sections. The lines are short and each contributes; slightly verbose in the repeated 'Colab' qualifiers but nothing is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
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 detail is not strictly required, yet the description confirms it returns a full browser URL and also documents error codes. Missing only invocation context such as preconditions and side-effect behavior, which keeps it short of a 5.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 does: it explains that 'session' is a display name and that 'host' is an optional frontend host with a documented default URL (the schema only shows default null). This is meaningful semantics beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: fetch the browser URL for a Colab session. This clearly distinguishes it from sibling session tools like colab_session_get (session details) and colab_session_list, though it does not explicitly name those siblings in an exclusion statement.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description never says when to use this vs colab_session_get or the other session tools, nor does it state prerequisites (e.g., that the session must already exist). The agent must infer usage from the verb alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_listA
List all active Colab sessions.
Returns: List of sessions with name, session_id, hardware, shape, variant, status
Raises: ToolError: AUTH_EXPIRED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| sessions | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations at all, the description carries the full burden, and it does deliver real behavioral context: the exact fields returned and two named failure modes (AUTH_EXPIRED, CLI_ERROR). It stops short of stating ordering/pagination or confirming the operation is strictly non-mutating.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three lines, front-loaded with the single action sentence, then structured Returns/Raises blocks. Nothing is padded and the caller's two questions (what do I get, what can go wrong) are answered immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-param, no-annotation tool, the definition covers purpose, return shape and error modes. An output schema exists, so the Returns block is mildly redundant, and it omits whether stopped sessions are excluded from 'active' or how many sessions can come back.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Zero parameters, so there is nothing to disambiguate — baseline 4 applies. The description correctly implies no filtering is possible, since it lists all active sessions unconditionally.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('List all active Colab sessions') with a clear scope qualifier ('active'). The plural 'all' implicitly contrasts with colab_session_get, but the description never names that sibling, so differentiation is inferred rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied by the enumeration semantics of 'List all active' — an agent can infer this is the discovery/entry-point call before colab_session_get or colab_code_execute. There is no explicit when-to-use, when-not-to-use, or alternative named.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_logA
Get session history logs.
Args: session: Session display name (omit to list all sessions with logs) lines: Number of lines to show (default: all) type: Filter by event type (e.g., execution, file_operation, session_created)
Returns: Log lines for the session, or list of sessions with logs if session omitted
Raises: ToolError: SESSION_NOT_FOUND, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | ||
| lines | No | ||
| session | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| logs | Yes | Log lines |
| session | No | Session name (None if listing all sessions) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden and does reasonably well: it discloses the failure surface (SESSION_NOT_FOUND, AUTH_EXPIRED, QUOTA_EXCEEDED, CLI_ERROR) and the read-only nature via 'Get'. It does not say whether logs are persisted across restarts, what order lines are returned in, or whether output is truncated when lines is omitted.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The docstring is front-loaded with the purpose, then Args/Returns/Raises in a predictable order with no padding. The Returns block partly restates what the output schema already conveys, which is the only wasted text, but it usefully characterizes the mode-dependent return.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-param all-optional read tool with an output schema, the description supplies parameter meaning and an error taxonomy, which is most of what an agent needs. It stops short of ordering/persistence details and the interaction with sibling session tools, but nothing critical for a correct call is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so all meaning must come from the description, and it does cover every parameter: session (omit for all), lines (default all), type (filter with concrete examples like execution, file_operation, session_created). Remaining gaps are that 'type' is not an explicit closed set and 'lines' doesn't say whether it takes the head or tail of the log.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Get session history logs') and clarifies the dual mode: session-scoped logs, or a list of loggable sessions when session is omitted. That dual-mode note partially separates it from colab_session_list, but the overlap (both can return a list of sessions) is not explicitly resolved by naming the sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a conditional usage hint ('omit to list all sessions with logs') and one filter example, so usage is implied rather than spelled out. It never states when to prefer this over colab_session_list or colab_session_get, nor any prerequisite such as an active session before logs exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
colab_session_stopA
Stop (terminate and delete) a Colab session.
WARNING: This is a destructive operation. The session and its kernel state will be permanently deleted. Files in /content persist on the runtime filesystem but the session cannot be resumed.
Args: name: Session display name
Returns: Confirmation that session was terminated
Raises: ToolError: SESSION_NOT_FOUND, AUTH_EXPIRED, CLI_ERROR
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | |
| terminated | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so well: it declares the operation destructive and permanent, explains that kernel state is lost, that /content files persist on the runtime filesystem, that the session cannot be resumed, and it enumerates failure modes (SESSION_NOT_FOUND, AUTH_EXPIRED, CLI_ERROR). It stops short of stating auth/permission requirements or idempotency behavior on an already-stopped session.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core action and the WARNING are front-loaded, which is exactly right for a destructive tool. The Args/Returns/Raises scaffolding is slightly heavier than needed for a single-parameter tool but every line still carries information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter destructive tool, the description covers the mutation semantics, data persistence boundary, irreversibility, return confirmation, and error taxonomy. With an output schema present, the brief Returns line is sufficient and nothing an agent needs to call it safely is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does by labeling 'name' as the session display name — usefully implying it is not an ID. It does not specify format, case sensitivity, or how to discover valid names (presumably via colab_session_list).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Stop (terminate and delete) a Colab session') and disambiguates the ambiguous word 'stop' by parenthetically defining it as terminate-and-delete. It is clearly distinguishable from siblings such as colab_session_create, colab_session_list, and colab_session_get.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The context of use is implied by the destructive framing, but there is no explicit guidance on when to prefer this over alternatives (e.g., check state with colab_session_get first) or when not to call it. The consequence statement helps the agent decide, but routing guidance is absent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.1.0- First observed
colab_code_execute - First observed
colab_file_execute - First observed
colab_session_create - First observed
colab_session_get - First observed
colab_session_get_url - First observed
colab_session_list - First observed
colab_session_log - First observed
colab_session_stop
TDQS
Scored across 8 tools
Session lifecycle tools are clearly separated by action and target, and read-only helpers like get_url and log have distinct purposes. The only mild ambiguity is between code_execute and file_execute, which both execute Python in a session but differ by input form and are clarified in their descriptions.
All tools use snake_case with a consistent colab_ prefix and mostly follow a resource_action pattern. Minor deviations exist: colab_session_log uses only a noun, and colab_session_get_url adds an extra noun to the usual pattern.
Eight tools is well-scoped for a Colab session adapter, covering creation, listing, status, termination, execution, URL access, and logs without obvious padding. Each tool appears to earn its place in the surface.
The core session lifecycle and execution workflows are covered, including logs and browser URL access. Explicit file upload/download or notebook-file operations are absent, though agents can likely work around this by writing files through code_execute.
Maintenance
Related MCP Connectors
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Run any Relay model (image, video, audio, LLM), poll tasks, upload files and search Relay's docs.
Interact with your Google Bigtable resources using natural language commands.
Related MCP Servers
- AlicenseBqualityDmaintenanceLocal-first MCP server for controlling Google Colab as a development, shell, file, and training runtime, with tools for notebook editing, GPU acceleration, and file transfer.598Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to execute Python code on Google Colab GPU/TPU runtimes via the official Colab CLI, with session, file, and package management capabilities.-
- AlicenseAqualityCmaintenanceEnables local agents to connect to and interact with Google Colab sessions running in the browser.3Apache 2.0
- AlicenseAqualityBmaintenanceEnables local coding agents to manage disposable Colab GPU runtimes, restore and save Google Drive checkpoints, execute scripts, and safely stop VMs through MCP stdio tools.9MIT