Skip to main content
Glama

Execute Experiment

execute_experiment

Execute shell commands inside an isolated sandbox to safely install, build, test, and explore, protecting your host from unwanted side effects.

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

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

Since no annotations are provided, the description carries the full burden of disclosing behavior. It clearly states that a non-zero exit code is normal (not an error), returns stdout/stderr/duration, and explains that background mode returns a job id. It does not explicitly mention potential filesystem side effects, but that is inherent to running a shell command in a sandbox; the description is otherwise transparent.

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 concise and well-structured: one sentence states the core function, followed by usage guidance, return semantics, and background handling. It avoids redundant details and every sentence contributes useful information.

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?

Given the tool's relative simplicity and the presence of an output schema (implied by the return description), the description provides sufficient context: it explains what happens on execution, how to handle background vs. foreground, and how to retrieve results using sibling tools. No critical information is missing for correct usage.

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 schema already provides descriptions for all five parameters (100% coverage), so the baseline is 3. The description adds value by clarifying the intent of background (for long-running tasks) and tying timeout to the sandbox's default, which goes beyond the schema's factual description. No parameter is left unexplained.

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 clearly states the tool runs a shell command inside a sandbox, which is specific and distinct from sibling tools that manage experiments or files. It also explicitly mentions the return values (exit code, stdout, stderr, duration) and background execution, leaving no ambiguity about its purpose.

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?

The description explicitly says to use this for terminal-like tasks (installs, builds, scripts, migrations, exploration) and contrasts it with host execution. It also provides clear guidance on when to set background=true and how to poll via get_job_status/get_job_result, plus timeout behavior.

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

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