Skip to main content
Glama

Export an existing resource to Terraform

export_terraform
Read-onlyIdempotent

Generate Terraform (HCL) for EXISTING Control Plane resources from a self link. Single resource (/org/acme/gvc/prod/workload/api) or bulk by path depth — /org/acme exports the whole org, /org/acme/gvc/prod/workload exports every workload in a GVC. Set generateImports to get ready-to-run terraform import commands for adopting the resources into Terraform state, and includeDependencies to pull in referenced resources. Secrets are never exported; a ref or dependency closure that includes them is refused. An unsupported kind is rejected with the supported list. For an in-memory manifest, use convert_to_terraform.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceYesSelf link of an existing resource, e.g. `/org/acme/gvc/prod/workload/api` (a full `https://api.cpln.io/org/...` URL is also accepted). Use a shorter path for a bulk export: `/org/acme` (whole org) or `/org/acme/gvc/prod/workload` (all workloads in a GVC).
generateImportsNoAlso return the matching `terraform import` commands, one per resource with the import IDs prefilled. Run them after `terraform init` and before the first `terraform apply` so the existing resources are adopted into state instead of re-created.
includeDependenciesNoAlso export referenced/dependent resources so the generated HCL is self-contained.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / resource / maxLength
      Removed value: -512
    • removedInput schema / properties / resource / minLength
      Removed value: -3
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / data / description
      Previous value: -"The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary."New value: +"The full result. Read this, not only the summary."
    • addedOutput schema / properties / details
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / nextSteps / description
      Removed value: -"Recommended follow-up actions for this task, in order."
    • removedOutput schema / properties / ok / description
      Removed value: -"Whether the call succeeded."
    • removedOutput schema / properties / summary / description
      Removed value: -"One-line summary of the result."
  2. Changed1 schema field changed
    • removedInput schema / properties / includeSecretValues
      Removed value: -{
      -  "default": false,
      -  "description": "Exported secrets embed their REVEALED PLAINTEXT values in the HCL (the exporter follows the reveal link). false (default): refs that directly target secrets are refused, and an export that pulls secrets in via includeDependencies/org-root is refused too (re-run with this flag to allow it). true: values pass through and the result is labeled sensitive — set ONLY after the user explicitly approves.",
      -  "type": "boolean"
      -}
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description layers on real behavioral value beyond them: secrets are never exported, a ref/dependency closure containing secrets is refused, and an unsupported kind is rejected with the supported list. It also explains the import-command sequencing (run after init, before first apply) that determines whether resources are adopted or re-created.

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?

Front-loads the core purpose in the first sentence, then packs path-depth examples, the two flags, the secret/unsupported-kind constraints, and the sibling pointer without a wasted clause. Dense but every sentence carries distinct information.

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?

An output schema exists so return shape needn't be described. Given three parameters and read-only annotations, the description covers the decisions an agent must make — single vs. bulk path, flag semantics, refusal conditions, and the alternative tool — leaving no material gap.

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 the schema already documents resource, generateImports, and includeDependencies in detail. The description's parameter mentions largely restate the schema, adding only the adoption rationale for generateImports; baseline 3 is appropriate when the schema carries the load.

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 and resource ('Generate Terraform (HCL) for EXISTING Control Plane resources from a self link') with the scope qualifier that matters (existing vs. in-memory). It explicitly distinguishes itself from the sibling convert_to_terraform, so an agent can route without opening either schema.

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?

Gives concrete when-to-use conditions: single self link vs. shorter path for bulk, with worked examples ('/org/acme' exports the whole org, '/org/acme/gvc/prod/workload' exports every workload in a GVC). It also names the alternative tool and the condition selecting it ('For an in-memory manifest, use convert_to_terraform').

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.