restart_flow_run
Restart a Prefect workflow execution by providing the flow run ID to initiate a new run from the same starting point.
Instructions
Restart a flow run.
Args: flow_run_id: The flow run UUID
Returns: Details of the new flow run
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow_run_id | Yes |
Implementation Reference
- src/mcp_prefect/flow_run.py:155-175 (handler)The restart_flow_run tool handler, decorated with @mcp.tool. It restarts the specified Prefect flow run by creating a new one from the original using the Prefect client, adds a UI URL, and returns the details as text content.@mcp.tool async def restart_flow_run( flow_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Restart a flow run. Args: flow_run_id: The flow run UUID Returns: Details of the new flow run """ async with get_client() as client: flow_run_id_uuid = UUID(flow_run_id) new_flow_run = await client.create_flow_run_from_flow_run(flow_run_id_uuid) new_flow_run_dict = new_flow_run.dict() new_flow_run_dict["ui_url"] = get_flow_run_url(str(new_flow_run.id)) return [types.TextContent(type="text", text=str(new_flow_run_dict))]
- src/mcp_prefect/flow_run.py:155-155 (registration)The @mcp.tool decorator that registers the restart_flow_run function as an MCP tool.@mcp.tool