Skip to main content
Glama

tf_state_addresses

Idempotent

List resource instance addresses in the current Terraform state, optionally filtered by address or id, to inspect managed resources without changing or locking state.

Instructions

List resource instance addresses in the current Terraform state (terraform state list), optionally filtered. Does not change state: never locks, never refreshes. Credential environment variables are withheld unless the operator sets TERRAFORM_CWD_MCP_ALLOW_BACKEND_CREDENTIALS=1, which passes a remote backend its own variables. Instance keys that look secret or equal a sensitive value are hidden. Executes code when any address has a string key: finding sensitive keys runs terraform show, which starts the provider plugins. A non-default workspace that does not exist is refused (reading it would create it).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tf_state_addresses"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoOnly the instance whose id attribute equals this (terraform state list -id)
dirNoTerraform root module directory (must already be initialized), inside the server's directory or TERRAFORM_CWD_MCP_ALLOWED_DIRS. Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory.
limitNoMax addresses to return (default 200)
filterNoCase-sensitive substring of the address as printed, e.g. 'module.network' or 'aws_instance.'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.0
    • changedInput schema / properties / dir / description
      Previous value: -"Terraform root module directory (must already be initialized). Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory."New value: +"Terraform root module directory (must already be initialized), inside the server's directory or TERRAFORM_CWD_MCP_ALLOWED_DIRS. Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory."
    • changedInput schema / properties / filter / description
      Previous value: -"Case-sensitive substring of the address, e.g. 'module.network' or 'aws_instance.'"New value: +"Case-sensitive substring of the address as printed, e.g. 'module.network' or 'aws_instance.'"
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Despite readOnlyHint=false, the description explains exactly why: 'Executes code when any address has a string key: finding sensitive keys runs terraform show, which starts the provider plugins.' It also discloses credential-env-var gating via TERRAFORM_CWD_MCP_ALLOW_BACKEND_CREDENTIALS, secret-value hiding, no-lock/no-refresh semantics, and the refusal of non-existent workspaces. This is genuinely additive context beyond the annotations and prevents misuse.

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?

The key safety fact ('Does not change state') is front-loaded in the second sentence, and each subsequent sentence carries a distinct operational caveat. It is dense but every clause earns its place; only minor compression is possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with code-execution side effects, credential handling, and secret redaction, the description covers all the surprising behaviors an agent must know before invoking it. With no output schema needed and full schema coverage, nothing material is missing.

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%, so the four parameters (id, dir, limit, filter) are already fully documented in the schema, and the description only echoes that results are 'optionally filtered.' It adds no syntax or interaction detail beyond the schema, so the baseline of 3 applies.

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, 'List resource instance addresses in the current Terraform state,' and anchors it to the underlying command (terraform state list). It does not name any sibling or explicitly contrast itself with them, so it stops short of a 5, but the scope is unmistakable.

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 implied by 'optionally filtered' and by the filtering behavior, and the workspace refusal clause clarifies a boundary condition. However, there is no explicit statement of when to prefer this over alternatives such as tf_show_resource or tf_get_schema, so guidance remains inferred.

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