terraform-cloud-mcp

by severity1
Verified

safe_delete_workspace

Safely delete a Terraform workspace by verifying it has no active resources first. Prevents accidental deletion of workspaces with active infrastructure. Returns status, errors, or affected resources.

Instructions

Safely delete a workspace by first checking if it can be deleted.

Initiates a safe delete operation which checks if the workspace has resources before deleting it. This is a safer alternative to delete_workspace as it prevents accidental deletion of workspaces with active infrastructure. The operation follows these steps: 1. Checks if the workspace has any resources 2. If no resources exist, deletes the workspace 3. If resources exist, returns an error indicating the workspace cannot be safely deleted API endpoint: POST /organizations/{organization}/workspaces/{workspace_name}/actions/safe-delete Args: organization: The name of the organization that owns the workspace workspace_name: The name of the workspace to delete Returns: Status of the safe delete operation including: - Success response if deletion was completed - Error with details if workspace has resources and cannot be safely deleted - List of resources that would be affected by deletion (if applicable) See: docs/tools/workspace_tools.md for usage examples

Input Schema

NameRequiredDescriptionDefault
organizationYes
workspace_nameYes

Input Schema (JSON Schema)

{ "properties": { "organization": { "title": "Organization", "type": "string" }, "workspace_name": { "title": "Workspace Name", "type": "string" } }, "required": [ "organization", "workspace_name" ], "title": "safe_delete_workspaceArguments", "type": "object" }
ID: iukijjkm1e