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"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Deletes') but fails to describe critical traits such as whether deletion is permanent, requires specific permissions, has side effects (e.g., affecting credits), or provides confirmation feedback. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence, 'Deletes a generation', which is front-loaded and wastes no words. However, this conciseness comes at the cost of under-specification, but structurally it is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a deletion operation, lack of annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It does not address behavioral risks, parameter details, or expected outcomes, making it insufficient for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, and the description does not add any meaning beyond the schema. It does not explain what 'generation_id' represents, its format, or how to obtain it, leaving the single required parameter undocumented. This fails to compensate for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Deletes a generation' restates the tool name 'delete_generation' with minimal elaboration, making it tautological. While it specifies the resource ('generation'), it lacks detail about what a 'generation' represents in this context or how this deletion differs from other operations on generations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing generation), exclusions, or comparisons to sibling tools like 'create_generation', 'get_generation', or 'upscale_generation', leaving the agent without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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