Skip to main content
Glama
aws-samples

MCP Security Scanner

Official
by aws-samples

scan_directory_with_grype

Scan a project directory with Grype to detect known vulnerabilities in dependencies. Covers Cargo.lock, package.json, requirements.txt, and more ecosystems.

Instructions

Scan an entire project directory with Grype for dependency vulnerabilities.

This tool scans all dependency files in a directory (Cargo.lock, package.json, requirements.txt, etc.) and reports known vulnerabilities across all ecosystems.

Unlike scan_with_ash which scans code snippets, this tool scans the actual project directory to find vulnerabilities in all dependencies.

Supported ecosystems:

  • Rust (Cargo.lock)

  • Python (requirements.txt, setup.py, Pipfile.lock)

  • Node.js (package.json, package-lock.json, yarn.lock)

  • Java (pom.xml, build.gradle)

  • Go (go.mod)

  • Ruby (Gemfile.lock)

  • And many more

Args: directory_path: Path to the directory to scan (relative or absolute) severity_threshold: Minimum severity level to report (LOW, MEDIUM, HIGH, CRITICAL)

Returns: A dictionary with vulnerability findings from Grype

Note: Grype must be installed and available in PATH. Install with: - macOS: brew install grype - Linux: curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
return_outputNoReturn full output instead of saving to file (default: False)
directory_pathYesPath to the directory to scan
severity_thresholdNoMinimum severity threshold (LOW, MEDIUM, HIGH, CRITICAL)MEDIUM

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the prerequisite that Grype must be installed and available in PATH, and notes that it reports known vulnerabilities. However, it does not mention potential side effects like downloading vulnerability databases or network access, which a security scanner might perform.

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 well-structured with clear sections (Supported ecosystems, Args, Returns, Note) and front-loaded with its purpose. It is somewhat verbose with installation instructions and ecosystem lists, but these are useful and not excessive.

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 output schema exists, the description does not need to elaborate beyond the dictionary return. It covers dependencies scanned, supported ecosystems, arguments, and installation prerequisites. It lacks error-handling details but is otherwise complete for typical usage.

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?

The input schema already covers all three parameters (100% coverage). The description adds value by specifying that directory_path can be relative or absolute and that severity_threshold is the minimum severity to report. It does not mention the return_output parameter, but the schema describes it.

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 clearly states the tool scans a project directory with Grype for dependency vulnerabilities, using a specific verb and resource. It explicitly distinguishes itself from scan_with_ash by noting that tool scans code snippets while this one scans the project directory for dependency files.

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?

The description provides context on when to use this tool versus scan_with_ash, and lists supported ecosystems. However, it does not explicitly mention exclusions or compare to other directory scanners like scan_with_trivy or scan_directory_with_syft, so the guidance is not comprehensive.

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/aws-samples/sample-mcp-security-scanner'

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