Skip to main content
Glama

get_plan_details

Retrieve detailed information about a specific Terraform Cloud plan, including status, logs, resource changes, and timestamps, using the plan ID.

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 main asynchronous handler function that validates the plan_id using PlanRequest model and fetches the 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}")
  • Pydantic-based input schema model PlanRequest that validates the plan_id parameter with regex pattern for Terraform Cloud 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 )
  • Tool registration line where get_plan_details from the plans module is registered as an MCP tool using the FastMCP decorator.
    mcp.tool()(plans.get_plan_details)

Other Tools

Related 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