Skip to main content
Glama

Cmdshell

cmdshell

Runs configured Linux/Unix commands such as ls, grep, and cat within a sandboxed directory, enabling AI agents to inspect files and system details 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, 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
commandYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.1/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 disclose real behavior: the allow-list, the _local_path_error validation (empty args, absolute paths, '..' components rejected), glob quoting rules, and the pipe/redirect prohibition. It does not warn that mkdir/cp/mv are mutating, nor mention working directory or sandboxing, which leaves a gap for a command executor.

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 is front-loaded in one sentence, followed by constraints, then per-parameter notes in a consistent pattern. The allow-list is long but earns its place as an enforced enum; the only mild redundancy is restating the allow-list rule in the 'command' parameter note.

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 no explanation, and the description covers inputs, validation, and forbidden shell features. What remains missing for a no-annotation command executor is the risk profile of mutating commands and the execution context (cwd, permissions).

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 0%, so the description must compensate, and it does: 'command' must be in the enumerated allow-list, and 'args' is a list of flags with explicit glob-quoting semantics. It adds meaning beyond the bare anyOf/string schema, though it omits the default null handling for args.

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?

States a specific verb and resource ('Runs one of the configured Linux/Unix commands') and enumerates the exact command set, which immediately separates it from every sibling (writeFile, readFile, listFiles, fetch, etc.). An agent can classify it as a constrained shell executor without opening the schema.

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 implies when the tool applies by listing allowed commands and forbidding pipes/redirects, but it never says when to prefer it over readFile/listFiles or what to use instead for reads. Usage is inferable from the constraints rather than stated, so this is the minimum-viable tier.

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