list_variables_in_variable_set
Retrieve all variables within a specified Terraform variable set, including their configurations and values, using the MCP server’s API endpoint for efficient infrastructure management.
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
| Name | Required | Description | Default |
|---|---|---|---|
| varset_id | Yes |
Implementation Reference
- The core handler function that implements the tool logic by calling the Terraform Cloud API to list variables in a specified variable set.@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")
- terraform_cloud_mcp/server.py:142-142 (registration)The registration of the tool in the MCP server using the mcp.tool() decorator.mcp.tool()(variables.list_variables_in_variable_set)