Skip to main content
Glama

Terraform state list

tf_state_list
Read-only

List Terraform or OpenTofu state resources to get resource addresses and a byType rollup for large states. Use it to inspect tracked infrastructure before planning changes or debugging drift.

Instructions

List resources in Terraform state. Returns the resource addresses, plus a byType rollup once there are more than 20 (type, name, and module are readable from each address).

Input Schema

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

Output Schema

NameRequiredDescriptionDefault
byTypeNo
retainedNo
resourcesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.6/5.0
Behavior4/5

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

readOnlyHint=true already establishes the safety profile, so the description only needs to add operational context — and it does, disclosing that a byType rollup appears once results exceed 20 entries. That threshold behavior is not derivable from the annotations and directly affects how an agent interprets the response. It does not mention failure modes (missing state file, init requirements), which keeps it off a 5.

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 filler, with the core purpose front-loaded before the return-shape detail. Every clause conveys actionable information.

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 read-only, has a fully documented two-parameter schema, and ships an output schema, so the description need not explain return values; the rollup note is a bonus. Coverage is slightly incomplete only in that prerequisites (initialized project, existing state) are unstated.

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 100% for both parameters (cwd, binary with enum and default documented), so the schema already carries parameter meaning. The description adds nothing about cwd resolution or the terraform/tofu binary choice, making this a baseline 3.

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 names a specific verb and resource ("List resources in Terraform state") and specifies the unit returned (resource addresses), which is meaningfully different from what tf_show or tf_outputs return. It stops short of naming any sibling to contrast with, so an agent must infer the boundary itself.

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 when-to-use or when-not-to-use guidance, and no alternative tool is named despite several neighbors (tf_show, tf_modules_summary, tf_outputs) that could plausibly be confused with an inventory listing. The intended context is only implied by the tool name.

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