delete_generation
Remove generated content from the Luma Dream Machine by specifying the generation ID to manage your media library.
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 asynchronous handler function for the delete_generation tool. It extracts the generation_id from parameters, makes a DELETE request to the Luma API, 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() function, providing the tool name, description, and input schema.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 the tool name and invokes the delete_generation handler with the provided arguments.case LumaTools.DELETE_GENERATION: result = await delete_generation(arguments) return [TextContent(type="text", text=result)]
- Enum value definition for the delete_generation tool name within the LumaTools class.DELETE_GENERATION = "delete_generation"