Skip to main content
Glama
severity1

terraform-cloud-mcp

list_state_version_outputs

Retrieve outputs from a Terraform state version to access configuration values, including names, values, and sensitivity details for infrastructure management.

Instructions

List outputs for a state version.

Retrieves a paginated list of all outputs for a specific state version. These outputs include name, value, and sensitivity information.

API endpoint: GET /state-versions/:state_version_id/outputs

Args: state_version_id: The ID of the state version (format: "sv-xxxxxxxx") page_number: The page number to return (default: 1) page_size: The number of items per page (default: 20, max: 100)

Returns: Paginated list of state version outputs with name, value, and sensitivity information

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
state_version_idYes
page_numberNo
page_sizeNo

Implementation Reference

  • The primary handler function implementing the list_state_version_outputs tool. It validates inputs using StateVersionOutputListRequest, builds query parameters, and makes an API request to the Terraform Cloud /state-versions/{state_version_id}/outputs endpoint.
    @handle_api_errors
    async def list_state_version_outputs(
        state_version_id: str, page_number: int = 1, page_size: int = 20
    ) -> APIResponse:
        """List outputs for a state version.
    
        Retrieves a paginated list of all outputs for a specific state version.
        These outputs include name, value, and sensitivity information.
    
        API endpoint: GET /state-versions/:state_version_id/outputs
    
        Args:
            state_version_id: The ID of the state version (format: "sv-xxxxxxxx")
            page_number: The page number to return (default: 1)
            page_size: The number of items per page (default: 20, max: 100)
    
        Returns:
            Paginated list of state version outputs with name, value, and sensitivity information
    
        See:
            docs/tools/state_version_outputs.md for reference documentation
        """
        # Validate parameters
        params = StateVersionOutputListRequest(
            state_version_id=state_version_id,
            page_number=page_number,
            page_size=page_size,
        )
    
        # Build query parameters using utility function
        query = query_params(params)
    
        # Make API request
        return await api_request(
            f"state-versions/{params.state_version_id}/outputs", params=query
        )
  • Pydantic input schema model StateVersionOutputListRequest used for validating the parameters (state_version_id, page_number, page_size) of the list_state_version_outputs tool.
    class StateVersionOutputListRequest(APIRequest):
        """Request parameters for listing state version outputs.
    
        Defines the parameters for the state version outputs listing API including pagination.
    
        Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/state-version-outputs#list-state-version-outputs
    
        See:
            docs/models/state_version_outputs.md for reference
        """
    
        state_version_id: str = Field(
            ...,
            description="The ID of the state version to list outputs for",
            pattern=r"^sv-[a-zA-Z0-9]{16}$",  # Standard state version ID pattern
        )
        page_number: Optional[int] = Field(
            1,
            ge=1,
            description="Page number to fetch",
        )
        page_size: Optional[int] = Field(
            20,
            ge=1,
            le=100,
            description="Number of results per page",
        )
  • Registration of the list_state_version_outputs tool in the MCP server using the mcp.tool() decorator.
    mcp.tool()(state_version_outputs.list_state_version_outputs)
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 of behavioral disclosure. It clearly describes the tool as a read operation ('Retrieves'), specifies pagination behavior, includes the API endpoint, and mentions the return format. However, it doesn't cover potential errors, authentication requirements, or rate limits, which would be helpful for a tool with no annotations.

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 clear sections (purpose, behavior, parameters, returns, reference). While efficient, the 'See:' reference could be integrated more seamlessly, and some sentences could be slightly more concise. Overall, it's appropriately sized and front-loaded with key information.

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 read/list tool with no annotations and no output schema, the description does a good job covering purpose, behavior, parameters, and return format. It includes the API endpoint and reference documentation. The main gap is lack of error handling or authentication context, but given the tool's relative simplicity, it's reasonably complete.

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?

With 0% schema description coverage, the description fully compensates by providing detailed parameter information. It explains all three parameters: 'state_version_id' (with format example), 'page_number' (with default), and 'page_size' (with default and max value). This adds significant value beyond what the bare schema provides.

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 ('List outputs for a state version') and resource ('state version outputs'), distinguishing it from siblings like 'get_state_version_output' (singular) and 'list_state_versions'. It explicitly mentions what is retrieved ('paginated list of all outputs') and what information they contain ('name, value, and sensitivity information').

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

Usage Guidelines3/5

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

The description implies usage by specifying it's for retrieving outputs for a 'specific state version', but doesn't explicitly state when to use this tool versus alternatives like 'get_state_version_output' (singular output) or other list tools. No guidance on prerequisites, exclusions, or comparison with sibling tools is provided.

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