Skip to main content
Glama

diff_resource

Show attribute-level before-and-after diffs for a single Terraform resource, including nested paths, with unknown values marked and sensitive values masked.

Instructions

Attribute-level diff (before -> after) for one resource, with nested paths such as ingress[0].cidr_blocks[0]. Unknown values show as (known after apply). Sensitive values are ALWAYS shown as (sensitive): by Terraform's sensitivity masks and, as a second layer, by attribute names that look like credentials (password, secret, token, key...).

address: exact address as in the plan, e.g. aws_instance.web["a b"] or module.net.aws_vpc.main[0]. Use list_changes to find addresses; unknown addresses return close matches.

Input Schema

NameRequiredDescriptionDefault
pathYes
addressYes
max_attributesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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 (known after apply) placeholder for unknown values, the two-layer sensitivity masking including the credential-name heuristic, and the fuzzy-match fallback for bad addresses. It stops short of stating that the operation is read-only or how output is truncated, which are the remaining 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 purpose, then behavior, then the address format guidance. Every sentence carries information, though the sensitivity sentence is dense and the address paragraph could be tightened.

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?

An output schema exists, so return values need not be described, and the diff semantics are well covered. However, for a 3-parameter tool with zero schema coverage, leaving the required 'path' parameter and the 'max_attributes' cap undocumented is a meaningful completeness gap.

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 description coverage is 0%, so the description must compensate. It does so thoroughly for 'address' (exact plan address, with quoted-index and module examples), but 'path' — a required parameter — is never explained, and 'max_attributes' (default 200) is not mentioned at all, leaving truncation behavior undefined.

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?

States a specific verb and resource ('Attribute-level diff (before -> after) for one resource') plus the scope of nested paths, which immediately separates it from plan_summary and risky_changes. An agent can tell this is the per-resource drill-down tool without opening the schema.

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?

Explicitly routes the agent to list_changes for discovering addresses and states what happens with an unknown address (close matches returned). It does not say when to prefer risky_changes or explain_replace over this tool, so the alternative-selection guidance is partial rather than complete.

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