delete_generation
Remove specific generated content from the Luma Dream Machine by providing the generation ID to delete unwanted videos or images.
Instructions
Deletes a generation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| generation_id | Yes |
Implementation Reference
- src/luma_ai_mcp_server/server.py:361-372 (handler)The main handler function for the delete_generation tool, which extracts the generation_id from parameters, makes a DELETE request to the Luma API endpoint /generations/{generation_id}, and returns success or error message.async def delete_generation(parameters: dict) -> str: """Delete a generation.""" try: generation_id = parameters.get("generation_id") if not generation_id: raise ValueError("generation_id parameter is required") await _make_luma_request("DELETE", f"/generations/{generation_id}") return f"Generation {generation_id} deleted successfully" except Exception as e: logger.error(f"Error in delete_generation: {str(e)}", exc_info=True) return f"Error deleting generation {generation_id}: {str(e)}"
- Pydantic BaseModel defining the input schema for the delete_generation tool, which requires a single 'generation_id' string field.class DeleteGenerationInput(BaseModel): generation_id: str
- src/luma_ai_mcp_server/server.py:518-522 (registration)Registration of the delete_generation tool in the MCP server's list_tools() method, specifying its name from LumaTools enum, description, and input schema from DeleteGenerationInput.Tool( name=LumaTools.DELETE_GENERATION, description="Deletes a generation", inputSchema=DeleteGenerationInput.model_json_schema(), ),
- src/luma_ai_mcp_server/server.py:571-573 (registration)Dispatch logic in the MCP server's call_tool() method that matches on LumaTools.DELETE_GENERATION and calls the delete_generation handler function with arguments, returning the result as text content.case LumaTools.DELETE_GENERATION: result = await delete_generation(arguments) return [TextContent(type="text", text=result)]
- Enum value in LumaTools defining the string name 'delete_generation' used for tool identification and matching.DELETE_GENERATION = "delete_generation"