Skip to main content
Glama

run_command

Execute shell commands in an isolated Linux sandbox and capture stdout, stderr, and exit code. Use it to run code, install packages, clone repositories, or inspect the filesystem.

Instructions

Run a shell command inside a sandbox and wait for it to finish. Returns stdout, stderr and the exit code. The command runs as an unprivileged user in /workspace. A non-zero exit code is returned normally, not as an error. Use this to execute code, install packages, clone repositories or inspect the filesystem.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory. Default /workspace.
envNoEnvironment variables for this command. They are exported, so they survive chaining with && or ;.
commandYesShell command, e.g. `python3 script.py` or `pip install requests`.
sandbox_idYesThe id returned by create_sandbox.
timeout_msNoHow long to wait before killing the command (default 60000, max 600000).

Schema Changelog

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

  1. First observedv1.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden and does it well: it states the command runs as an unprivileged user in /workspace, exits normally on non-zero exit codes, and waits for completion. It does not mention persistence or network side effects, but the sandbox context and schema mitigate the omission.

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?

Five short, distinct sentences each convey essential information: purpose, return values, execution environment, exit code behavior, and suggested uses. There is no fluff or repetition, and key facts are front-loaded.

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?

The description is complete enough for an agent to correctly select and call the tool, covering inputs, outputs, and error behavior. It does not mention what persists after the command (e.g., installed packages, file changes) or network access, but for a generic shell tool with fully described schema parameters, this is a minor gap.

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 little parameter-specific detail beyond the schema, but it does reinforce the /workspace default and gives example commands (e.g., python3 script.py, pip install requests).

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 states a specific verb and resource: 'Run a shell command inside a sandbox and wait for it to finish.' It also clarifies the returned data (stdout, stderr, exit code), which distinguishes it from sibling file and sandbox management tools.

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 gives concrete use cases ('execute code, install packages, clone repositories or inspect the filesystem'), which helps an agent recognize when to invoke it. However, it does not explicitly mention alternatives or cases where a sibling tool like read_file or list_files would be preferable, so there are no exclusion rules.

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/fstandhartinger/sandbox-as-a-service-mcp'

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