Skip to main content
Glama

runtime_sandboxes_interpreter_run

Destructive

Run code in a stateful interpreter inside a running sandbox: variables and imports persist per context, like notebook cells (Go keeps declarations, not values). Returns stdout, stderr, results (text, HTML, PNG charts, tables for DataFrames) and any error with its traceback; values over 48 KiB come back as refs to files. For data analysis, charts and quick computations; runtime_sandboxes_exec runs shell commands. timeoutMs defaults to 300000.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
codeYes
contextNoA context's id; each language's name is its default context, started on first use.
languageNopython by default. R, Java and Go are installed on first use (tens of seconds, once) when the image lacks them.
timeoutMsNo
idempotencyKeyNoOptional: left out, one is made and returned as idempotencyKey. Send it back only to retry this exact call after a temporary error.
interruptOnDisconnectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare write/destructive/open-world characteristics; the description adds substantial context beyond them: per-context state persistence (with the Go declaration caveat), the full return surface (stdout/stderr/results/errors with traceback), a 48 KiB size threshold that switches to file refs, and the timeout default.

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-loads the action and scope, then behavior, then sibling routing, then a trailing default. Dense but every clause carries information; no filler sentences.

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?

With no output schema, the description correctly takes on the burden of explaining return values and error shape, and it discloses the destructive nature beyond annotations. Remaining gap is the partial parameter coverage (43%), but the description is complete enough for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 43%. The description compensates partially, adding the timeoutMs default (300000) and elaborating the persistence semantics of 'context', but idempotencyKey semantics live only in the schema and several parameters lack description-level detail. Baseline-to-marginal value given the coverage gap.

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 (Run) and resource (code in a stateful interpreter inside a sandbox), and explicitly distinguishes itself from the sibling runtime_sandboxes_exec ('runs shell commands'). An agent can tell them apart without opening either schema.

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

Usage Guidelines4/5

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

Names the alternative tool and its distinguishing purpose ('For data analysis, charts and quick computations; runtime_sandboxes_exec runs shell commands'), giving a clear selection condition. It lacks explicit when-not exclusions, but the routing guidance is strong.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.