unlock_workspace
Removes the lock from a Terraform Cloud workspace, enabling the queueing of runs and resuming normal operations after a lock was applied. Requires a workspace ID to execute.
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
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes |
Implementation Reference
- The core handler function for the 'unlock_workspace' tool. It sends a POST request to the Terraform Cloud API endpoint /workspaces/{workspace_id}/actions/unlock to remove the lock from the specified workspace.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 tool with the MCP server instance using the mcp.tool decorator and applies the write_tool_config for appropriate tool metadata.mcp.tool(**write_tool_config)(workspaces.unlock_workspace)
- terraform_cloud_mcp/server.py:39-42 (schema)Shared configuration dictionary used in tool registration that sets tool metadata including enabled state and readOnlyHint annotation, influencing the tool's schema and behavior hints.write_tool_config = { "enabled": not read_only_mode, "annotations": {"readOnlyHint": False} }