search_deployments_by_status
Filter and retrieve workflow deployments based on their schedule status to manage active or inactive automation tasks.
Instructions
Search for deployments by schedule status.
Args:
is_schedule_active: Filter deployments by whether their schedule is active.
limit: Maximum number of deployments to return (default 20).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_schedule_active | No | ||
| limit | No |
Implementation Reference
- prefect_mcp_server_pkg/server.py:325-348 (handler)The main handler function for the 'search_deployments_by_status' tool. It is decorated with @mcp.tool(), which also serves as the registration. The function filters deployments based on whether their schedule is active using Prefect's DeploymentFilter and returns a list of matching deployments.@mcp.tool() async def search_deployments_by_status( ctx: Context, is_schedule_active: Optional[bool] = None, limit: int = 20 ) -> Dict[str, Any]: """Search for deployments by schedule status. Args: is_schedule_active: Filter deployments by whether their schedule is active. limit: Maximum number of deployments to return (default 20). """ filter_dict = {} if is_schedule_active is not None: filter_dict["is_schedule_active"] = {"equals": is_schedule_active} async with get_client() as client: deployment_filter = DeploymentFilter(**filter_dict) if filter_dict else None deployments = await client.read_deployments( deployment_filter=deployment_filter, limit=limit ) return { "deployments": [depl.model_dump() for depl in deployments], "count": len(deployments), }