Skip to main content
Glama
fortunto2
by fortunto2

search_deployments_by_status

Filter and retrieve deployments on the Prefect MCP Server based on their schedule status, with options to set a limit for the number of results returned.

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 handler function for the 'search_deployments_by_status' tool. It is decorated with @mcp.tool(), which registers the tool in the MCP server. The function filters Prefect deployments by schedule active status using the Prefect client API and returns a dictionary with deployments and count.
    @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), }
  • The @mcp.tool() decorator registers the search_deployments_by_status function as an MCP tool.
    @mcp.tool()

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