Skip to main content
Glama
fortunto2
by fortunto2

cancel_flow_run

Stop an active workflow execution in Prefect by providing the flow run ID to halt processing and free resources.

Instructions

Cancel a flow run.

Args: flow_run_id: ID of the flow run to cancel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_run_idYes

Implementation Reference

  • The handler function for the 'cancel_flow_run' MCP tool. It is decorated with @mcp.tool() for automatic registration. The function validates the flow_run_id input, uses the Prefect client to cancel the flow run by UUID, and returns success or error details.
    @mcp.tool() async def cancel_flow_run(ctx: Context, flow_run_id: str) -> Dict[str, Any]: """Cancel a flow run. Args: flow_run_id: ID of the flow run to cancel. """ if not flow_run_id: return {"error": "Missing required argument: flow_run_id"} async with get_client() as client: try: result = await client.cancel_flow_run(UUID(flow_run_id)) return {"success": True, "result": str(result)} except Exception as e: return {"error": f"Failed to cancel flow run: {str(e)}"}

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/fortunto2/prefect-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server