get_apply_details
Retrieve detailed information about a specific Terraform apply, including status, logs, resource counts, and relationships. Use the apply ID to access comprehensive data via the Terraform Cloud MCP server.
Instructions
Get details for a specific apply.
Retrieves comprehensive information about an apply including its current status, logs, resource counts, and relationship to other resources.
API endpoint: GET /applies/{apply_id}
Args: apply_id: The ID of the apply to retrieve details for (format: "apply-xxxxxxxx")
Returns: Apply details including status, timestamps, and resource change counts
See: docs/tools/apply.md for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply_id | Yes |
Implementation Reference
- The main handler function for the 'get_apply_details' tool. It validates the apply_id using ApplyRequest model, then calls the Terraform Cloud API to retrieve apply details.@handle_api_errors async def get_apply_details(apply_id: str) -> APIResponse: """Get details for a specific apply. Retrieves comprehensive information about an apply including its current status, logs, resource counts, and relationship to other resources. API endpoint: GET /applies/{apply_id} Args: apply_id: The ID of the apply to retrieve details for (format: "apply-xxxxxxxx") Returns: Apply details including status, timestamps, and resource change counts See: docs/tools/apply.md for reference documentation """ # Validate parameters params = ApplyRequest(apply_id=apply_id) # Make API request return await api_request(f"applies/{params.apply_id}")
- Pydantic input schema model ApplyRequest used for validating the apply_id parameter in the handler.class ApplyRequest(APIRequest): """Request model for retrieving an apply. Used to validate the apply ID parameter for API requests. Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/applies#show-an-apply See: docs/models/apply.md for reference """ apply_id: str = Field( ..., # No alias needed as field name matches API parameter description="The ID of the apply to retrieve", pattern=r"^apply-[a-zA-Z0-9]{16}$", # Standard apply ID pattern )
- terraform_cloud_mcp/server.py:89-89 (registration)Registration of the 'get_apply_details' tool using FastMCP's mcp.tool() decorator.mcp.tool()(applies.get_apply_details)