Skip to main content
Glama

Generate Terraform for a whole compartment

generate_compartment_terraform
Read-onlyIdempotent

Discover all resources in an OCI compartment and emit a Terraform module that reproduces them. Unrecognised types become annotated skeletons.

Instructions

Discover every resource in a compartment and emit a Terraform module (provider variables + one block per resource) to reproduce it. Unrecognised types become annotated skeletons.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartmentIdYesCompartment OCID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.4
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations supply readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so safety semantics are covered. The description adds genuinely new behavioral context beyond annotations: the output is a Terraform module with provider variables plus one block per resource, and unrecognised resource types are emitted as annotated skeletons. Return shape and edge-case handling are disclosed, which the annotations do not provide.

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?

Two sentences, front-loaded with the discovery/emit action, then the output structure, then the fallback behavior. No filler and every clause carries information.

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?

For a single-parameter read-only generation tool, the description covers purpose, output shape (provider variables, one block per resource) and edge-case behavior (unrecognised types become skeletons). No output schema exists, so explaining return structure is the right call; minor gap is that it does not mention how large or malformed compartments are handled.

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?

One parameter (compartmentId) with 100% schema description coverage, so the baseline is high. The description correctly implies the parameter is the compartment to scan and adds scope meaning ('whole compartment'), though it does not restate the OCID format, which the schema already documents.

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 (Discover/emit) and resource (Terraform module from a whole compartment) with clear scope. A sibling tool named generate_terraform exists, and the phrase 'whole compartment' vs the sibling's likely single-resource scope is the distinguishing signal, though the description doesn't explicitly contrast with it.

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?

Usage is implied by 'whole compartment' and the sibling generate_terraform implies a per-resource variant, but there is no explicit when-to-use or when-not-to-use guidance. The agent must infer that this tool is chosen for bulk compartment conversion rather than single-resource generation.

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