Skip to main content
Glama
severity1

terraform-cloud-mcp

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
NameRequiredDescriptionDefault
workspace_idYes

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")
  • 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)
Behavior4/5

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

Annotations indicate readOnlyHint=false (mutation), which the description confirms with 'Unlock' and 'Removes the lock.' The description adds valuable behavioral context beyond annotations: it specifies the API endpoint (POST), mentions enabling 'normal operation' and 'allowing runs to be queued,' and references external documentation. No contradiction with annotations exists.

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, API endpoint, Args, Returns, See). It's front-loaded with the core purpose and uses efficient sentences. The external documentation reference is useful but slightly extends length.

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

Completeness4/5

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

For a mutation tool with no output schema, the description adequately covers purpose, parameters, and behavior. It mentions the return value ('workspace with updated lock status') and links to documentation. However, it lacks details on error cases, permissions, or side effects, which would be helpful given the tool's complexity.

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 'workspace_id,' the description compensates by specifying the parameter in the Args section with format details ('ws-xxxxxxxx'). This adds essential meaning beyond the bare schema, though it doesn't explain where to obtain the ID or validation rules.

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 ('Unlock a workspace'), the resource affected ('workspace'), and the outcome ('removes the lock... allowing runs to be queued'). It distinguishes from the sibling 'lock_workspace' by describing the opposite operation, and from 'force_unlock_workspace' by implying a standard vs forced approach.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'after it was previously locked' and 'enables normal operation.' It distinguishes from 'force_unlock_workspace' by not mentioning forced alternatives, but doesn't explicitly state when to choose one over the other or list other alternatives like workspace creation or deletion.

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