Skip to main content
Glama

list_workspace_variables

Retrieve all Terraform and environment variables configured for a specific workspace to manage infrastructure configuration and settings.

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

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYes

Implementation Reference

  • The main handler function for the 'list_workspace_variables' tool. It makes a GET request to the Terraform Cloud API endpoint /workspaces/{workspace_id}/vars to retrieve all variables in the specified 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")
  • Registration of the 'list_workspace_variables' tool in the MCP server using the mcp.tool() decorator.
    mcp.tool()(variables.list_workspace_variables)

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