Skip to main content
Glama
aws-samples

MCP Security Scanner

Official
by aws-samples

scan_image_with_trivy

Scan container images for known vulnerabilities in OS packages and application dependencies with Trivy. Identify affected packages, fixed versions, and severity to secure deployments before release.

Instructions

Scan a container image using Trivy for vulnerabilities.

This tool scans container images for known vulnerabilities in:

  • OS packages (Alpine, Debian, Ubuntu, RHEL, etc.)

  • Application dependencies (Python, Node.js, Java, Go, etc.)

  • Base image vulnerabilities

The output is minimized to show only essential information:

  • Vulnerability ID and severity

  • Affected package and versions

  • Fixed version (if available)

  • Primary reference URL

This is particularly useful for:

  • Scanning base images used in Dockerfiles

  • Checking for vulnerabilities before deployment

  • Security audits of container images

Args: image_name: Container image to scan (e.g., nginx:latest, python:3.9, ghcr.io/owner/image:tag) severity_threshold: Minimum severity level to report (LOW, MEDIUM, HIGH, CRITICAL)

Returns: A dictionary with vulnerability findings from Trivy (minimized output)

Note: Trivy must be installed and available in PATH. Install with: - macOS: brew install trivy - Linux: See https://aquasecurity.github.io/trivy/latest/getting-started/installation/

The image will be pulled if not available locally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_nameYesContainer image name to scan (e.g., nginx:latest, ghcr.io/owner/image:tag)
return_outputNoReturn full output instead of saving to file (default: False)
severity_thresholdNoMinimum severity threshold (LOW, MEDIUM, HIGH, CRITICAL)MEDIUM

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It mentions installation requirements, image pulling, and minimized output format. However, it fails to mention the `return_output` parameter behavior, which is key: the description says 'Returns: A dictionary' but the schema for `return_output` indicates that by default it saves to file (return_output=false), not returns a dictionary. This internal inconsistency means an agent could be misled about the return behavior. The description does not disclose this crucial aspect.

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 sections (overview, output details, use cases, Args, Returns, Note). It is reasonably concise and front-loaded with the core purpose. The inclusion of installation instructions is slightly beyond the core, but they are relevant and add value without being excessive, so it earns a 4.

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

Completeness2/5

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

Despite having an output schema, the description has clear gaps. The `return_output` parameter is not covered in the description and the Returns statement conflicts with the schema. Additionally, it does not mention any registry authentication requirements or network access considerations for private images. For a security scanning tool with three parameters and no annotations, these omissions reduce completeness below the minimum viable level.

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 adds useful examples for `image_name` (e.g., nginx:latest) and severity levels, but it omits the `return_output` parameter entirely from its Args section, which could create confusion about its existence. Overall it adds some value beyond the schema but not enough to exceed the baseline given the omission.

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 specific verb+resource statement: 'Scan a container image using Trivy for vulnerabilities.' It clearly distinguishes this tool from sibling scanning tools by focusing on container images and mentions specific vulnerability categories (OS packages, application dependencies, base images).

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 clear use cases ('Scanning base images used in Dockerfiles', 'Checking for vulnerabilities before deployment', 'Security audits of container images') and explicitly indicates the tool is for container images. However, it does not explicitly name alternatives or state when not to use this tool, so it lacks the explicit 'when-not' guidance needed for a 5.

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