Skip to main content
Glama

Run command in sandbox

sandbox_exec

Runs a command in an elevated Windows Sandbox session and waits for completion, returning stdout, stderr, and the exit code for validation or troubleshooting.

Instructions

Run a command in the sandbox (elevated admin user session) and wait for it. Returns stdout, stderr and exit code. Use sandbox_launch for GUI apps or anything long-running. The sandbox has Windows PowerShell 5.1 and .NET Framework 4, but no Store apps (no Notepad, Calculator, Terminal) and no winget.

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": {
      "command": "<command>"
    },
    "name": "sandbox_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
shellNoDefault powershell (Windows PowerShell 5.1).
commandYes
timeoutSecNoDefault 120. The process tree is killed on timeout.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden and does well: it states the call blocks until completion, that the session runs as an elevated admin user, and that the environment is Windows PowerShell 5.1 with .NET Framework 4 but no Store apps or winget. It omits things like network access scope or default working directory, and the process-tree-kill-on-timeout detail lives only in the schema.

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?

Three short sentences front-loaded with what the tool does and what it returns, then the routing rule, then environment constraints. Every sentence carries non-redundant information and none needs trimming.

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?

Despite no annotations and no output schema, the description states the return values (stdout, stderr, exit code) and the blocking execution model, which is what an agent needs before invoking it. What is missing is modest: default cwd behavior and latency/rate expectations for long commands.

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 coverage is 50%: shell and timeoutSec are described in the schema, but cwd and command have no description in either place. The description compensates indirectly by describing the interpreter environment (PowerShell 5.1 default, no winget/Store apps), which shapes what commands are valid, but it adds nothing about cwd semantics or the expected command string form.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: run a command in the sandbox and wait synchronously for it, returning stdout, stderr and exit code. It explicitly distinguishes itself from sandbox_launch, but the semantically closest sibling in the list, sandbox_run, is never mentioned or differentiated, leaving some residual ambiguity.

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?

"Use sandbox_launch for GUI apps or anything long-running" is an explicit when-not with a named alternative, which is the key routing decision for a blocking exec tool. It does not address when to prefer a shell tool over sandbox_run, so guidance is clear but not exhaustive.

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