Skip to main content
Glama
severity1

terraform-cloud-mcp

get_workspace_details

Retrieve comprehensive Terraform Cloud workspace details including configuration, VCS settings, and execution mode to verify settings or check current state before operations.

Instructions

Get details for a specific workspace, identified either by ID or by org name and workspace name.

Retrieves comprehensive information about a workspace including its configuration, VCS settings, execution mode, and other attributes. This is useful for checking workspace settings before operations or determining the current state of a workspace.

The workspace can be identified either by its ID directly, or by the combination of organization name and workspace name.

API endpoint:

  • GET /workspaces/{workspace_id} (when using workspace_id)

  • GET /organizations/{organization}/workspaces/{workspace_name} (when using org+name)

Args: workspace_id: The ID of the workspace (format: "ws-xxxxxxxx") organization: The name of the organization (required if workspace_id not provided) workspace_name: The name of the workspace (required if workspace_id not provided)

Returns: Comprehensive workspace details including settings, configuration and status

See: docs/tools/workspace.md for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNo
organizationNo
workspace_nameNo

Implementation Reference

  • The core handler function implementing the tool logic: fetches workspace details from Terraform Cloud API by either workspace ID or organization/workspace name combination, with input validation and dynamic endpoint construction.
    @handle_api_errors
    async def get_workspace_details(
        workspace_id: str = "", organization: str = "", workspace_name: str = ""
    ) -> APIResponse:
        """Get details for a specific workspace, identified either by ID or by org name and workspace name.
    
        Retrieves comprehensive information about a workspace including its configuration,
        VCS settings, execution mode, and other attributes. This is useful for checking
        workspace settings before operations or determining the current state of a workspace.
    
        The workspace can be identified either by its ID directly, or by the combination
        of organization name and workspace name.
    
        API endpoint:
        - GET /workspaces/{workspace_id} (when using workspace_id)
        - GET /organizations/{organization}/workspaces/{workspace_name} (when using org+name)
    
        Args:
            workspace_id: The ID of the workspace (format: "ws-xxxxxxxx")
            organization: The name of the organization (required if workspace_id not provided)
            workspace_name: The name of the workspace (required if workspace_id not provided)
    
        Returns:
            Comprehensive workspace details including settings, configuration and status
    
        See:
            docs/tools/workspace.md for reference documentation
        """
        # Ensure we have either workspace_id OR both organization and workspace_name
        if not workspace_id and not (organization and workspace_name):
            raise ValueError(
                "Either workspace_id OR both organization and workspace_name must be provided"
            )
    
        # Determine API path based on provided parameters
        if workspace_id:
            path = f"workspaces/{workspace_id}"
        else:
            path = f"organizations/{organization}/workspaces/{workspace_name}"
    
        # Make API request
        return await api_request(path, method="GET")
  • Registers the get_workspace_details tool function from the workspaces module using the MCP decorator in the server setup.
    mcp.tool()(workspaces.get_workspace_details)
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 this is a read operation ('Get', 'Retrieves') and mentions the API endpoints, but doesn't cover authentication requirements, rate limits, error conditions, or pagination behavior. It adds some context about what information is returned but could be more comprehensive for a tool with no annotation support.

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

Conciseness4/5

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

The description is well-structured with clear sections: purpose, usage context, identification methods, API endpoints, args, returns, and reference. While comprehensive, some sentences could be more concise (e.g., 'This is useful for...' could be integrated more tightly). Overall it's appropriately sized for the tool's complexity.

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?

Given 3 parameters with 0% schema coverage and no output schema, the description does an excellent job explaining parameter semantics and return values. It covers identification methods, API endpoints, and what information is retrieved. The main gap is lack of behavioral details like authentication or error handling, but overall it's quite complete for the given context.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all three parameters in detail: workspace_id format ('ws-xxxxxxxx'), organization and workspace_name requirements ('required if workspace_id not provided'), and the two identification methods. It provides essential semantic information not present in the bare schema.

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 'Get' and resource 'workspace details', specifying it retrieves comprehensive information including configuration, VCS settings, execution mode, and other attributes. It distinguishes from siblings like 'list_workspaces' (which lists multiple) and 'get_organization_details' (different resource).

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: 'checking workspace settings before operations or determining the current state of a workspace.' It doesn't explicitly state when not to use it or name specific alternatives among siblings, but the purpose is sufficiently distinct from other tools.

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