Skip to main content
Glama
fortunto2
by fortunto2

filter_deployments

Filter and retrieve deployments on the Prefect MCP Server by applying specific criteria, such as active schedules, to streamline workflow management.

Instructions

Filter deployments based on specified criteria.

Args: filter_criteria: Dictionary with filter criteria according to Prefect API. Example: {"deployments": {"is_schedule_active": {"eq_": true}}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_criteriaYes

Implementation Reference

  • The handler function for the 'filter_deployments' tool, registered via @mcp.tool() decorator. It uses Prefect client to filter deployments based on the provided filter_criteria dictionary, constructing a DeploymentFilter and calling read_deployments.
    @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]}

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