Skip to main content
Glama

force_execute_run

Cancel prior runs to prioritize immediate execution of a specific Terraform run, unlocking the workspace for urgent tasks. Use this tool to manage run queues effectively.

Instructions

Forcefully execute a run by canceling all prior runs

Prioritizes a specific run by canceling other queued runs to unlock the workspace, equivalent to clicking "Run this plan now" in the UI. Use this when a run is stuck in the pending queue but needs immediate execution due to urgency or priority over other queued runs.

API endpoint: POST /runs/{run_id}/actions/force-execute

Args: run_id: The ID of the run to execute (format: "run-xxxxxxxx")

Returns: Status update confirming the run has been promoted to active status, with information about which runs were canceled to allow execution

See: docs/tools/run.md for reference documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes

Implementation Reference

  • The primary handler function implementing the logic for the 'force_execute_run' tool. It performs a POST request to the Terraform Cloud API endpoint to force-execute the specified run by canceling prior queued runs.
    @handle_api_errors async def force_execute_run(run_id: str) -> APIResponse: """Forcefully execute a run by canceling all prior runs Prioritizes a specific run by canceling other queued runs to unlock the workspace, equivalent to clicking "Run this plan now" in the UI. Use this when a run is stuck in the pending queue but needs immediate execution due to urgency or priority over other queued runs. API endpoint: POST /runs/{run_id}/actions/force-execute Args: run_id: The ID of the run to execute (format: "run-xxxxxxxx") Returns: Status update confirming the run has been promoted to active status, with information about which runs were canceled to allow execution See: docs/tools/run.md for reference documentation """ # Make API request return await api_request(f"runs/{run_id}/actions/force-execute", method="POST")
  • Registers the 'force_execute_run' tool with the MCP server using the write_tool_config for permissions and annotations.
    mcp.tool(**write_tool_config)(runs.force_execute_run)
  • Configuration dictionary applied to write-enabled tools like 'force_execute_run' during registration, controlling whether the tool is enabled based on read-only mode and setting read-only hint annotation.
    write_tool_config = { "enabled": not read_only_mode, "annotations": {"readOnlyHint": False} }

Other Tools

Related 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