Skip to main content
Glama

connect_runtime

Connects to or re-attaches to a Colab, Kaggle, or Jupyter runtime, automatically finding the just-started or previous session so work can resume in every new session.

Instructions

Connect to (or re-attach to) the runtime. Call it with no arguments in most cases.

With no arguments it does the right thing: it finds the Colab/Kaggle session just started with colab_runtime_start / kaggle_runtime_start (waiting up to wait_seconds for it), or re-attaches to the runtime used before. Safe to call in every new session. (For a machine rented with hf_runtime_start, call hf_runtime_connect instead.)

url, token: only for connecting by hand to a Jupyter server whose address and token you were given. hf_auth: with url/token, set True for a JupyterLab running in a Hugging Face Space (url "https://-.hf.space", token = the Space's JUPYTER_TOKEN).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "connect_runtime"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
tokenNo
hf_authNo
wait_secondsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.5/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 burden and largely meets it: it discloses that the call blocks waiting up to wait_seconds for a freshly started session, that it re-attaches rather than creating something new, and that calling it repeatedly is safe. It stops short of saying what happens on timeout or whether an existing attached kernel/session state is replaced, which is the remaining behavioral gap.

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-loaded: the default no-argument behavior and the safety guarantee appear first, and conditional cases follow. The multi-line parameter commentary is slightly sprawling, but every sentence conveys a distinct usage rule rather than restating the parameter names.

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?

Given four optional parameters, no annotations, and an existing output schema (so return values need not be explained), the description covers the decision-relevant cases: default attach, waiting, manual connection, and HF Space auth. A brief note on failure/timeout behavior would make it complete.

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 description coverage is 0%, so the description must supply meaning, and it does: url/token are described as a manual-connection pair, hf_auth is described as a modifier that only applies together with url/token for a Hugging Face Space, and wait_seconds is tied to waiting for a just-started session. What is missing is the expected token format semantics beyond the HF example and the default/sane range for wait_seconds.

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?

States a specific verb and resource (connect/re-attach to the runtime) and immediately scopes the default case. It also names the sibling that handles the exception case (hf_runtime_connect for machines rented with hf_runtime_start), so an agent can distinguish it from the other runtime tools without opening a schema.

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?

Explicitly says to call it with no arguments in most cases, that it is safe in every new session, and that it locates a session started by colab_runtime_start / kaggle_runtime_start. It also states the one condition that selects an alternative tool (hf_runtime_connect for hf_runtime_start machines) and the one case where parameters are actually needed (manual Jupyter connection).

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