Skip to main content
Glama
severity1

terraform-cloud-mcp

force_unlock_workspace

Force unlock a Terraform Cloud workspace when normal unlocking fails due to orphaned locks or unavailable users. Use with caution for admin-level workspace management.

Instructions

Force unlock a workspace. This should be used with caution.

Forces a workspace to unlock even when the normal unlock process isn't possible. This is typically needed when a run has orphaned a lock or when the user who locked the workspace is unavailable. This operation requires admin privileges on the workspace.

WARNING: Forcing an unlock can be dangerous if the workspace is legitimately locked for active operations. Only use this when you are certain it's safe to unlock.

API endpoint: POST /workspaces/{workspace_id}/actions/force-unlock

Args: workspace_id: The ID of the workspace to force 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
NameRequiredDescriptionDefault
workspace_idYes

Implementation Reference

  • The handler function that executes the force_unlock_workspace tool by making a POST request to the Terraform Cloud API endpoint /workspaces/{workspace_id}/actions/force-unlock.
    @handle_api_errors
    async def force_unlock_workspace(workspace_id: str) -> APIResponse:
        """Force unlock a workspace. This should be used with caution.
    
        Forces a workspace to unlock even when the normal unlock process isn't possible.
        This is typically needed when a run has orphaned a lock or when the user who locked
        the workspace is unavailable. This operation requires admin privileges on the workspace.
    
        WARNING: Forcing an unlock can be dangerous if the workspace is legitimately locked
        for active operations. Only use this when you are certain it's safe to unlock.
    
        API endpoint: POST /workspaces/{workspace_id}/actions/force-unlock
    
        Args:
            workspace_id: The ID of the workspace to force unlock (format: "ws-xxxxxxxx")
    
        Returns:
            The workspace with updated lock status and related metadata
    
        See:
            docs/tools/workspace.md for reference documentation
        """
        # Make API request
        return await api_request(
            f"workspaces/{workspace_id}/actions/force-unlock", method="POST"
        )
  • Registration of the force_unlock_workspace tool in the MCP server using the mcp.tool decorator with write_tool_config for non-read-only annotation.
    mcp.tool(**write_tool_config)(workspaces.force_unlock_workspace)
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations only indicate it's not read-only (readOnlyHint: false), but the description adds substantial behavioral context: it discloses the dangerous nature of the operation with warnings, explains typical scenarios for use, specifies admin privilege requirements, and mentions the API endpoint. This goes well beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage context, warnings, API endpoint, args, returns, reference). While slightly verbose, every sentence adds value—no fluff. The warning section is appropriately emphasized for a dangerous operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with risks), the description is highly complete: it covers purpose, usage guidelines, behavioral risks, parameter details, and return information. With no output schema, it helpfully describes the return value. It addresses all critical aspects for safe and correct use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for the single parameter, the description compensates by explaining that 'workspace_id' is 'The ID of the workspace to force unlock' and provides the format 'ws-xxxxxxxx'. This adds meaningful context beyond the bare schema, though it doesn't detail validation rules or examples beyond the format hint.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('force unlock') and resource ('workspace'), distinguishing it from siblings like 'unlock_workspace' by emphasizing the forceful nature. It explicitly mentions it's for when normal unlock isn't possible, providing clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('when a run has orphaned a lock or when the user who locked the workspace is unavailable'), when not to use it ('dangerous if the workspace is legitimately locked for active operations'), and mentions the alternative 'normal unlock process' implicitly. It also specifies prerequisites ('requires admin privileges').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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