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)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool retrieves information (implying read-only behavior) and mentions the API endpoint, but lacks details on authentication needs, rate limits, error handling, or pagination. It adds some context about what's included in the details but doesn't fully cover behavioral traits like response format or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by details in clear sections (Args, Returns, See). Each sentence adds value without redundancy, such as specifying the API endpoint and referencing documentation, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's moderate complexity (single parameter, no output schema, no annotations), the description is mostly complete: it explains the purpose, parameter, return values, and references external docs. However, without annotations or output schema, it could benefit from more details on error cases or exact return structure, though the reference to documentation mitigates this gap.

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

Parameters4/5

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

The schema description coverage is 0%, so the description must compensate. It provides the parameter 'apply_id' with its purpose and format ('The ID of the apply to retrieve details for (format: "apply-xxxxxxxx")'), adding meaningful semantics beyond the bare schema. However, it doesn't clarify if the ID is case-sensitive or where to obtain it, leaving minor gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get details for a specific apply') and resource ('apply'), distinguishing it from sibling tools like 'get_apply_logs' or 'get_run_details' by focusing on comprehensive apply information rather than logs or run details. It specifies the scope includes status, logs, resource counts, and relationships.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating it retrieves details for 'a specific apply' and references an API endpoint, suggesting it's for querying individual applies. However, it doesn't explicitly state when to use alternatives like 'get_apply_logs' for logs only or 'get_run_details' for related run information, missing explicit exclusions or comparisons.

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