Skip to main content
Glama

tf_module_interface

Read-onlyIdempotent

Inspect a Terraform module's variables, outputs, and module calls in the current working directory to understand its interface and usage before configuring or calling it.

Instructions

Variables (exact type expression, required/optional, default, sensitive/nullable/ephemeral, validation count), outputs and module calls of a module in THIS working directory: the root, a local module directory, or an installed module by address (module.network, resolved through .terraform/modules/modules.json, so downloaded registry/git modules work). Module calls are checked against what is installed. For public registry modules you have not installed, use the official terraform MCP server.

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

Input Schema

NameRequiredDescriptionDefault
dirNoTerraform root module directory (need not be initialized for the root or a local path), inside the server's directory or TERRAFORM_CWD_MCP_ALLOWED_DIRS. Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory.
moduleNoModule to describe: omitted = the root; a module address like 'module.network' or 'module.a.module.b' (resolved through .terraform/modules/modules.json, so downloaded registry/git modules work); or a directory path relative to dir, inside the directories this server may use
description_charsNoTruncate each description to this many characters; 0 = no limit (default 160)

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 (need not be initialized for the root or a local path). Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory."New value: +"Terraform root module directory (need not be initialized for the root or a local path), 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 / module / description
      Previous value: -"Module to describe: omitted = the root; a module address like 'module.network' or 'module.a.module.b' (resolved through .terraform/modules/modules.json, so downloaded registry/git modules work); or a directory path relative to dir"New value: +"Module to describe: omitted = the root; a module address like 'module.network' or 'module.a.module.b' (resolved through .terraform/modules/modules.json, so downloaded registry/git modules work); or a directory path relative to dir, inside the directories this server may use"
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is largely covered. The description adds real context: module-call resolution goes through .terraform/modules/modules.json, module calls are checked against what is installed, and descriptions are truncated per description_chars. No return-shape or failure-mode detail beyond that.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the returned content, which is good, but the first sentence is a long parenthetical-heavy run-on mixing return fields, scope, and resolution mechanics. The information is useful but could be split for scanability.

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 carries the load of describing return values, and it does so explicitly (per-variable attributes plus outputs and module calls). Complete enough to call correctly; only the exact response format and error behavior on an unresolved module address remain 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 coverage is 100%, so the schema already documents dir, module, and description_chars including the modules.json resolution and the TERRAFORM_CWD_MCP_DIR default. The description mostly restates that content rather than adding new semantics, so baseline 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?

States a specific resource (variables with exact type expression, required/optional, default, sensitive/nullable/ephemeral, validation count; outputs; module calls) and a specific scope (modules in THIS working directory). The mechanism (resolved through .terraform/modules/modules.json) plus the handoff for uninstalled public registry modules separates it from the other tf_* tools, though it never names a sibling directly.

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 a clear positive condition (root, local module directory, or an installed module by address) and an explicit exclusion with an alternative: public registry modules you have not installed should go to the official terraform MCP server. It does not say when to prefer this over siblings like tf_get_schema, but the when-not guidance is concrete enough to route an agent.

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