unlock_workspace
Remove a lock from a Terraform Cloud workspace to enable queuing runs and restore normal operation after previous locking.
Instructions
Unlock a workspace.
Removes the lock from a workspace, allowing runs to be queued. This enables normal operation of the workspace after it was previously locked.
API endpoint: POST /workspaces/{workspace_id}/actions/unlock
Args: workspace_id: The ID of the workspace to unlock (format: "ws-xxxxxxxx")
Returns: The workspace with updated lock status and related metadata
See: docs/tools/workspace.md for reference documentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes |
Implementation Reference
- The core handler function for the unlock_workspace tool. It uses the api_request utility to POST to the Terraform Cloud /workspaces/{workspace_id}/actions/unlock endpoint, decorated with error handling.async def unlock_workspace(workspace_id: str) -> APIResponse: """Unlock a workspace. Removes the lock from a workspace, allowing runs to be queued. This enables normal operation of the workspace after it was previously locked. API endpoint: POST /workspaces/{workspace_id}/actions/unlock Args: workspace_id: The ID of the workspace to unlock (format: "ws-xxxxxxxx") Returns: The workspace with updated lock status and related metadata See: docs/tools/workspace.md for reference documentation """ return await api_request(f"workspaces/{workspace_id}/actions/unlock", method="POST")
- terraform_cloud_mcp/server.py:60-60 (registration)Registers the unlock_workspace handler as an MCP tool using FastMCP's mcp.tool decorator with write_tool_config (enables non-read-only operations).mcp.tool(**write_tool_config)(workspaces.unlock_workspace)