Skip to main content
Glama
fortunto2
by fortunto2

get_deployment_by_name

Retrieve a specific deployment by its name using the Model Context Protocol, enabling precise access to workflow configurations in the Prefect MCP Server for targeted automation tasks.

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

Implementation Reference

  • Handler function for the 'get_deployment_by_name' tool, decorated with @mcp.tool() for registration. Retrieves a Prefect deployment by parsing the name as 'flow_name/deployment_name', filters deployments using DeploymentFilter, and returns the first matching deployment 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)}"}

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