get_deployment_by_id
Retrieve a specific deployment by its unique ID to view configuration details and status within Prefect workflow automation.
Instructions
Get a deployment by its ID.
Args:
deployment_id: ID of the deployment to retrieve.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"deployment_id": "<deployment_id>"
},
"name": "get_deployment_by_id"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- prefect_mcp_server_pkg/server.py:246-262 (handler)The handler function implementing the 'get_deployment_by_id' tool logic. It fetches the deployment using Prefect's client.read_deployment and handles errors. Registered directly via the @mcp.tool() decorator.
@mcp.tool() async def get_deployment_by_id(ctx: Context, deployment_id: str) -> Dict[str, Any]: """Get a deployment by its ID. Args: deployment_id: ID of the deployment to retrieve. """ if not deployment_id: return {"error": "Missing required argument: deployment_id"} async with get_client() as client: try: deployment = await client.read_deployment(UUID(deployment_id)) return {"deployment": deployment.model_dump()} except Exception as e: return {"error": f"Failed to get deployment: {str(e)}"}