Skip to main content
Glama
Project Scope MCP Server

Project Scope MCP Server

validate_shell_input

Validates shell input to block command injection by detecting dangerous metacharacters, environment variable tricks, and encoding bypasses before execution.

Instructions

Prevent command injection (RCE). Validates shell input for dangerous metacharacters (&, |, ;, $(), backticks), environment variable tricks, and encoding bypasses. Run this before executing any shell command generated by an LLM or received from user input.

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": {
      "input": "<input>"
    },
    "name": "validate_shell_input"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoValidation mode: 'strict' blocks threats, 'advisory' provides warnings (default: strict)
inputYesThe shell command or string to validate
sensitivityNoDetection sensitivity: high=aggressive, medium=balanced, low=high-confidence only (default: medium)
allowedCommandsNoList of allowed commands to exclude from threat detection (e.g., ['ls', 'cat', 'echo'])

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the behavioral burden. It discloses the threat model and detection surface well, but says nothing about what the tool returns (a verdict? a flag? a sanitized string?), whether it is purely side-effect free, or how the strict mode 'blocking' manifests to the caller — a notable gap for a security gate with no output schema.

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?

Three sentences, front-loaded with the risk it mitigates, then the detection scope, then the call condition. No filler or restated title.

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

Completeness3/5

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

For a 4-parameter security validator with full schema coverage but no annotations or output schema, the description covers purpose and timing adequately. It leaves the caller unsure what a successful invocation yields and how a detected threat is surfaced, which matters for wiring this into an execution pipeline.

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% and includes enum value explanations for mode and sensitivity, so parameters are already well documented in structured form. The description adds no parameter-level meaning (e.g., how allowedCommands interacts with strict mode) beyond what the schema states, so baseline 3 applies.

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 ('Validates') and resource ('shell input') and enumerates the exact threat classes it targets (metacharacters, env-var tricks, encoding bypasses). The resource scope is unmistakably distinct from the sibling validators validate_sql_query and validate_file_path.

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

Usage Guidelines4/5

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

Gives an explicit trigger: run before executing any shell command generated by an LLM or sourced from user input. It does not state when the tool is unnecessary (e.g., a hardcoded literal command) or how mode/sensitivity tradeoffs should drive the choice, so it falls short of full when/when-not guidance.

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