Skip to main content
Glama
severity1

terraform-cloud-mcp

list_variables_in_variable_set

Retrieve all variables and their configurations from a specific Terraform Cloud variable set to manage infrastructure settings.

Instructions

List all variables in a variable set.

Retrieves all variables that belong to a specific variable set, including their configuration and values.

API endpoint: GET /varsets/{varset_id}/relationships/vars

Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx")

Returns: List of variables in the variable set with their configuration

See: docs/tools/variables.md#list-variables-in-variable-set for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
varset_idYes

Implementation Reference

  • The main handler function that executes the tool: lists all variables in a Terraform Cloud variable set by making a GET API request to /varsets/{varset_id}/relationships/vars endpoint.
    @handle_api_errors
    async def list_variables_in_variable_set(varset_id: str) -> APIResponse:
        """List all variables in a variable set.
    
        Retrieves all variables that belong to a specific variable set,
        including their configuration and values.
    
        API endpoint: GET /varsets/{varset_id}/relationships/vars
    
        Args:
            varset_id: The ID of the variable set (format: "varset-xxxxxxxx")
    
        Returns:
            List of variables in the variable set with their configuration
    
        See:
            docs/tools/variables.md#list-variables-in-variable-set for reference documentation
        """
        endpoint = f"varsets/{varset_id}/relationships/vars"
        return await api_request(endpoint, method="GET")
  • Registers the list_variables_in_variable_set tool in the MCP server using FastMCP's mcp.tool() decorator.
    mcp.tool()(variables.list_variables_in_variable_set)

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