force_execute_run
Prioritize urgent Terraform Cloud runs by canceling queued runs to unlock the workspace and execute immediately.
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
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes |
Implementation Reference
- The core handler function for the 'force_execute_run' tool. It makes a POST request to the Terraform Cloud API endpoint /runs/{run_id}/actions/force-execute to prioritize and 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")
- terraform_cloud_mcp/server.py:72-72 (registration)The registration of the 'force_execute_run' tool in the MCP server using the FastMCP tool decorator with write permissions configuration.mcp.tool(**write_tool_config)(runs.force_execute_run)