Skip to main content
Glama

tf_upgrade_impact

Idempotent

Determines what breaks when a pinned Terraform provider is upgraded or downgraded to an exact version by comparing used schemas, checking constraints, and running terraform validate on a temp copy.

Instructions

What breaks if a pinned provider is upgraded (or downgraded) to an exact version: compares the pinned schema with the target's for the arguments, nested blocks and attribute reads this configuration uses (root and installed modules), checks version constraints, and confirms with terraform validate on a temp copy. Disabled unless the operator sets TERRAFORM_CWD_MCP_ALLOW_UPGRADE=1. Executes code: it downloads the target provider named through the lock file into a cache (temp dirs only; never touches dir) and runs that plugin and the pinned ones, with credential environment variables removed. For the latest version number or upgrade guides, use the official terraform MCP server.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "provider": "<provider>",
      "version": "<version>"
    },
    "name": "tf_upgrade_impact"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
versionYesExact target version, e.g. 6.0.0 (not a constraint)
providerYesProvider address as pinned, e.g. hashicorp/aws or registry.terraform.io/hashicorp/aws
validateNoConfirm with terraform validate on a temp copy (offline once the target is downloaded)
include_unusedNoAlso list target-version changes to types/arguments this configuration does not use

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field 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."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations, it discloses the execution model: the target provider is downloaded via the lock file into a temp cache, never touching the working directory, and the plugin runs with credential environment variables stripped. It also reveals the tool is gated behind an environment variable and that validate runs on a temp copy, which is exactly the context an agent needs before invoking a non-readOnly tool.

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 purpose is front-loaded in the first clause, and the later sentences cover gating, execution safety, and the out-of-scope redirect with no filler. The sentences are long and clause-heavy, which costs a little scanning speed but no content 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?

For a multi-step analysis tool with no output schema, it conveys enough about what is checked (schema diff, version constraints, validate) for an agent to predict the result, plus all gating and safety context. It does not describe the shape of the comparison report, leaving some uncertainty about what comes back.

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%, so the baseline is 3. The description adds only marginal meaning, clarifying that the analysis covers symbols 'this configuration uses' (the include_unused default) and that the target must be an exact version rather than a constraint, which the schema already states.

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 description opens with a concrete question it answers ('What breaks if a pinned provider is upgraded (or downgraded) to an exact version') and specifies the comparison surface (arguments, nested blocks, attribute reads across root and installed modules). This is a distinct verb+resource that an agent can separate from schema-reading siblings like tf_get_schema without opening a 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?

It gives clear preconditions (exact version, not a constraint; directory must already be initialized; operator must set TERRAFORM_CWD_MCP_ALLOW_UPGRADE=1) and redirects out-of-scope needs to the official terraform MCP server for latest versions and upgrade guides. It stops short of naming when a sibling such as tf_check_arguments would be the better call.

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