Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

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
NameRequiredDescriptionDefault
is_schedule_activeNo
limitNo

Implementation Reference

  • 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),
            }

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