delete_deployment
Remove a Prefect deployment by its UUID to clean up workflow automation resources and manage your deployment lifecycle.
Instructions
Delete a deployment by ID.
Args: deployment_id: The deployment UUID
Returns: Confirmation message
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": "delete_deployment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_id | Yes |
Implementation Reference
- src/mcp_prefect/deployment.py:154-171 (handler)The handler function for the 'delete_deployment' MCP tool. It is decorated with @mcp.tool for registration and implements the logic to delete a Prefect deployment by ID using the Prefect client, returning a confirmation message.
@mcp.tool async def delete_deployment( deployment_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Delete a deployment by ID. Args: deployment_id: The deployment UUID Returns: Confirmation message """ async with get_client() as client: await client.delete_deployment(UUID(deployment_id)) return [types.TextContent(type="text", text=f"Deployment '{deployment_id}' deleted successfully.")] - src/mcp_prefect/deployment.py:154-154 (registration)The @mcp.tool decorator registers the delete_deployment function as an MCP tool.
@mcp.tool