Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

get_deployment_by_name

Retrieve a specific deployment by its name to inspect or manage workflow automation configurations in Prefect.

Instructions

Get a deployment by its name.

Args:
    name: Name of the deployment to retrieve, in format "flow_name/deployment_name".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the 'get_deployment_by_name' tool. It retrieves a Prefect deployment by its name in 'flow_name/deployment_name' format using the Prefect client and DeploymentFilter. Returns the deployment details or an error.
    @mcp.tool()
    async def get_deployment_by_name(ctx: Context, name: str) -> Dict[str, Any]:
        """Get a deployment by its name.
    
        Args:
            name: Name of the deployment to retrieve, in format "flow_name/deployment_name".
        """
        if not name:
            return {"error": "Missing required argument: name"}
    
        if "/" not in name:
            return {"error": "Name should be in format 'flow_name/deployment_name'"}
    
        async with get_client() as client:
            try:
                flow_name, deployment_name = name.split("/", 1)
    
                # Use filters to find deployment by name
                deployment_filter = DeploymentFilter(
                    name={"equals": deployment_name}, flow_name={"equals": flow_name}
                )
                deployments = await client.read_deployments(
                    deployment_filter=deployment_filter
                )
    
                if not deployments:
                    return {"error": f"No deployment found with name: {name}"}
    
                # Return the first matching deployment
                return {"deployment": deployments[0].model_dump()}
            except Exception as e:
                return {"error": f"Failed to get deployment: {str(e)}"}
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 states this is a retrieval operation ('Get'), implying it's likely read-only, but doesn't confirm this or address other behavioral aspects like error handling, permissions required, rate limits, or what happens if the deployment doesn't exist. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 concise with two sentences: one stating the purpose and another explaining the parameter. Both sentences earn their place by adding value, and the structure is front-loaded with the main purpose first. It could be slightly more efficient by combining the sentences, but it avoids unnecessary elaboration.

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 (single parameter retrieval), 0% schema description coverage, no annotations, but presence of an output schema, the description is partially complete. It adequately explains the parameter format but lacks behavioral context and usage guidelines. The output schema likely covers return values, reducing the burden, but overall completeness is limited by missing operational details.

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

Parameters5/5

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

The description adds crucial semantic information beyond the input schema. The schema only indicates 'name' is a required string, while the description specifies the exact format: 'flow_name/deployment_name'. With 0% schema description coverage, this completely compensates by providing the necessary parameter context that the schema lacks.

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 tool's purpose with a specific verb ('Get') and resource ('deployment by its name'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_deployment_by_id' or 'filter_deployments', which would require more specific context about when to use this exact tool versus alternatives.

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. With siblings like 'get_deployment_by_id', 'filter_deployments', and 'list_deployments', there's no indication of when this name-based retrieval is preferred over ID-based or filtered approaches, leaving usage context ambiguous.

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