Skip to main content
Glama

Terraform show

tf_show
Read-only

Fetch current Terraform or OpenTofu state as structured JSON with resource types and attributes, enabling AI workflows to inspect infrastructure without parsing raw CLI output.

Instructions

Show current Terraform state as structured JSON. Returns resource summary with types and attributes.

Input Schema

NameRequiredDescriptionDefault
cwdYesTerraform project directory
binaryNoterraform or tofu (default $TF_BINARY, else terraform)

Output Schema

NameRequiredDescriptionDefault
countYes
retainedNo
resourcesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

B3.2/5.0
Behavior3/5

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

readOnlyHint=true already declares this is a safe read, so the description's job is to add context. It does note the output is structured JSON with resource types and attributes, which is mild value, but it says nothing beyond that – no pagination, size limits, or behavior when no state exists. With annotations carrying the safety profile, a 3 is appropriate.

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?

Two short sentences, front-loaded with the primary action and output format; zero waste. The second sentence partially restates the return shape that the output schema already encodes, but it is not bloated.

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 readOnly annotation covers safety. However, given many sibling tf_* tools that also inspect state, the description leaves the selection decision under-specified, which is the main gap for an agent choosing a tool.

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 coverage is 100%, and both parameters (cwd, binary with enum and default fallback) are fully documented in the schema. The description adds no parameter meaning beyond that, which is the expected baseline when the schema does the work.

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?

States a specific verb and resource: 'Show current Terraform state as structured JSON', plus what is returned (resource summary with types and attributes). It does not explicitly distinguish itself from the close sibling tf_state_list, which likely also reads state, so the boundary between the two is left to inference.

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

Usage Guidelines2/5

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

There is no guidance on when to use this rather than tf_state_list or the other tf_* tools, and no prerequisites or exclusions are mentioned. The agent must infer usage from the name alone.

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