Skip to main content
Glama

unassign_variable_set_from_projects

Remove a variable set from specified Terraform Cloud projects to stop its variables from being available in associated workspaces. Uses the DELETE /varsets/{varset_id}/relationships/projects API endpoint for execution.

Instructions

Remove a variable set from one or more projects.

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

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

Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx") project_ids: List of project IDs (format: ["prj-xxxxxxxx", ...])

Returns: Empty response with HTTP 204 status code if successful

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idsYes
varset_idYes

Implementation Reference

  • The core handler function that executes the tool: sends a DELETE request to unassign the variable set from the given projects.
    @handle_api_errors async def unassign_variable_set_from_projects( varset_id: str, project_ids: List[str] ) -> APIResponse: """Remove a variable set from one or more projects. Removes the variable set assignment from the specified projects. The variables will no longer be available in workspaces within those projects. API endpoint: DELETE /varsets/{varset_id}/relationships/projects Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx") project_ids: List of project IDs (format: ["prj-xxxxxxxx", ...]) Returns: Empty response with HTTP 204 status code if successful See: docs/tools/variables.md#unassign-variable-set-from-projects for reference documentation """ # Build relationships payload relationships_data = [] for project_id in project_ids: relationships_data.append({"type": "projects", "id": project_id}) payload = {"data": relationships_data} endpoint = f"varsets/{varset_id}/relationships/projects" return await api_request(endpoint, method="DELETE", data=payload)
  • Registers the tool in the MCP server using mcp.tool decorator.
    mcp.tool(**write_tool_config)(variables.unassign_variable_set_from_projects)

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