Skip to main content
Glama

get_workspace_details

Retrieve detailed workspace information by ID or organization and workspace name. Useful for checking settings, configurations, and status in Terraform Cloud environments.

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
organizationNo
workspace_idNo
workspace_nameNo

Implementation Reference

  • The main handler function that executes the tool's logic: validates inputs, constructs the appropriate Terraform Cloud API endpoint, and retrieves workspace details.
    @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 handler as an MCP tool using the mcp.tool() decorator.
    mcp.tool()(workspaces.get_workspace_details)

Other Tools

Related 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