Skip to main content
Glama
fortunto2

Prefect MCP Server

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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),
            }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving a list but doesn't cover critical aspects like authentication requirements, rate limits, pagination behavior beyond limit/offset, error handling, or whether this is a read-only operation. For a list tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The parameter explanations are clear and direct, with no wasted words. However, the structure could be slightly improved by separating the purpose from parameter details more distinctly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is partially complete. It covers the purpose and parameters adequately but misses behavioral context like authentication or error handling. The presence of an output schema reduces the need to explain return values, but overall completeness is limited by the lack of usage guidelines and transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for all three parameters beyond the input schema, which has 0% description coverage. It explains that 'limit' controls the maximum number of deployments returned, 'offset' skips deployments, and 'flow_id' filters deployments by flow. This compensates well for the schema's lack of descriptions, though it doesn't detail default values or optionality.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('list of deployments from the Prefect API'), making the purpose specific and understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'filter_deployments' or 'search_deployments_by_status', which likely serve similar but distinct purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'filter_deployments' or 'get_deployment_by_id'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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