Skip to main content
Glama

scan_dockerfile

Scan a Dockerfile for security misconfigurations using Trivy before building. Detects missing USER, 'latest' tags, hardcoded secrets, missing HEALTHCHECK, and ADD usage. Requires trivy CLI installed.

Instructions

Scans a Dockerfile for security misconfigurations using Trivy's config scanner — BEFORE the image is even built. Flags things like: missing USER directive (container would run as root), use of the "latest" tag, hardcoded secrets in ENV/ARG, missing HEALTHCHECK, and use of ADD instead of COPY. Requires the trivy CLI installed and on PATH (https://trivy.dev).

Args: dockerfile_path: full path to an existing Dockerfile on this machine. Accepts either a Windows path ("C:\path\Dockerfile") or a Git Bash style path ("/c/path/Dockerfile"). severity: comma-separated severities to include (default "CRITICAL,HIGH")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
severityNoCRITICAL,HIGH
dockerfile_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

The description implies read-only scanning behavior and indicates it produces findings ('Flags things like...'), but it does not specify the output format, return value, error behavior, or whether it modifies anything. With no annotations, this transparency is only partial.

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 efficiently structured with a clear opening statement, a useful list of example checks, a prerequisite, and parameter details. It is slightly longer than strictly necessary but all content contributes to understanding, and the structure is logical.

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

Completeness3/5

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

The description covers the tool's purpose, prerequisites, and parameters adequately. However, it lacks information about the output format or exit/error behavior, which is important for a scanning tool. It also does not mention if severity values are validated or constrained, leaving some operational gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains both parameters in detail beyond the bare schema: dockerfile_path is described with path format examples (Windows and Git Bash), and severity is described as comma-separated with a default value. This fully covers the schema's 0% description coverage.

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 primary function: 'Scans a Dockerfile for security misconfigurations using Trivy's config scanner.' It also adds differentiating context with 'BEFORE the image is even built' and lists specific findings, distinguishing it from sibling tools like scan_image.

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?

It gives practical usage guidance by noting the prerequisite (trivy CLI on PATH) and the timing ('BEFORE the image is even built'). However, it does not explicitly contrast with alternatives like lint_dockerfile or audit_dockerfile, so the when-to-use is somewhat implicit rather than explicit.

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

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/Chandrakant1988/https-github.com-Theo-Gkisis-mcpdockery'

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