Skip to main content
Glama

execute_shell

Execute shell commands on the host system with directory validation and timeout controls, capturing output and exit codes safely.

Instructions

Execute shell commands on the host system with security controls. Commands are executed as 'bash -c ' on Unix/Mac.

The tool captures stdout, stderr, exit codes, and signals. Commands exceeding the timeout will be automatically terminated.

⚠️ SECURITY REQUIREMENTS:

  • At least ONE approved directory must be configured before executing any shell commands

  • Working directory (workdir parameter or process.cwd()) MUST be within allowed directories

  • All file/directory paths in command arguments are validated against allowed directories

  • Command substitution and dangerous patterns may be restricted

If no workdir is specified, the server's current working directory will be used and validated.

No pre-approved commands. All commands require user approval before execution.

IMPORTANT: Always provide a clear description of what the command does and why it's needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command to execute. For Windows: executed as 'powershell.exe -Command <command>'. For Unix/Mac: executed as 'bash -c <command>'. *** WARNING: Command substitution using $(), ``, <(), or >() may be restricted for security.
descriptionNoBrief description of what the command does and why it's needed. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.
workdirNoOptional absolute path to the directory where the command should be executed. Must be within allowed directories. If not provided, uses current working directory.
timeoutNoTimeout in milliseconds for command execution. Defaults to 30000 (30 seconds). Commands exceeding this duration will be terminated.
requiresApprovalNoIndicates if this command requires explicit user approval. Set to true for potentially dangerous operations (installing packages, deleting files, etc.).
Behavior4/5

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

Discloses execution as bash -c, captures stdout/stderr/exit codes, timeout auto-termination, security restrictions, and approval requirement. Warns about command substitution restrictions. No contradictions with annotations (none provided).

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

Conciseness3/5

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

Description is thorough but verbose, with some redundancy (e.g., the importance of description is already in parameter schema). Structured with sections, but could be more concise for a tool with high schema coverage.

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?

Covers execution model, security, timeout, working directory, and approval. However, does not explicitly describe the return format (stdout/stderr/exit code), which would be expected given no output schema. Slightly incomplete for a shell execution tool.

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 100%, so baseline is 3. The description adds context like workdir must be within allowed directories and timeout default, but this largely duplicates schema descriptions. No significant additional semantics beyond what schema provides.

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 clearly states the tool executes shell commands on the host system with security controls, specifying the execution mechanism (bash -c on Unix/Mac, powershell on Windows). It distinguishes from sibling file/directory tools by being a general command execution tool.

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?

Provides clear security requirements (approved directories, working directory constraints, command substitution restrictions) and states that all commands require user approval. Does not explicitly state when not to use or mention alternatives, but sibling context makes it obvious.

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/n0zer0d4y/vulcan-file-ops'

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