Skip to main content
Glama

Execute Experiment

execute_experiment

Run shell commands in an isolated sandbox to install dependencies, build, test, or run scripts without affecting the host. Get exit code, stdout, stderr, and duration to decide what to try next.

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.5/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden of behavioral disclosure. It does so thoroughly: commands run in the container, never the host; returns exit code, stdout, stderr, duration; a non-zero exit is a normal result; background mode returns a job id; and the call is bounded by timeout so it cannot hang the session. This gives the agent a complete mental model of the tool's behavior.

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?

The description is tightly organized: purpose, usage guidance, return behavior, and background-mode instructions. Every sentence adds value, and the most important information is front-loaded. It remains concise despite covering a lot of behavioral ground.

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 tool has 5 parameters, an output schema, and a diverse sibling set. The description covers the core function, return values, error semantics, timeout behavior, background job handling, and boundary (sandbox vs host). It gives the agent everything needed to call this tool correctly and react to results, with no significant gaps.

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 description coverage is 100%, so the baseline is 3. The description adds some context around background=true (poll get_job_status, fetch get_job_result) and timeout ('bounded by the timeout'), but the schema already documents each parameter adequately. The description does not materially increase parameter understanding beyond what the schema provides.

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 opens with a specific verb and resource: 'Run a shell command inside a sandbox.' This clearly distinguishes it from sibling tools like read_sandbox_file, write_sandbox_file, and run_tests by framing it as a general-purpose command executor.

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?

It explicitly says 'USE THIS for anything you would otherwise run in the developer's terminal' and gives concrete examples (installs, builds, scripts, migrations). It also provides guidance for long-running commands via background=true and mentions polling get_job_status and get_job_result. It does not explicitly contrast with run_tests or inspect_changes, so it misses the 'when not to use' part, but the context is otherwise very clear.

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

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