Skip to main content
Glama

runtime_exec

Destructive

Execute Python code in a persistent Jupyter kernel, preserving variables and functions across calls to handle iterative model-driven coding tasks.

Instructions

Execute model-generated Python in a persistent IPython/Jupyter kernel. Variables, imports, and helper functions survive across calls sharing session_id. Use await tools.(...) or await call(name, args) for MCP capabilities, await describe() for the declared catalog, and result(value) to return structured data. The kernel is an unrestricted control environment, not a sandbox, so this tool is available only with --dangerously-open-machine.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython/IPython cell source. Top-level await is supported. Use result(value) for a structured result.
max_callsNoMaximum MCP capability calls from this cell; defaults to 32.
session_idNoPersistent kernel namespace. Defaults to default. State survives until reset, idle eviction, worker restart, or timeout termination.
timeout_msNoCell execution limit; defaults to 30000 ms. A timeout terminates the session to guarantee cleanup.
allow_toolsNoExact MCP capabilities callable from this cell. Defaults to all read-only capabilities. Mutating capabilities must be explicitly declared.
reset_sessionNoTerminate any existing kernel for session_id before executing this cell.
max_output_bytesNoMaximum captured stdout/stderr/display output for this cell; defaults to 1048576.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv1.2.1

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that this is an unrestricted control environment, explicitly not a sandbox, and only available with a danger flag. It also reveals that state survives across calls via session_id. This materially augments the annotation hints and gives the agent a clear risk picture.

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?

Three purposeful sentences front-load the core purpose, then provide usage syntax, then the safety warning. There is no filler, and each sentence earns its place.

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?

For a complex arbitrary-code execution tool with no output schema, the description covers the execution environment, persistence semantics, MCP invocation, structured return via result(value), and safety gating. Combined with the high-coverage input schema and annotations, an agent has enough to call it correctly.

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 coverage is 100%, so the baseline is 3. The description adds meaningful context above the schema by documenting how to interact with MCP capabilities from code (await tools.<name> or await call) and by elaborating that variables/imports/helpers persist per session_id.

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 states a specific verb and resource: 'Execute model-generated Python in a persistent IPython/Jupyter kernel.' This clearly separates it from shell/process executors among the sibling tools, and the persistence detail adds a distinguishing scope.

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

Usage Guidelines3/5

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

It implies when to use the tool—when persistent Python state and MCP capability access are needed—and gives in-kernel usage patterns. However, it never names alternatives or states when not to use it, so the routing guidance is left to inference.

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

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/JonusNattapong/chatgpt-pilot'

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