get_flow_run_by_id
Retrieve details of a specific workflow run by its ID using the Prefect MCP Server Interface. Ideal for monitoring and managing automated task execution efficiently.
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(), which registers and implements the logic to retrieve a Prefect flow run by its ID using the Prefect client.@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)}"}