Skip to main content
Glama
severity1

terraform-cloud-mcp

get_cost_estimate_details

Retrieve detailed cost estimate information from Terraform Cloud, including status, resource counts, and monthly cost projections for infrastructure planning.

Instructions

Get details for a specific cost estimate.

Retrieves comprehensive information about a cost estimate including its current status, resource counts, monthly cost estimations, and relationship to other resources.

API endpoint: GET /cost-estimates/{cost_estimate_id}

Args: cost_estimate_id: The ID of the cost estimate to retrieve details for (format: "ce-xxxxxxxx")

Returns: Cost estimate details including status, timestamps, resource counts, and monthly cost estimations

Note: There is no endpoint to list cost estimates. You can find the ID for a cost estimate in the relationships.cost-estimate property of a run object.

See: docs/tools/cost_estimate.md for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cost_estimate_idYes

Implementation Reference

  • The handler function that executes the tool logic: validates input and makes API request to retrieve cost estimate details.
    @handle_api_errors
    async def get_cost_estimate_details(cost_estimate_id: str) -> APIResponse:
        """Get details for a specific cost estimate.
    
        Retrieves comprehensive information about a cost estimate including its current status,
        resource counts, monthly cost estimations, and relationship to other resources.
    
        API endpoint: GET /cost-estimates/{cost_estimate_id}
    
        Args:
            cost_estimate_id: The ID of the cost estimate to retrieve details for (format: "ce-xxxxxxxx")
    
        Returns:
            Cost estimate details including status, timestamps, resource counts,
            and monthly cost estimations
    
        Note:
            There is no endpoint to list cost estimates. You can find the ID for a cost estimate
            in the `relationships.cost-estimate` property of a run object.
    
        See:
            docs/tools/cost_estimate.md for reference documentation
        """
        # Validate parameters
        params = CostEstimateRequest(cost_estimate_id=cost_estimate_id)
    
        # Make API request
        return await api_request(f"cost-estimates/{params.cost_estimate_id}")
  • Pydantic model defining the input schema for the cost_estimate_id parameter with validation.
    class CostEstimateRequest(APIRequest):
        """Request model for retrieving a cost estimate.
    
        Used to validate the cost estimate ID parameter for API requests.
    
        Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/cost-estimates#show-a-cost-estimate
    
        See:
            docs/models/cost_estimate.md for reference
        """
    
        cost_estimate_id: str = Field(
            ...,
            # No alias needed as field name matches API parameter
            description="The ID of the cost estimate to retrieve",
            pattern=r"^ce-[a-zA-Z0-9]{16}$",  # Standard cost estimate ID pattern
        )
  • Tool registration using the mcp.tool() decorator, importing from cost_estimates module.
    mcp.tool()(cost_estimates.get_cost_estimate_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