Skip to main content
Glama

executeCommand

Runs shell commands and returns their output, enabling git operations, script execution, and system command tasks for MCP or REST clients.

Instructions

Executes a shell command and returns the output. Useful for git operations, running scripts, or system commands.

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": "executeCommand"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory (default: current directory)
argsNoCommand arguments (e.g., ["status"])
commandYesCommand to execute (e.g., "git", "npm")
timeoutNoTimeout in milliseconds (default: 30000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden for a high-risk mutation/execution tool. It says only that output is returned; it omits sandboxing or permission model, whether the command runs through a shell or is spawned directly, what happens on non-zero exit codes, whether output is truncated, and whether the 30s timeout kills the process. These are exactly the traits an agent needs before invoking this.

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?

Two short sentences, front-loaded with the core action and then the use cases. No filler, no redundancy, and nothing that could be trimmed without losing information.

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

Completeness2/5

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

For an unannotated arbitrary-command execution tool with no output schema, the description should explain return shape (stdout only? stderr merged? exit code included?) and safety/exit behavior. Given that both annotations and an output schema are absent, the definition leaves significant gaps an agent must guess at.

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%, with each of the four parameters documented including defaults and examples, so the schema does the heavy lifting and the baseline of 3 applies. The description adds no param-level meaning, such as how 'command' interacts with 'args' or whether passing 'args' is preferred over embedding arguments in 'command'.

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 states a specific verb and resource ('Executes a shell command and returns the output') and lists concrete use cases (git, scripts, system commands), which separates it from read-only siblings like readFile or echoText. It stops short of naming an alternative or stating a boundary explicitly, so it is clear but not maximally distinguishing.

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?

Usage is only implied through examples ('useful for git operations, running scripts, or system commands'). There is no statement of when to prefer this over sibling tools like searchFiles or readFile, and no when-not-to-use or prerequisite guidance, which matters greatly for arbitrary command execution.

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