Skip to main content
Glama

Execute Experiment

execute_experiment

Run shell commands in an isolated Docker sandbox for installs, builds, scripts, migrations, and exploration without exposing the host machine. Returns exit code, stdout, stderr, and duration to guide next attempts.

Instructions

Run a shell command inside a sandbox.

USE THIS for anything you would otherwise run in the developer's terminal: installs, builds, scripts, migrations, one-off exploration. The command runs in the container, never on the host.

RETURNS exit code, stdout, stderr and duration. A non-zero exit is a normal result, not an error -- read it and decide what to try next.

Set background=true for something long-running, then poll get_job_status and fetch get_job_result when it finishes. Otherwise this waits, bounded by the timeout, so it cannot hang your session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command. Runs via /bin/sh in the workspace.
timeoutNoSeconds before the command is killed. Defaults to the experiment's.
workdirNoWorking directory. Must be inside the workspace.
backgroundNoReturn a job id immediately instead of waiting.
experiment_idYesThe experiment to run in.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
job_idYes
statusYes
stderrNo
stdoutNo
commandYes
exit_codeNo
duration_msNo
experiment_idYes
stderr_truncatedNo
stdout_truncatedNo

Schema Changelog

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

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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 thoroughly: it clarifies commands run in a container/workspace, never on the host; non-zero exits are normal results; background=true changes behavior; and timeout bounds prevent hangs. This is rich, honest behavioral context.

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?

Four compact paragraphs, each with a distinct job: core action, usage guidance, return behavior, and background execution. The most important information is front-loaded and every sentence adds useful guidance without redundancy.

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?

The description covers execution environment, return values, non-zero exit semantics, timeout behavior, and the background workflow. Combined with the 100% schema coverage and the presence of an output schema, an agent has enough context to select and invoke the tool 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?

The input schema already covers 100% of parameters, so the baseline is 3. The description adds value beyond the schema by explaining how background=true should be used (poll get_job_status, fetch get_job_result) and by clarifying that timeout bounds execution. This elevates it above the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run a shell command inside a sandbox') and gives concrete examples like installs, builds, scripts, and migrations. It is clear what the tool does, but it does not explicitly distinguish itself from the sibling run_tests, which could overlap in the 'run things in the terminal' space.

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?

Gives explicit when-to-use guidance: 'USE THIS for anything you would otherwise run in the developer's terminal.' It also describes the background workflow with get_job_status and get_job_result. However, it does not state exclusions or directly compare against alternatives like run_tests.

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/Dhananjay-JSR/sandbox-mcp'

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