Skip to main content
Glama

tf_summarize_plan

Idempotent

Summarizes saved Terraform plans into changes—replaces/destroys, updates, creates, imports, moves, drift, outputs, and destroy warnings—so you can review impact without reading full JSON.

Instructions

Summarize a saved Terraform plan: deletes and replaces first (with the attribute that forces each replace), updates with changed paths, creates, imports, moves, forgets, drift and output changes, plus a destroy warning that names renames needing a moved block. Pass plan_file (binary from terraform plan -out, rendered with terraform show -json in dir, or a plan JSON file) or plan_json (e.g. from the official terraform MCP server's get_plan_json_output(plan_id) for an HCP run; get the plan id from its get_run_details). Prints no values: sensitive paths are truncated, import IDs omitted. plan_json and JSON files are unverified caller input: their shape is checked, but nothing proves Terraform produced them. plan_file must be inside dir. Executes code for a binary plan: terraform show starts the provider plugins (credential environment variables removed).

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_summarize_plan"
  }
}

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.
max_pathsNoChanged attribute paths listed per updated resource (default 8)
plan_fileNoSaved plan (binary from `terraform plan -out`, rendered here with `terraform show -json` in `dir`) or a plan JSON file, inside dir; relative paths resolve against dir
plan_jsonNoUnverified plan JSON text, e.g. from the official terraform MCP server's get_plan_json_output
max_per_sectionNoMax entries listed per section (default 50)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 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 / plan_file / description
      Previous value: -"Saved plan (binary from `terraform plan -out`, rendered here with `terraform show -json` in `dir`) or a plan JSON file; relative paths resolve against dir"New value: +"Saved plan (binary from `terraform plan -out`, rendered here with `terraform show -json` in `dir`) or a plan JSON file, inside dir; relative paths resolve against dir"
    • changedInput schema / properties / plan_json / description
      Previous value: -"Plan JSON text, e.g. from the official terraform MCP server's get_plan_json_output"New value: +"Unverified plan JSON text, e.g. from the official terraform MCP server's get_plan_json_output"
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: output is redacted (no values, sensitive paths truncated, import IDs omitted), binary plans execute provider plugins via `terraform show` with credential env vars stripped, and plan_file is confined to dir. These claims are consistent with openWorldHint=true, readOnlyHint=false and destructiveHint=false (it executes code but only reads/prints).

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 purpose, then input modes, then output redaction, then safety caveats — a sensible ordering. It is dense and the opening sentence is a long list that could be broken up, but no sentence is filler.

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?

With no output schema, the description carries the return burden and does so: it specifies the sections emitted and that sensitive values are omitted. Combined with fully described parameters and annotations, an agent has everything needed to call this correctly and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description still earns credit by explaining provenance for plan_file vs plan_json and by reiterating the containment constraint (plan_file must be inside dir). It doesn't add much on max_paths or max_per_section beyond the schema, which caps it below 5.

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 ("Summarize a saved Terraform plan") and then enumerates exactly what the summary covers: deletes/replaces with forcing attributes, updates with changed paths, creates, imports, moves, forgets, drift, output changes, destroy warnings. Against siblings like tf_show_resource or tf_upgrade_impact, an agent can immediately tell this is the plan-digest tool, not a state or schema tool.

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?

Gives clear input-mode context: use plan_file for a binary from `terraform plan -out` or a plan JSON file, use plan_json (e.g. from the official terraform MCP server's get_plan_json_output, id from get_run_details) for HCP runs. It also warns that plan_json/JSON files are unverified caller input. It stops short of saying when to prefer this over a sibling or what to do when no plan exists, so no explicit exclusions.

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