Skip to main content
Glama
severity1

terraform-cloud-mcp

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)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the API endpoint and return format ('List of workspace variables with their configuration and values'), which is useful behavioral context. However, it doesn't mention pagination, rate limits, authentication requirements, or error conditions that would be important for a production tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, API endpoint, Args, Returns, See). Every sentence earns its place - the first two sentences establish purpose, subsequent sections provide technical details without redundancy. The reference documentation link is appropriately placed at the end.

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 simple read operation with 1 parameter and no output schema, the description provides good coverage: purpose, parameter details, return format, and API endpoint. It lacks information about authentication, error handling, and pagination which would be useful for completeness, but covers the essential context for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and only 1 parameter, the description provides the parameter name 'workspace_id' and clarifies its format ('ws-xxxxxxxx'), which adds meaningful semantics beyond the bare schema. It doesn't fully explain what a workspace ID is or how to obtain one, but provides essential format guidance.

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 verb 'List' and resource 'all variables for a workspace', specifying both Terraform and environment variables. It distinguishes from siblings like 'list_variables_in_variable_set' by focusing on workspace-specific variables rather than variable sets.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('for a specific workspace'), but doesn't explicitly state when not to use it or name alternatives. It implies usage when needing workspace variables rather than variable set variables, but lacks explicit exclusions.

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