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)
Behavior4/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 this is a retrieval operation ('Retrieves comprehensive information'), specifies the API endpoint method (GET), and notes the lack of a listing endpoint. However, it doesn't mention potential errors, rate limits, or authentication requirements.

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?

Well-structured with clear sections (description, API endpoint, Args, Returns, Note, See). Each sentence adds value: the purpose statement, parameter details, return information, important usage note, and documentation reference. No wasted words.

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?

For a single-parameter retrieval tool with no output schema, the description is quite complete. It explains the parameter, return values, and crucial context about how to obtain the ID. The main gap is the lack of output schema, but the description compensates by listing what's returned. Slightly reduced because it doesn't detail the full structure of return values.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It provides the parameter name ('cost_estimate_id'), explains its purpose ('The ID of the cost estimate to retrieve details for'), and specifies the required format ('format: "ce-xxxxxxxx"'), adding crucial semantic information beyond the bare schema.

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 cost estimate') and resource ('cost estimate'), distinguishing it from siblings like 'get_run_details' or 'get_organization_details' by focusing on cost estimates. It specifies retrieving comprehensive information including status, resource counts, and cost estimations.

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

Usage Guidelines5/5

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

Explicit guidance is provided on when to use this tool: '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.' This clearly indicates the prerequisite and alternative approach for obtaining the required ID.

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