Skip to main content
Glama

Cmdshell

cmdshell

Runs a restricted set of Linux/Unix commands with validated arguments to support controlled local automation without full shell access.

Instructions

Runs one of the configured Linux/Unix commands.

Allowed commands: ["ls", "pwd", "date", "cat", "grep", "egrep", "whoami", "head", "tail", "sed", "wc", "file", "du", "df", "free", "ps", "uname", "hostname", "uptime", "w", "last", "mkdir", "cp", "mv", "awk", "jq"] Arguments are checked with _local_path_error: empty arguments are allowed; absolute paths and paths containing a '..' component are rejected.

Args: command: The command name (for example, 'ls'). It must be in the allowed commands list. args: A list of command arguments/flags (for example, ['-la', '.txt']). Put a glob in double quotes (for example, ['".txt"']) to pass it literally instead of expanding it into filenames. Pipes and redirects are not allowed.

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

Input Schema

NameRequiredDescriptionDefault
argsNo
commandYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does substantial work: it discloses the command allowlist, the path-validation rule, the prohibition on pipes/redirects, and the glob-escaping behavior. The notable gap is that it never says the tool can mutate state (mkdir, cp, mv are on the allowlist) or what working directory relative paths resolve against.

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?

Purpose and the allowlist are front-loaded, and each subsequent paragraph adds a distinct rule rather than repeating. The docstring-style 'Args:' block and the mention of an internal function name are mild noise, but overall it is tight for the amount of constraint it conveys.

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 need not be explained, and the description covers the two parameters and the main safety constraints thoroughly. What is missing is the execution context an agent needs to predict behavior: the working directory, whether these commands mutate the filesystem, and any timeout or output-size limits.

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 description coverage is 0% and the schema defines 'command' as a bare string with no enum, so the description's inline allowlist is doing essential work that the schema cannot. It also explains the 'args' list semantics, including the non-obvious quoting rule for globs and the ban on pipes/redirects. The reference to the internal '_local_path_error' check is opaque but conveys the validation rule.

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 ('Runs one of the configured Linux/Unix commands') and immediately bounds the scope with an explicit allowlist of 27 command names. It implicitly distinguishes itself from the file-manipulation siblings, but never states the relationship explicitly (e.g. 'prefer readFile over cat'), so it stops short of a 5.

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 constraints are well specified in the negative direction: no pipes, no redirects, no absolute paths, no '..' components, and globs must be double-quoted to avoid expansion. However, there is no positive when-to-use guidance and no routing to alternatives such as readFile, listFiles, or grep, even though the sibling set overlaps heavily with cat/ls/grep here.

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