Skip to main content
Glama
severity1

terraform-cloud-mcp

get_apply_details

Retrieve comprehensive details about Terraform Cloud applies, including status, logs, and resource change counts to monitor infrastructure deployments.

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

TableJSON Schema
NameRequiredDescriptionDefault
apply_idYes

Implementation Reference

  • The main handler function decorated with error handling that validates input using ApplyRequest model and fetches apply details from the Terraform Cloud API endpoint /applies/{apply_id}.
    @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 model inheriting from APIRequest that defines and validates the input parameter apply_id with regex pattern for Terraform Cloud apply IDs.
    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
        )
  • Registers the get_apply_details tool with the FastMCP server instance.
    mcp.tool()(applies.get_apply_details)

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