delete_flow_run
Remove a specific workflow execution from Prefect's automation platform by providing its unique identifier to clean up completed or failed runs.
Instructions
Delete a flow run.
Args: flow_run_id: The flow run UUID
Returns: Confirmation message
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"flow_run_id": "<flow_run_id>"
},
"name": "delete_flow_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow_run_id | Yes |
Implementation Reference
- src/mcp_prefect/flow_run.py:200-216 (handler)The handler function for the 'delete_flow_run' tool. It is decorated with @mcp.tool, which registers it with the MCP server. The function takes a flow_run_id, uses the Prefect client to delete the flow run, and returns a confirmation message.
@mcp.tool async def delete_flow_run( flow_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Delete a flow run. Args: flow_run_id: The flow run UUID Returns: Confirmation message """ async with get_client() as client: await client.delete_flow_run(UUID(flow_run_id)) return [types.TextContent(type="text", text=f"Flow run '{flow_run_id}' deleted successfully.")]