Skip to main content
Glama

scan_terraform

Identify security misconfigurations in Terraform HCL source code by scanning for issues like public-read S3 buckets, open security groups, and unencrypted RDS instances, with severity-graded findings per resource block.

Instructions

Scan Terraform HCL source for security misconfigurations.

Returns findings (severity-graded) tied to specific resource blocks — e.g. aws_s3_bucket with acl = public-read, aws_security_group with cidr_blocks = 0.0.0.0/0 on sensitive ports, aws_rds_instance with storage_encrypted = false.

When to use: You have existing Terraform code (not an ArchSpec) and want an immediate security audit. For ArchSpec-level audit, use security_scan.

Behavior: Pure computation — no LLM, no network. Does not run Terraform or touch cloud. Safe for scanning untrusted HCL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hcl_contentYesRaw Terraform HCL source code to scan. Typically the contents of a `main.tf` file or a concatenated module. The scanner parses resource blocks directly; no terraform binary is invoked.
Behavior5/5

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

No annotations provided, so description carries full burden. It discloses that the tool is pure computation with no LLM, no network, does not run Terraform or touch cloud, and is safe for scanning untrusted HCL. No contradiction with annotations.

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?

Description is well-structured: first sentence states purpose, then examples, when-to-use, and behavior. Every sentence adds value, no fluff. Length appropriate for the information conveyed.

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?

Tool has one parameter and is security-related. Description covers purpose, usage, behavior, and parameter details. Mentions output (severity-graded findings on resource blocks). Complete for this complexity level.

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. Description adds significant value by explaining the parameter is raw HCL source code, typical usage (main.tf), and how the scanner works (parses directly, no terraform binary). Just above baseline.

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?

Description clearly states it scans Terraform HCL for security misconfigurations, using specific verb 'scan' and resource 'Terraform HCL'. It distinguishes itself from sibling tool security_scan which is for ArchSpec-level audit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'When to use' section specifies to use this tool when you have existing Terraform code (not an ArchSpec) for an immediate security audit, and directs to security_scan for ArchSpec-level audit. Provides clear context and alternative.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xmpuspus/cloudwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server