Skip to main content
Glama

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)

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