Skip to main content
Glama

cancel_flow_run

Stop an active workflow execution in Prefect by providing the flow run UUID to terminate the process and free up resources.

Instructions

Cancel a flow run.

Args: flow_run_id: The flow run UUID

Returns: Confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_run_idYes

Implementation Reference

  • The handler function decorated with @mcp.tool that implements the cancel_flow_run tool by setting the flow run state to Cancelled using the Prefect client.
    @mcp.tool async def cancel_flow_run( flow_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Cancel a flow run. Args: flow_run_id: The flow run UUID Returns: Confirmation message """ async with get_client() as client: await client.set_flow_run_state( flow_run_id=UUID(flow_run_id), state=Cancelled(message="Cancelled via MCP") ) return [types.TextContent(type="text", text=f"Flow run '{flow_run_id}' cancelled successfully.")]

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/allen-munsch/mcp-prefect'

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