Skip to main content
Glama
aws-samples

MCP Security Scanner

Official
by aws-samples

scan_directory_with_syft

Scan a project directory with Syft to generate a Software Bill of Materials (SBOM). Get an inventory of all software components and dependencies for compliance and vulnerability scanning.

Instructions

Scan an entire project directory with Syft to generate Software Bill of Materials (SBOM).

This tool catalogs all software components and dependencies in a directory using Syft. Unlike vulnerability scanners, Syft creates an inventory (SBOM) of what's in your software.

Syft catalogs:

  • Container images (Docker, OCI)

  • Filesystems and directories

  • Archive files (tar, zip)

  • Language-specific packages:

    • Python (pip, poetry, pipenv)

    • JavaScript/Node (npm, yarn, pnpm)

    • Java (Maven, Gradle)

    • Go modules

    • Ruby gems

    • Rust crates

    • PHP composer

    • .NET/C#

    • And many more

By default, only a summary is returned. Set save_sbom=True to save the full SBOM to a file in the .sbom directory at the workspace root.

The SBOM file can be used with Grype for vulnerability scanning or for compliance/auditing purposes.

Args: directory_path: Path to the directory to scan (relative or absolute) output_format: Output format - json (default), cyclonedx-json, spdx-json, or table save_sbom: Save full SBOM to file (default: False, only returns summary)

Returns: A dictionary with: - total_packages: Total number of packages found - type_counts: Package counts by type - language_counts: Package counts by language - timestamp: Scan timestamp

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
save_sbomNoSave full SBOM to file (default: False, only returns summary)
output_formatNoOutput format (json, cyclonedx-json, spdx-json, table)json
directory_pathYesPath to the directory to scan

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full transparency burden. It discloses that only a summary is returned by default, that save_sbom=True writes to a .sbom directory, the output format options, the exact return dictionary structure, and the prerequisite that Syft must be installed (with installation commands). It does not explicitly state it is read-only/non-destructive, but the catalog/inventory language strongly implies it. This is rich behavioral context beyond the minimal, but not exhaustive enough for a 5.

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 and front-loaded with a clear purpose statement. It uses headings, bullet points, and concise sections for behavior, parameters, returns, and installation. While the supported package list is long, it is useful and directly relevant to an SBOM tool. Every section serves a purpose, and the overall structure is easy to scan.

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?

The description covers the purpose, usage context, parameters, return format, and installation prerequisites. It differentiates the tool from vulnerability scanner siblings and explains the downstream use of the generated SBOM. Given the tool's moderate complexity, this is sufficiently complete for an agent to invoke it correctly, though it could mention edge cases like nonexistent directories or recursive scanning behavior.

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 coverage is 100%, so the baseline is 3. The description's Args section largely repeats the schema descriptions, adding only minor clarifications like 'relative or absolute' for directory_path and spelling out the output_format options (which are already in the schema). This adds marginal value beyond the schema, so a 3 is appropriate.

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 opens with a clear, specific statement: 'Scan an entire project directory with Syft to generate Software Bill of Materials (SBOM).' It explicitly distinguishes the tool from vulnerability scanners, which is a key differentiator among the many scanning siblings. The verb and resource are precise, leaving no ambiguity about what the tool does.

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 clearly states this is for generating an SBOM inventory, not for vulnerability scanning, and even suggests using Grype later for vulnerability scanning. It gives clear context on when to use the tool, but it doesn't explicitly name sibling alternatives or state exclusions (e.g., 'use scan_directory_with_grype for vulnerabilities'). This is a clear context without explicit alternative naming, matching a 4.

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