get_state_version_output
Retrieve detailed information about a Terraform state version output, including its name, value, type, and sensitivity, using the state version output ID. Access via the Terraform Cloud MCP server for efficient infrastructure management.
Instructions
Get details for a specific state version output.
Retrieves comprehensive information about a state version output including its name, value, type, and sensitivity information.
API endpoint: GET /state-version-outputs/:state_version_output_id
Args: state_version_output_id: The ID of the state version output (format: "wsout-xxxxxxxx")
Returns: State version output details including name, value, type, and sensitivity information
See: docs/tools/state_version_outputs.md for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state_version_output_id | Yes |
Implementation Reference
- The main asynchronous handler function that validates input using StateVersionOutputRequest and fetches state version output details via the Terraform Cloud API.@handle_api_errors async def get_state_version_output(state_version_output_id: str) -> APIResponse: """Get details for a specific state version output. Retrieves comprehensive information about a state version output including its name, value, type, and sensitivity information. API endpoint: GET /state-version-outputs/:state_version_output_id Args: state_version_output_id: The ID of the state version output (format: "wsout-xxxxxxxx") Returns: State version output details including name, value, type, and sensitivity information See: docs/tools/state_version_outputs.md for reference documentation """ # Validate parameters params = StateVersionOutputRequest(state_version_output_id=state_version_output_id) # Make API request return await api_request(f"state-version-outputs/{params.state_version_output_id}")
- Pydantic model used for input validation in the get_state_version_output tool, defining and validating the state_version_output_id parameter.class StateVersionOutputRequest(APIRequest): """Request model for retrieving a specific state version output. Used to validate the state version output ID parameter for API requests. Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/state-version-outputs#show-a-state-version-output See: docs/models/state_version_outputs.md for reference """ state_version_output_id: str = Field( ..., description="The ID of the state version output to retrieve", pattern=r"^wsout-[a-zA-Z0-9]{16}$", # Standard state version output ID pattern )
- terraform_cloud_mcp/server.py:121-121 (registration)Registration of the get_state_version_output tool in the FastMCP server instance.mcp.tool()(state_version_outputs.get_state_version_output)