Skip to main content
Glama

explain_layers

Explains Dockerfile layer creation and estimated sizes, and identifies instruction-order issues that invalidate build cache or bloat images.

Instructions

Explain which Dockerfile instructions create image layers, with heuristic size hints (small/large and why), and list ORDER problems that invalidate the build cache or bloat the image (COPY . before dependency install, cleanup in a later layer, recursive chown after COPY, volatile build args before expensive steps). Sizes are estimates; nothing is built.

Input Schema

NameRequiredDescriptionDefault
pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does meaningful work: 'Sizes are estimates' sets accuracy expectations and 'nothing is built' discloses that the tool is a safe, side-effect-free static analysis. It also enumerates the specific defect classes it reports, so the agent knows what the output covers; it does not discuss error behavior for a missing/invalid path.

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?

One dense sentence, front-loaded with the core purpose before the heuristic and order-problem details. The four-item parenthetical is long but each example earns its place by concretizing what 'ORDER problems' means; a brief split into two sentences would read slightly better.

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?

An output schema exists, so return values need not be described, and the description adequately covers scope, accuracy caveats, and defect classes for a single-input analysis tool. The remaining gap is practical: no indication of what 'path' should contain or what happens when it does not resolve to a Dockerfile.

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

Parameters2/5

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

Schema description coverage is 0% for the single required parameter 'path', and the description never mentions it or says whether it points to a Dockerfile, a directory, or a build context. The one parameter the agent must supply is left entirely to inference, which is the opposite of compensating for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Explain which Dockerfile instructions create image layers,' and adds two concrete outputs (heuristic size hints and ORDER problems). That is clearly distinct from dockerfile_overview or lint_dockerfile in framing, but it never explicitly names an alternative, and 'list ORDER problems' overlaps enough with lint_dockerfile that an agent might hesitate between the two.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the listed pathologies (COPY . before dependency install, cleanup in a later layer, recursive chown after COPY, volatile build args) suggest when the tool is valuable, and 'nothing is built' signals a static-analysis context. There is no explicit when-to-use/when-not statement and no routing away from lint_dockerfile or fix_preview, so the agent must infer the choice.

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