Skip to main content
Glama

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

Implementation Reference

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

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