Skip to main content
Glama

sandbox_exec

Execute shell commands in a sandbox to run builds, tests, installs, or CLI commands, returning stdout, stderr, and exit code for integration into automated workflows.

Instructions

Execute a shell command in a sandbox and return stdout, stderr, and exit code. Use for running builds, tests, installs, or any CLI command.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sandboxIdYesThe sandbox ID to run the command in.
commandYesThe shell command to execute (e.g., "npm install", "python main.py").
cwdNoWorking directory inside the sandbox. Defaults to /home/user.
timeoutMsNoCommand timeout in milliseconds. Default: 120000 (2 min). Set 0 for no timeout.
envsNoEnvironment variables to set for this command.
Behavior3/5

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

Describes output (stdout, stderr, exit code) but no annotations exist. Mentions sandbox execution safety implicitly (sandbox), but lacks details on resource limits, state changes, or side effects. Fair for a command execution tool.

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?

Single sentence efficiently conveys purpose, output, and typical use cases. No fluff. Front-loaded with key action and result.

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?

For a sandbox execution tool with 5 params and no output schema, description clearly states what it returns and examples. Could mention exit code specifics or error handling, but overall sufficient.

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 covers 100% of parameters with descriptions. The description adds no extra param info beyond schema, but given full coverage, baseline is 3. Slight bonus for clarifying command examples in description, aiding agent understanding.

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?

Clearly states 'Execute a shell command in a sandbox' with specific verb (execute) and resource (shell command in sandbox). Lists output types (stdout, stderr, exit code) and example usages (builds, tests, installs). Distinguishes from siblings like sandbox_exec_background.

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?

Provides clear usage context: 'running builds, tests, installs, or any CLI command.' However, no explicit when-not-to-use or mention of alternatives like sandbox_exec_background for async runs.

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

Install Server

Other Tools

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/asif-nvc/e2b-sandbox-mcp'

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