Skip to main content
Glama
terraform-best-practices-mcp-server

terraform-best-practices-mcp-server

run_trivy

Scan Terraform code with Trivy to detect misconfigurations and security issues before deployment. Provide the project path and optional CLI arguments or timeout.

Instructions

Run trivy config scanning against Terraform code.

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": "run_trivy"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoTerraform project path to scan. Must not start with '-'..
extraArgsNoExtra positional CLI arguments. Values starting with '-' are rejected.
timeoutMsNoOptional command timeout in milliseconds.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv5.2.66
    • changedInput schema / properties / extraArgs / description
      Previous value: -"Extra CLI arguments."New value: +"Extra positional CLI arguments. Values starting with '-' are rejected."
    • changedInput schema / properties / path / description
      Previous value: -"Terraform project path to scan."New value: +"Terraform project path to scan. Must not start with '-'."
  2. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, yet it discloses only that a scan runs. It does not say what class of findings trivy reports (misconfigurations versus vulnerabilities), whether it requires network access to fetch its policy database, whether it is read-only, or how findings are returned. For a scanner invoked against a codebase, those are meaningful omissions.

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?

A single front-loaded sentence with no filler. It is efficient, though the terseness borders on under-specification given the tool's competitive sibling set.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (3 params, all optional, no nested objects) and has no output schema, so the description should explain what a scan produces and when it is the right scanner. It explains neither, and with no annotations the definition leaves real gaps for an agent deciding between the four scanning tools.

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 100%, so path, extraArgs, and timeoutMs are already documented, including the rejection of values starting with '-' and the 600000ms cap. The description adds nothing beyond the schema, which is acceptable but not value-adding.

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 verb and resource: run trivy config scanning against Terraform code. That is clearly distinct from non-scanning siblings like generate_cost_report or analyze_state_management, though it does not explain how it differs from the closely related run_checkov, run_kics, and run_tflint scanners.

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

Usage Guidelines2/5

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

The description gives no when-to-use guidance and no exclusions, despite four sibling tools (run_checkov, run_kics, run_tflint, suggest_security_hardening) that an agent could plausibly confuse with it. An agent must infer that 'trivy config' means misconfiguration scanning and that the choice among the scanners is arbitrary.

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