Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

filter_flows

Filter Prefect workflow automation flows using specific criteria to identify relevant workflows for management and execution.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'filter_flows' tool. It is registered via the @mcp.tool() decorator and implements filtering of Prefect flows using the provided filter criteria with the Prefect client.
    @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]}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions filtering based on criteria but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, pagination, or what happens with invalid criteria. The example hints at API usage but lacks operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence, followed by specific parameter details. Every sentence earns its place by adding value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 1 parameter with low schema coverage, and no annotations, the description is minimally adequate. It covers the purpose and parameter semantics but lacks usage guidelines and behavioral transparency, leaving gaps for effective tool selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 1 parameter, the description compensates by explaining 'filter_criteria' as a dictionary with filter criteria according to Prefect API and provides an example. This adds significant meaning beyond the schema, clarifying the parameter's purpose and format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Filter flows based on specified criteria,' which includes a specific verb ('filter') and resource ('flows'). It distinguishes from some siblings like 'list_flows' by implying filtering rather than listing all, but doesn't explicitly differentiate from 'search_flows' or other filtering tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'list_flows,' 'search_flows,' or other filtering tools. The description lacks context about prerequisites, when-not scenarios, or explicit comparisons to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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