Skip to main content
Glama

compare_env

Compare .env files with their templates to find missing, extra, empty, duplicated, or type-mismatched variables. Keep environment configuration documented and consistent.

Instructions

Compare .env with its template (.env.example/.sample/.template) in every env root. Reports names missing from .env, extra names the template does not document, variables empty in .env but required by the template (a # optional comment above a template line exempts it), duplicated names, and values whose type differs from the template's. Commented-out template lines (# NAME=) count as documented.

path: folder to scan. file / against: compare two specific env files instead (paths relative to path), for example file=".env.production", against=".env.example".

Input Schema

NameRequiredDescriptionDefault
fileNo
pathNo.
againstNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/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 well: it discloses the exact classes of findings, the `# optional` exemption rule, and that commented-out `# NAME=` lines count as documented. It does not state read-only/side-effect status or how `# optional` interacts with duplicates and type mismatches, leaving some behavioral gaps.

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?

Front-loaded with the core comparison, then the finding types, then parameter modes — a logical order with no filler sentences. The inline "path: ... file / against: ..." block is slightly compressed and reads awkwardly, but nothing is wasted.

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-value detail is rightly omitted, and all three parameters plus the finding categories are covered. The remaining gap is the undefined notion of an "env root" and scan scope, which an agent needs to predict what `path` will cover.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate and largely does: `path` is the folder to scan, `file` and `against` are specific env files relative to `path`, with a worked example. It does not clarify what an "env root" is or whether the scan recurses, which matters for `path` semantics.

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 first sentence names a specific verb and resource — compare .env against its template (.env.example/.sample/.template) across every env root — and the following sentence enumerates exactly what the comparison reports (missing names, extras, empty-but-required, duplicates, type mismatches). This is clearly distinct from siblings like validate_env or generate_example.

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 distinguishes the default whole-tree scan from the targeted two-file mode via file/against, with a concrete example (file=".env.production", against=".env.example"). It stops short of saying when to prefer this over validate_env or what happens if no env roots are found, so it lacks explicit alternatives/exclusions.

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