get_flow_run_by_id
Retrieve a specific workflow execution's details by providing its unique identifier to monitor status and access results.
Instructions
Get a flow run by its ID.
Args:
flow_run_id: ID of the flow run to retrieve.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow_run_id | Yes |
Implementation Reference
- prefect_mcp_server_pkg/server.py:145-161 (handler)The handler function decorated with @mcp.tool() that implements the 'get_flow_run_by_id' tool logic. It fetches the flow run using the Prefect client, validates input, and handles errors.@mcp.tool() async def get_flow_run_by_id(ctx: Context, flow_run_id: str) -> Dict[str, Any]: """Get a flow run by its ID. Args: flow_run_id: ID of the flow run to retrieve. """ if not flow_run_id: return {"error": "Missing required argument: flow_run_id"} async with get_client() as client: try: flow_run = await client.read_flow_run(UUID(flow_run_id)) return {"flow_run": flow_run.model_dump()} except Exception as e: return {"error": f"Failed to get flow run: {str(e)}"}