Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

filter_deployments

Filter Prefect deployments by criteria like schedule status or tags to manage workflow automation efficiently.

Instructions

Filter deployments based on specified criteria.

Args:
    filter_criteria: Dictionary with filter criteria according to Prefect API.
                     Example1: {"deployments": {"is_schedule_active": {"eq_": true}}}
                     Example2: {"deployments": {"tags": {"all_": ["production"]}}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_criteriaYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'filter_deployments' tool. It is decorated with @mcp.tool() for registration and implements filtering of Prefect deployments using DeploymentFilter and the Prefect client.
    @mcp.tool()
    async def filter_deployments(
        ctx: Context, filter_criteria: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Filter deployments based on specified criteria.
    
        Args:
            filter_criteria: Dictionary with filter criteria according to Prefect API.
                             Example1: {"deployments": {"is_schedule_active": {"eq_": true}}}
                             Example2: {"deployments": {"tags": {"all_": ["production"]}}}
        """
        async with get_client() as client:
            deployment_filter = DeploymentFilter(**filter_criteria)
            deployments = await client.read_deployments(deployment_filter=deployment_filter)
            return {"deployments": [deployment.model_dump() for deployment in deployments]}
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states the basic filtering action without mentioning permissions required, rate limits, pagination behavior, or what happens when no deployments match criteria. For a tool with one complex parameter and no annotation coverage, this leaves significant behavioral gaps.

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 perfectly structured and concise. The first sentence states the core purpose, followed by a clear 'Args:' section with parameter explanation and helpful examples. Every sentence earns its place with no wasted words or 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 one complex parameter (nested object), no annotations, but does have an output schema, the description is moderately complete. The parameter explanation with examples is excellent, but behavioral aspects (permissions, rate limits, error conditions) are missing. The output schema existence means return values don't need description, but other contextual gaps remain.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must fully compensate. It provides excellent parameter semantics: it explains the single parameter is a dictionary with filter criteria according to Prefect API, and gives two concrete examples showing different filtering approaches (boolean condition and tag filtering). This adds substantial value beyond the bare schema.

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 verb ('filter') and resource ('deployments'), making the purpose immediately understandable. It distinguishes from siblings like 'list_deployments' and 'search_deployments_by_status' by specifying filtering based on criteria rather than simple listing or status-based searching. However, it doesn't explicitly contrast with all siblings like 'get_deployment_by_id'.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_deployments' or 'search_deployments_by_status'. It mentions filtering 'based on specified criteria' but doesn't explain what scenarios warrant this over simpler listing tools or when to choose other filtering siblings.

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