Skip to main content
Glama
severity1

terraform-cloud-mcp

unassign_variable_set_from_workspaces

Remove a variable set from specific workspaces to stop those variables from being available in those workspaces.

Instructions

Remove a variable set from one or more workspaces.

Removes the variable set assignment from the specified workspaces. The variables will no longer be available in those workspaces.

API endpoint: DELETE /varsets/{varset_id}/relationships/workspaces

Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx") workspace_ids: List of workspace IDs (format: ["ws-xxxxxxxx", ...])

Returns: Empty response with HTTP 204 status code if successful

See: docs/tools/variables.md#unassign-variable-set-from-workspaces for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
varset_idYes
workspace_idsYes

Implementation Reference

  • The handler function that unassigns a variable set from specified workspaces by sending a DELETE request to the Terraform Cloud API endpoint /varsets/{varset_id}/relationships/workspaces with the list of workspace relationships in the payload.
    @handle_api_errors
    async def unassign_variable_set_from_workspaces(
        varset_id: str, workspace_ids: List[str]
    ) -> APIResponse:
        """Remove a variable set from one or more workspaces.
    
        Removes the variable set assignment from the specified workspaces. The variables
        will no longer be available in those workspaces.
    
        API endpoint: DELETE /varsets/{varset_id}/relationships/workspaces
    
        Args:
            varset_id: The ID of the variable set (format: "varset-xxxxxxxx")
            workspace_ids: List of workspace IDs (format: ["ws-xxxxxxxx", ...])
    
        Returns:
            Empty response with HTTP 204 status code if successful
    
        See:
            docs/tools/variables.md#unassign-variable-set-from-workspaces for reference documentation
        """
        # Build relationships payload
        relationships_data = []
        for workspace_id in workspace_ids:
            relationships_data.append({"type": "workspaces", "id": workspace_id})
    
        payload = {"data": relationships_data}
        endpoint = f"varsets/{varset_id}/relationships/workspaces"
        return await api_request(endpoint, method="DELETE", data=payload)
  • The registration of the tool in the MCP server using FastMCP's tool decorator, referencing the handler from the variables module.
    mcp.tool(**write_tool_config)(variables.unassign_variable_set_from_workspaces)

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