Skip to main content
Glama
severity1

terraform-cloud-mcp

get_state_version

Retrieve detailed information about a specific Terraform state version, including status, download URLs, and resource metadata for infrastructure management.

Instructions

Get details for a specific state version.

Retrieves comprehensive information about a state version including its status, download URLs, and resource information.

API endpoint: GET /state-versions/:state_version_id

Args: state_version_id: The ID of the state version to retrieve (format: "sv-xxxxxxxx")

Returns: State version details including status, timestamps, and resource metadata

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
state_version_idYes

Implementation Reference

  • Handler function that implements the 'get_state_version' tool. It validates the state_version_id using StateVersionRequest model and makes a GET request to the Terraform Cloud API endpoint /state-versions/:state_version_id to retrieve the state version details.
    async def get_state_version(state_version_id: str) -> APIResponse:
        """Get details for a specific state version.
    
        Retrieves comprehensive information about a state version including its status,
        download URLs, and resource information.
    
        API endpoint: GET /state-versions/:state_version_id
    
        Args:
            state_version_id: The ID of the state version to retrieve (format: "sv-xxxxxxxx")
    
        Returns:
            State version details including status, timestamps, and resource metadata
    
        See:
            docs/tools/state_versions.md for reference documentation
        """
        # Validate parameters
        params = StateVersionRequest(state_version_id=state_version_id)
    
        # Make API request
        return await api_request(f"state-versions/{params.state_version_id}")
  • Registers the get_state_version handler as an MCP tool using FastMCP's mcp.tool() decorator.
    mcp.tool()(state_versions.get_state_version)
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that it 'retrieves comprehensive information' and mentions the API endpoint, but does not cover behavioral traits like authentication requirements, rate limits, error handling, or whether it's idempotent. The description adds some context but leaves gaps for a read operation.

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

Conciseness4/5

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

The description is well-structured with a clear purpose statement, bullet-like sections for Args and Returns, and a See reference. It's appropriately sized but includes minor redundancy (e.g., 'Get details' and 'Retrieves comprehensive information'). Every sentence adds value, though it could be slightly more front-loaded.

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 1 parameter, no output schema, and no annotations, the description provides good coverage: clear purpose, parameter details, return value explanation, and API endpoint. It lacks output structure details and behavioral context, but for a simple read tool, it's mostly complete. The reference to external docs helps fill gaps.

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?

Schema description coverage is 0%, so the description must compensate. It explicitly documents the single parameter 'state_version_id' with its purpose and format ('sv-xxxxxxxx'), adding essential meaning beyond the schema's minimal title. This fully compensates for the lack of schema descriptions, though it doesn't cover edge cases.

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 verb 'Get details' and resource 'specific state version', with elaboration on what details are retrieved (status, download URLs, resource information). It distinguishes from sibling tools like 'list_state_versions' (which lists multiple) and 'get_current_state_version' (which gets a specific type).

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 specifying 'specific state version' and referencing the API endpoint, but does not explicitly state when to use this versus alternatives like 'get_current_state_version' or 'list_state_versions'. It provides clear prerequisites (need a state version ID) but lacks explicit exclusions or comparison to siblings.

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