Skip to main content
Glama

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
NameRequiredDescriptionDefault
generation_idYes

Implementation Reference

  • 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
  • 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(), ),
  • 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"

Other Tools

Related Tools

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/bobtista/luma-ai-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server