Skip to main content
Glama

Inspect Dockerfile

inspect_dockerfile
Read-onlyIdempotent

Parse a Dockerfile to extract base images, exposed ports, workdir, user, entrypoint, env keys, and healthcheck, then reveal the listening port for Kubernetes migration.

Instructions

Parse a Dockerfile into the facts a migration needs: base images and build stages, EXPOSE ports, WORKDIR, USER, ENTRYPOINT/CMD, declared ENV keys and the HEALTHCHECK. Use it to learn which port an image actually listens on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cmdNo
pathYes
userNo
notesNo
stagesNo
volumesNo
workdirNo
env_keysNo
build_argsNo
entrypointNo
healthcheckNo
multi_stageNo
exposed_portsNo
final_base_imageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds value beyond these by disclosing what the parser extracts and clarifying that EXPOSE ports reflect the actual listening port — behavior an agent would not know from annotations alone. It does not contradict the safety profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero fluff. The first sentence front-loads the purpose and enumerates the extracted facts; the second provides a practical usage example. Every word earns its place, and the structure supports quick agent comprehension.

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 tool is simple (1 parameter, read-only, idempotent) and an output schema is present, so the description does not need to explain return values. It covers what the tool does, what facts it extracts, and when to use it. The only completeness gap is the underspecified 'path' parameter, which is minor given the tool's simplicity.

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?

With schema description coverage at 0% and only one parameter ('path'), the description carries the burden of explaining the parameter. It implies that 'path' points to a Dockerfile (via 'Parse a Dockerfile' and the tool name), but it never explicitly defines the expected format, whether a directory is accepted, or if the path is local/remote. The meaning is inferable but not fully specified.

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 names the specific verb 'Parse' and the resource 'Dockerfile', then enumerates the exact facts returned (base images, build stages, EXPOSE ports, WORKDIR, USER, ENTRYPOINT/CMD, ENV keys, HEALTHCHECK). It clearly differentiates from sibling tools like inspect_compose and inspect_project by defining the Dockerfile-specific scope and even provides a concrete use case ('learn which port an image actually listens on').

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 gives clear context: use this tool when you need Dockerfile facts for a migration, and specifically to determine the actual listening port. It does not explicitly name sibling tools as alternatives, nor does it state when not to use it, so it falls short of a 5 but is well above providing no guidance.

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