Skip to main content
Glama
shell-mcp

shell-mcp

by Tabing010102

execute_shell_command

Run shell commands locally with configurable working directory, shell, timeout, and background execution; capture truncated output for automation and system tasks.

Instructions

Execute a shell command in the foreground or background.

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

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory for the command. If omitted, uses the server's current directory.
shellNoShell executable to use, for example /bin/bash. Empty string means auto-detect.
commandYesThe shell command to execute.
timeoutNoTimeout in seconds. If omitted, uses the server default.
backgroundNoIf true, run in the background and return a task_id immediately.
output_truncation_modeNoHow to truncate oversized output: 'tail' keeps the end, 'head' keeps the beginning. If omitted, uses the server default.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

B3.1/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 disclosure burden, yet it says nothing about the privilege level the command runs under, the risk of arbitrary command execution, timeout defaults, or that background runs return a task_id immediately. Only the foreground/background distinction is disclosed, and even that is echoed by the schema's background parameter.

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?

It is a single front-loaded sentence with no wasted wording, but for a high-risk six-parameter tool it is arguably too terse rather than optimally sized.

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 arbitrary shell-execution tool with no annotations, the definition is thin: it omits security/permission context and execution behavior even though an output schema exists to cover return values. An agent would call it correctly mechanically but without understanding the operational risk.

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 cwd, shell, timeout, background, and output_truncation_mode are already documented in the schema. The description adds only the foreground/background framing, which restates the background parameter rather than adding new meaning.

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 gives a specific verb and resource ('Execute a shell command') plus a scope distinction ('in the foreground or background') that maps to the background parameter and to the sibling task-management tools. It stops short of naming any sibling or explicitly separating this tool from get_task_status/list_background_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 foreground/background phrasing implies that long-running work should go to the background path, but there is no explicit when-to-use, when-not-to-use, or alternative-tool guidance. An agent must infer from the siblings that background execution is followed up with get_task_status or stop_background_task.

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