Skip to main content
Glama

diagram_from_terraform

Generates cloud architecture diagrams from Terraform plan, state, or .tfstate JSON, mapping VPCs, subnets, and resource groups into nested boundaries and references into edges.

Instructions

Build a diagram from Terraform: terraform show -json plan.out, state JSON, or a .tfstate file.

Pass the JSON text in terraform_json, or a file path inside the configured input roots. VPC/VNet/subnet/resource-group become nested boundaries; references become edges (dashed = inferred through listeners, NICs, role assignments, etc.). Returns the generated spec so it can be refined and re-rendered.

Input Schema

NameRequiredDescriptionDefault
pathNo
titleYes
directionNoLR
output_formatsNo
render_diagramNo
terraform_jsonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare this is non-readOnly, non-idempotent, non-destructive and closed-world, so the safety bar is low. The description still adds real behavior: VPC/VNet/subnet/resource-group map to nested boundaries, references become edges, and dashed edges mean inferred relationships via listeners/NICs/role assignments. It also states the return value (the generated spec, refinable and re-renderable), which annotations cannot convey.

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?

Three tight lines: purpose first, then how to supply input, then the mapping behavior and return value. Every sentence carries information and nothing is padded.

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?

With no output schema, the description correctly states what is returned. It also covers the complex part (resource-to-boundary mapping) plus the input-root security constraint. It falls short on the remaining parameters — notably the required title and the render_diagram toggle — which an agent must infer from the schema alone.

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 0%, so the description must compensate. It does add genuine meaning for terraform_json (accepts raw JSON text) and path (must be inside configured input roots), but says nothing about title, direction, output_formats, or render_diagram — four of six parameters, including the only required one, are unexplained.

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+resource ('Build a diagram from Terraform') and enumerates the exact input artifacts it accepts (plan JSON, state JSON, .tfstate). It implicitly separates itself from diagram_from_inventory by naming Terraform as the source, but never names that sibling, so the differentiation is only partial.

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?

'Pass the JSON text in terraform_json, or a file path inside the configured input roots' gives useful guidance on which of the two source parameters to use. However, there is no statement of when to prefer this over diagram_from_inventory, nor any exclusions or prerequisites for the tool as a whole.

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