Skip to main content
Glama

Run Shell Command

run_command
Destructive

Execute shell commands with full piping and redirect support, capturing stdout, stderr, and exit code. Optionally specify a working directory.

Instructions

Run a shell command and return its stdout, stderr and exit code. Runs through the system shell, so pipes, redirects and globs work. Killed after the configured timeout.

WARNING: This executes arbitrary commands on the local machine. Only use commands the user would approve.

Args:

  • command (string): The shell command line to run.

  • cwd (string): Optional working directory.

Returns exit code plus captured stdout/stderr.

Example: { "command": "ls -la | head", "cwd": "~/project" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command line
cwdNoWorking directory
Behavior5/5

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

The description adds behavioral details beyond annotations: system shell execution, timeout, and arbitrary command execution warning. Annotations already indicate destructiveHint=true, but the description expands on that with specifics.

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?

The description is concise, well-structured with a clear purpose, behavior notes, warning, and example. Every sentence adds value.

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

Completeness5/5

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

Given the tool's moderate complexity (2 params, no output schema), the description covers purpose, parameters, behavior, return values, and a warning. It is complete for an agent to use correctly.

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 coverage is 100% with descriptions. The description lists both args and provides an example, adding context beyond the schema with usage examples (e.g., pipes and cwd).

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 'Run a shell command and return its stdout, stderr and exit code.' It specifies the verb and resource, and distinguishes from siblings like 'execute_code' by mentioning system shell support with pipes, redirects, and globs.

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?

The description includes a warning about using only commands the user would approve, implying caution. It does not explicitly state when to use this tool vs. alternatives (e.g., 'execute_code' for sandboxed code), but the context of system shell usage provides implicit guidance.

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/highercomve/mcptools'

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