search_flows
Find and retrieve workflow flows by name or tags using the Prefect MCP Server. Filter results with specific criteria and set a limit for the number of flows returned.
Instructions
Search for flows by name and/or tags.
Args:
name: Optional name to search for (case-insensitive contains match).
tags: Optional list of tags to filter by.
limit: Maximum number of flows to return (default 20).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| name | No | ||
| tags | No |
Implementation Reference
- prefect_mcp_server_pkg/server.py:112-138 (handler)The main handler function for the 'search_flows' tool. It constructs a FlowFilter based on provided name and tags, queries the Prefect API, and returns matching flows.@mcp.tool() async def search_flows( ctx: Context, name: Optional[str] = None, tags: Optional[List[str]] = None, limit: int = 20, ) -> Dict[str, Any]: """Search for flows by name and/or tags. Args: name: Optional name to search for (case-insensitive contains match). tags: Optional list of tags to filter by. limit: Maximum number of flows to return (default 20). """ filter_dict = {} if name: filter_dict["name"] = {"contains": name} if tags: filter_dict["tags"] = {"all_": tags} async with get_client() as client: flow_filter = FlowFilter(**filter_dict) flows = await client.read_flows(flow_filter=flow_filter, limit=limit) return {"flows": [flow.model_dump() for flow in flows], "count": len(flows)}