list_workspace_variables
Retrieve all variables (Terraform and environment) configured for a specific workspace in Terraform Cloud using the workspace ID. See variable details and configurations.
Instructions
List all variables for a workspace.
Retrieves all variables (both Terraform and environment) configured for a specific workspace.
API endpoint: GET /workspaces/{workspace_id}/vars
Args: workspace_id: The ID of the workspace (format: "ws-xxxxxxxx")
Returns: List of workspace variables with their configuration and values
See: docs/tools/variables.md#list-workspace-variables for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes |
Implementation Reference
- The handler function that implements the tool logic by making an API request to list all variables in the specified Terraform Cloud workspace.@handle_api_errors async def list_workspace_variables(workspace_id: str) -> APIResponse: """List all variables for a workspace. Retrieves all variables (both Terraform and environment) configured for a specific workspace. API endpoint: GET /workspaces/{workspace_id}/vars Args: workspace_id: The ID of the workspace (format: "ws-xxxxxxxx") Returns: List of workspace variables with their configuration and values See: docs/tools/variables.md#list-workspace-variables for reference documentation """ endpoint = f"workspaces/{workspace_id}/vars" return await api_request(endpoint, method="GET")
- terraform_cloud_mcp/server.py:125-125 (registration)Registers the list_workspace_variables tool with the MCP server using FastMCP's tool decorator.mcp.tool()(variables.list_workspace_variables)