Skip to main content
Glama
fs-mcp-server

fs-mcp-server

by qsrahman

Shell

shell
Destructive

Execute non-interactive terminal commands and return stdout, stderr, and exit code as JSON for tests, type checks, builds, and git tasks.

Instructions

Run a shell command and return its stdout, stderr and exit code as JSON. Use for tests, type checks, builds, git and similar. Do NOT use it to read, write or edit files (use the file tools), for interactive commands (stdin is closed), for commands that never exit (dev servers, watch modes), or for destructive ones (rm -rf, git reset --hard, force pushes) unless the user asked for them. Each call is a fresh process, so cd does not persist: use cwd (default: the server's working directory). The command and any processes it started are killed after timeoutMs. Past 20000 characters stdout and stderr each keep their start and end and omit the middle; binary output is replaced by a short note.

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

Input Schema

NameRequiredDescriptionDefault
cwdNoDirectory to run the command in. Defaults to the server's working directory.
commandYesThe command to run, for example 'ls -lh' or 'git status'.
timeoutMsNoKill the command after this many milliseconds. Defaults to 30000; 0 disables the timeout.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, and the description adds substantive context beyond them: fresh process per call, no cd persistence, child processes killed on timeout, and concrete truncation behavior at 20000 characters with head/tail retention. Binary-output handling is also disclosed, which no structured field covers.

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?

Front-loaded with purpose, then usage, then runtime behavior; nearly every sentence carries distinct information. It is dense in a single block and could be broken into bullets for scanability, which is the only deduction.

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

Completeness5/5

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

For a high-risk execution tool with no output schema, the description covers return shape, process lifetime, working-directory semantics, timeout kill behavior, and output truncation. Nothing an agent needs to invoke it safely is missing.

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 100%, so the baseline is 3, but the description adds meaning the schema lacks: cwd exists because cd does not persist across calls, and timeoutMs terminates the command plus any processes it spawned. That elevates it above the schema-only baseline.

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?

Opens with a specific verb and resource ('Run a shell command') and states the return shape (stdout, stderr, exit code as JSON). It explicitly distinguishes itself from the sibling file tools, so an agent can route without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives positive cases (tests, type checks, builds, git) and names alternatives explicitly ('use the file tools'). It also enumerates the exclusion classes: interactive commands, never-exiting commands, and destructive commands unless the user asked.

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