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
| Name | Required | Description | Default |
|---|---|---|---|
| save_sbom | No | Save full SBOM to file (default: False, only returns summary) | |
| output_format | No | Output format (json, cyclonedx-json, spdx-json, table) | json |
| directory_path | Yes | Path to the directory to scan |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |