Skip to main content
Glama
fortunto2
by fortunto2

filter_flows

Filter Prefect workflows by specific criteria, such as tags or attributes, to identify and manage relevant flows efficiently using dictionary-based filtering.

Instructions

Filter flows based on specified criteria.

Args: filter_criteria: Dictionary with filter criteria according to Prefect API. Example: {"flows": {"tags": {"all_": ["production"]}}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_criteriaYes

Implementation Reference

  • The handler function for the 'filter_flows' MCP tool. It is decorated with @mcp.tool() for registration and implements filtering of Prefect flows using a dictionary of filter criteria passed to Prefect's FlowFilter schema.
    @mcp.tool() async def filter_flows(ctx: Context, filter_criteria: Dict[str, Any]) -> Dict[str, Any]: """Filter flows based on specified criteria. Args: filter_criteria: Dictionary with filter criteria according to Prefect API. Example: {"flows": {"tags": {"all_": ["production"]}}} """ async with get_client() as client: flow_filter = FlowFilter(**filter_criteria) flows = await client.read_flows(flow_filter=flow_filter) return {"flows": [flow.model_dump() for flow in flows]}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fortunto2/prefect-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server