Skip to main content
Glama
severity1

terraform-cloud-mcp

get_plan_details

Retrieve comprehensive Terraform Cloud plan details including status, logs, resource counts, and relationships for infrastructure management.

Instructions

Get details for a specific plan.

Retrieves comprehensive information about a plan including its current status, logs, resource counts, and relationship to other resources.

API endpoint: GET /plans/{plan_id}

Args: plan_id: The ID of the plan to retrieve details for (format: "plan-xxxxxxxx")

Returns: Plan details including status, timestamps, and resource change counts

See: docs/tools/plan.md for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYes

Implementation Reference

  • The async handler function that validates input using PlanRequest model and fetches plan details from the Terraform Cloud API endpoint /plans/{plan_id}.
    @handle_api_errors
    async def get_plan_details(plan_id: str) -> APIResponse:
        """Get details for a specific plan.
    
        Retrieves comprehensive information about a plan including its current status,
        logs, resource counts, and relationship to other resources.
    
        API endpoint: GET /plans/{plan_id}
    
        Args:
            plan_id: The ID of the plan to retrieve details for (format: "plan-xxxxxxxx")
    
        Returns:
            Plan details including status, timestamps, and resource change counts
    
        See:
            docs/tools/plan.md for reference documentation
        """
        # Validate parameters
        params = PlanRequest(plan_id=plan_id)
    
        # Make API request
        return await api_request(f"plans/{params.plan_id}")
  • Registers the get_plan_details tool with the MCP server using mcp.tool() decorator.
    mcp.tool()(plans.get_plan_details)
  • Pydantic input schema model PlanRequest that validates the plan_id parameter with regex pattern for plan IDs.
    class PlanRequest(APIRequest):
        """Request model for retrieving a plan.
    
        Used to validate the plan ID parameter for API requests.
    
        Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/plans#show-a-plan
    
        See:
            docs/models/plan.md for reference
        """
    
        plan_id: str = Field(
            ...,
            # No alias needed as field name matches API parameter
            description="The ID of the plan to retrieve",
            pattern=r"^plan-[a-zA-Z0-9]{16}$",  # Standard plan ID pattern
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions retrieving comprehensive information but doesn't address key aspects like authentication requirements, rate limits, error conditions, or whether this is a read-only operation. The API endpoint hint (GET) suggests read-only behavior, but this isn't explicitly stated.

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?

The description is well-structured with clear sections (purpose, API endpoint, Args, Returns, See) and avoids unnecessary verbosity. However, the 'See' reference to external documentation slightly reduces conciseness, as some information could be integrated directly.

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

Completeness3/5

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

For a single-parameter read operation with no output schema, the description provides adequate context about what information is returned (status, timestamps, resource change counts) and parameter format. However, it lacks details about response structure, error handling, and behavioral constraints that would be helpful given the absence of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides excellent parameter semantics despite 0% schema description coverage. It clearly explains the plan_id parameter's purpose ('The ID of the plan to retrieve details for') and provides crucial format information ('format: "plan-xxxxxxxx"') that isn't in the schema. This fully compensates for the schema's lack of descriptions.

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?

The description clearly states the tool's purpose with a specific verb ('Get details') and resource ('plan'), and distinguishes it from siblings by focusing on comprehensive plan information retrieval. However, it doesn't explicitly differentiate from similar tools like get_plan_json_output or get_plan_logs, which prevents a perfect score.

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 provides no guidance on when to use this tool versus alternatives. It mentions retrieving 'comprehensive information' but doesn't specify scenarios where this is preferred over other plan-related tools like get_plan_json_output or get_plan_logs, nor does it mention prerequisites or exclusions.

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/severity1/terraform-cloud-mcp'

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