Skip to main content
Glama

Generate Terraform for a resource

generate_terraform
Read-onlyIdempotent

Generate a Terraform HCL resource block for any OCI resource by providing its type and OCID. Fetches live attributes and maps them to the matching oci_* resource for reproducible infrastructure.

Instructions

Generate a Terraform (HCL) resource block for a single OCI resource by type and OCID. Fetches the resource's attributes and maps them to the matching oci_* resource.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ocidYesThe resource OCID
resourceTypeYesOCI resource type, e.g. Vcn, Subnet, Instance
compartmentIdNoCompartment OCID (for scoping)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already establish that the operation is read-only, idempotent, and non-destructive. The description adds 'Fetches the resource's attributes and maps them', which confirms the read behavior, but it does not disclose additional behavioral details such as error handling, unsupported resource types, or output formatting beyond 'resource block'.

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?

The description is compact: two sentences with no filler. The core action is front-loaded, and the second sentence explains the generation mechanism without redundancy.

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?

Given the lack of an output schema, the description adequately conveys that the tool returns a Terraform HCL resource block. It covers the main workflow and parameter intent, though it does not address edge cases like unsupported resource types or whether compartmentId is required for certain resources.

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 explains resourceType, ocid, and compartmentId. The description reinforces that resourceType and ocid are the key inputs, but adds no meaning beyond the schema and the obvious mapping to the required parameters.

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?

The description uses a specific verb ('Generate'), a clear object ('Terraform (HCL) resource block'), and a precise scope ('single OCI resource by type and OCID'). This clearly differentiates it from the sibling generate_compartment_terraform, which targets compartments rather than individual resources.

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?

The description implies the tool should be used when you have a specific resourceType and OCID for a single resource. However, it does not explicitly state when not to use it or mention alternatives such as generate_compartment_terraform, leaving some routing to inference.

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

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/dockndevai/mcp-oci'

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