list_flows
Retrieve a list of flows from the Prefect API for workflow management. Specify limit and offset parameters to control the number of flows returned and pagination.
Instructions
Get a list of flows from the Prefect API.
Args:
limit: Maximum number of flows to return (default 20).
offset: Number of flows to skip (default 0).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- prefect_mcp_server_pkg/server.py:100-109 (handler)The main handler function for the 'list_flows' MCP tool. It is decorated with @mcp.tool() for registration and implements the logic to retrieve a paginated list of flows from the Prefect API using the client.async def list_flows(ctx: Context, limit: int = 20, offset: int = 0) -> Dict[str, Any]: """Get a list of flows from the Prefect API. Args: limit: Maximum number of flows to return (default 20). offset: Number of flows to skip (default 0). """ async with get_client() as client: flows = await client.read_flows(limit=limit, offset=offset) return {"flows": [flow.model_dump() for flow in flows], "count": len(flows)}