Skip to main content
Glama

execute_command

Runs a shell command inside a sandbox container at /workspace, enforcing a timeout and capturing stdout, stderr, and exit code for inspection.

Instructions

Executes a shell command inside the sandbox container at /workspace with timeout enforcement (default 30s) and captures demuxed stdout, stderr, and exitCode.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sandboxId": "<sandboxId>",
      "command": "<command>"
    },
    "name": "execute_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYesShell command string (e.g. "npm test" or "python app.py")
sandboxIdYesSandbox ID
timeoutMsNoCommand timeout in milliseconds (default 30,000ms)
workingDirNoSubdirectory inside /workspace (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full disclosure burden and it does deliver real behavior: a default 30s timeout with enforcement, the /workspace root, and demuxed stdout/stderr plus exitCode as captured results. It does not say whether output is truncated, whether a non-zero exit is surfaced as a tool error or only as an exitCode value, whether state persists between invocations, or what permission/isolation constraints apply to arbitrary shell execution.

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?

A single sentence with the core action first, then scope, then the timeout behavior, then the return shape. Every clause adds information an agent needs and there is no filler or repetition of the tool name.

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?

Complete for the essentials of a command-execution tool: no output schema exists, so naming stdout, stderr and exitCode in prose is the right compensation, and the timeout and working-directory defaults are stated. What is missing is the error/long-running semantics — how a timeout or non-zero exit is reported back — which matters for a tool that runs arbitrary shell code.

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 description coverage is 100%, so the baseline is 3, and the description adds a bit more by restating the default timeout and framing workingDir as rooted inside /workspace. It still doesn't clarify whether workingDir must already exist or whether timeoutMs is a hard kill versus a soft limit, but the schema already handles most of the load.

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?

States a specific verb and resource ('Executes a shell command') and pins down the exact scope: inside the sandbox container at /workspace, targeting a given sandboxId. The side effects it produces (demuxed stdout, stderr, exitCode) make it unmistakable versus the file-operation and git siblings, which share neither the execution model nor the output shape.

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?

Use is only implied by the mechanics: a caller infers this is the tool for running commands in an already-created sandbox rather than manipulating files directly. There is no explicit when-to-use or when-not-to-use guidance, no prerequisite such as needing a live sandboxId from create_sandbox, and no note on preferring read_file/write_file for plain file access.

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