Skip to main content
Glama
fortunto2
by fortunto2

list_deployments

Retrieve and filter deployment records from Prefect workflows to monitor and manage automation processes.

Instructions

Get a list of deployments from the Prefect API.

Args: limit: Maximum number of deployments to return (default 20). offset: Number of deployments to skip (default 0). flow_id: Optional ID of the flow to filter deployments by.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
flow_idNo

Implementation Reference

  • The async handler function for the 'list_deployments' MCP tool. It retrieves a list of Prefect deployments using the Prefect client, supports pagination with limit/offset, and optional filtering by flow_id. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool() async def list_deployments( ctx: Context, limit: int = 20, offset: int = 0, flow_id: Optional[str] = None ) -> Dict[str, Any]: """Get a list of deployments from the Prefect API. Args: limit: Maximum number of deployments to return (default 20). offset: Number of deployments to skip (default 0). flow_id: Optional ID of the flow to filter deployments by. """ filter_dict = {} if flow_id: filter_dict["flow_id"] = {"equals": flow_id} 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, offset=offset ) 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