Skip to main content
Glama

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 )

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