list_flows
Retrieve and manage workflow automation flows from Prefect API to monitor and organize data pipelines.
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).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_flows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- prefect_mcp_server_pkg/server.py:99-109 (handler)The handler function for the "list_flows" tool. It is decorated with @mcp.tool() for registration and implements the logic to fetch a paginated list of flows from the Prefect API using the get_client() and returns their model_dump() representations along with the count.
@mcp.tool() 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)}