Skip to main content
Glama

run_command

Executes a shell command in a workspace directory and returns the exit code, stdout, and stderr, with an optional timeout for controlled command and test runs.

Instructions

Run a shell command and return exit code, stdout and stderr. The working directory must be inside the workspace (default: the workspace root). The command itself is NOT confined: a shell can still reach any path the server's user can.

Input Schema

NameRequiredDescriptionDefault
cwdNo
commandYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses that the command string is NOT confined and can reach any path the server's user can, which is the single most important safety fact for this tool. It omits other behavioral traits such as timeout enforcement/abort semantics and whether output is truncated.

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, no filler, with the return contract and the critical containment caveat both front-loaded ahead of the path defaults.

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?

An output schema exists, so return values needn't be explained, and the containment warning covers the main risk of an unannotated mutation tool. The remaining gap is timeout behavior, which matters for a shell tool but is not addressed in text or schema descriptions.

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 0%, so the description must compensate. It explains cwd well (inside the workspace, defaults to workspace root) and the command param is self-evident, but the `timeout` parameter is never mentioned in the description and its schema entry has no description text either.

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?

Specific verb+resource ("Run a shell command") plus the return contract ("exit code, stdout and stderr"), which tells an agent exactly what it gets back. It does not differentiate itself from siblings like run_tests, lint, grep, or glob, which are the obvious alternatives for the same general tasks.

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 constrains the working directory ("must be inside the workspace", default root) but gives no explicit when-to-use/when-not guidance relative to specialized siblings. An agent must infer on its own that run_tests or grep should be preferred for their specific jobs.

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