Skip to main content
Glama
badchars

mcp-security-scanner

by badchars

sast_command_injection

Analyzes source files for command injection vulnerabilities in child_process.exec(), execSync(), and spawn() with shell:true, reporting file, line, column, and dangerous expression.

Instructions

AST-scan for command injection: child_process.exec(), execSync(), spawn() with shell:true — where arguments include user-controlled input. Reports file, line, column, and the exact dangerous expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDirectory path containing source files to analyze
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool performs an AST scan and reports vulnerability details, implying a read-only operation. However, it does not explicitly state that it is non-destructive, nor does it mention permissions, side effects, or any limitations. Given the context, it is adequate but could be more explicit.

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?

The description is a single sentence that efficiently conveys the tool's purpose, target patterns, and output. It wastes no words but could benefit from slight structuring (e.g., listing functions separately). Still highly concise.

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?

Given the specialized nature of the tool and the absence of an output schema, the description adequately covers what the tool does and what it reports. It does not mention recursion depth, file extensions, or performance considerations, but for a basic SAST tool it provides sufficient completeness.

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?

The schema already fully describes the single parameter 'path' as 'Directory path containing source files to analyze' (100% coverage). The tool description does not add any additional semantic information about the parameter, such as expected file types or recursion behavior. Baseline score of 3 is appropriate since schema does the job.

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?

The description specifies a precise verb-resource combination: 'AST-scan for command injection' targeting specific Node.js functions (child_process.exec(), execSync(), spawn() with shell:true) and user-controlled input. It lists exact report fields (file, line, column, dangerous expression). This clearly distinguishes it from sibling tools like sast_code_execution or sast_path_traversal.

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 the tool is for detecting command injection vulnerabilities in Node.js source code, but it does not explicitly state when to use this tool versus alternatives (e.g., sast_code_execution for other code execution risks). No when-not-to-use guidance or prerequisites are provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/mcp-security-scanner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server