get_flow_run
Retrieve detailed information about a specific workflow execution using its unique identifier to monitor status, track progress, and analyze performance.
Instructions
Get details of a specific flow run by ID.
Args: flow_run_id: The flow run UUID
Returns: Flow run details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow_run_id | Yes |
Implementation Reference
- src/mcp_prefect/flow_run.py:87-108 (handler)The main handler function for the 'get_flow_run' MCP tool. It fetches the flow run details using Prefect client, adds a UI URL, and returns as TextContent.@mcp.tool async def get_flow_run( flow_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Get details of a specific flow run by ID. Args: flow_run_id: The flow run UUID Returns: Flow run details """ async with get_client() as client: flow_run = await client.read_flow_run(UUID(flow_run_id)) # Add UI link flow_run_dict = flow_run.dict() flow_run_dict["ui_url"] = get_flow_run_url(flow_run_id) return [types.TextContent(type="text", text=str(flow_run_dict))]
- src/mcp_prefect/flow_run.py:12-14 (helper)Helper function to generate the UI URL for a flow run, used in the get_flow_run handler.def get_flow_run_url(flow_run_id: str) -> str: base_url = PREFECT_API_URL.replace("/api", "") return f"{base_url}/flow-runs/{flow_run_id}"