Skip to main content
Glama
mako10k
by mako10k

shell_execute

Execute shell commands with bounded output retention, adaptive execution, and pipeline support for managing long-running processes.

Instructions

Execute shell commands with bounded output retention. When output_id is present, read_execution_output returns the retained output; output_truncated=true means data beyond max_output_size was not retained. Supports adaptive execution mode and input_output_id pipeline operations. NOTE: This is MCP Shell Server tool - do NOT use VS Code internal run_in_terminal parameters like "explanation" or "isBackground".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command to execute (e.g., "ls -la", "npm install", "python script.py"). Restrictive mode permits full shell syntax only inside its required Bubblewrap profile; other executable modes are not OS-confined. NOTE: This is MCP Shell Server - do NOT use VS Code internal run_in_terminal parameters like "explanation".
commentNoOptional comment from the LLM client explaining the intent or context behind this command execution. This helps the command evaluator understand the broader context, but will be treated as advisory only and not blindly trusted.
input_dataNoStandard input data to provide to the command. Useful for commands that read from stdin.
session_idNoSession ID for grouping related command executions. Used for process management and filtering in process_list.
capture_stderrNoWhether to capture standard error output in addition to stdout. When false, stderr is discarded.
execution_modeNoHow the command should be executed: "foreground" (wait for completion), "background" (run async), "detached" (fire-and-forget), "adaptive" (start foreground, switch to background for long-running commands)adaptive
terminal_shellNoShell type for the new terminal (bash, zsh, fish, cmd, powershell). Only used when create_terminal is true.
create_terminalNoCreate a new interactive terminal session instead of running command directly. Restrictive mode rejects this route with SANDBOX_TERMINAL_UNAVAILABLE.
input_output_idNoOutput ID from previous command execution to use as input. Alternative to input_data for pipeline operations.
max_output_sizeNoMaximum output size in bytes (1KB-100MB). Output will be truncated if it exceeds this limit. Default: 5MB.
timeout_secondsNoGlobal timeout (1-3600s). Default: 60s. Per execution_mode (effective limits before execution starts): • foreground: Schema allows 1-3600s, but the default security policy caps runs at 300s. Increase MCP_SHELL_MAX_EXECUTION_TIME in trusted startup configuration when a larger cap is required. • background: 1-3600s. Intended for >300s runs; still subject to the same security cap (300s by default) unless raised. • detached: 1-3600s. Shares the security cap behavior with background. • adaptive: 1-3600s total cap. The initial foreground phase also respects foreground_timeout_seconds (≤300s) and the security cap. Guidance: For long-running tasks (>300s), raise max_execution_time or use background/adaptive modes.
working_directoryNoDirectory where the command should be executed. If not specified, uses the default working directory set by shell_set_default_workdir or the initial server directory.
force_user_confirmNoForce user confirmation regardless of LLM evaluation result. Use this to test ELICITATION functionality or when direct user confirmation is required even if the evaluator would allow the command.
terminal_dimensionsNoTerminal dimensions in characters (width x height). Only used when create_terminal is true. Default: 120x30.
environment_variablesNoEnvironment variables to set for direct host execution. Restrictive mode rejects request environment overrides with SANDBOX_ENV_UNSUPPORTED.
return_partial_on_timeoutNoWhen timeout occurs, return partial output collected so far instead of an error. Useful for monitoring long-running commands.
foreground_timeout_secondsNoInitial foreground window for adaptive mode (1-300s). Behavior by execution_mode: • adaptive: Duration to remain in foreground before automatically switching to background if the command is still running. Must be ≤ timeout_seconds. • foreground: Does not trigger background switching (value is effectively unused for switching). Use background/adaptive for >300s scenarios. • background/detached: Ignored.

Schema Changelog

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

  1. First observedv2.8.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It does disclose truncation behavior, output retention, pipeline support, and adaptive execution. However, for an arbitrary shell command executor, it does not mention potential side effects, permission requirements, sandbox restrictions, or that commands may modify the system.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and is reasonably compact. The note about VS Code parameters is somewhat extra but helps prevent common misuse. Each sentence contributes useful context without excessive verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a complex tool with 17 parameters and no output schema, so the description must partly explain return behavior. It covers output_id and output_truncated, but it does not describe the full return value or how immediate stdout/stderr and exit status are surfaced, leaving a meaningful gap for an agent.

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 some cross-parameter meaning by linking output_id to read_execution_output and output_truncated to max_output_size, but most parameter semantics are already thoroughly covered by the schema.

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 opens with a specific verb and resource: 'Execute shell commands.' It further distinguishes itself from related tools by explaining bounded output retention and explicitly referencing read_execution_output, making its role clear among siblings.

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?

The description gives useful context about output retention, output_id, adaptive mode, and pipeline operations, and it warns against VS Code-specific parameters. However, it does not explicitly state when to use this tool versus sibling tools such as terminal_operate, process_get_execution, or command_history_query, leaving some routing to inference.

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/mako10k/mcp-shell-server'

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