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
| Name | Required | Description | Default |
|---|---|---|---|
| state_version_id | Yes |
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}")
- terraform_cloud_mcp/server.py:115-115 (registration)Registers the get_state_version handler as an MCP tool using FastMCP's mcp.tool() decorator.mcp.tool()(state_versions.get_state_version)