Skip to main content
Glama

list_generations

Retrieve and manage generated videos and images from Luma Dream Machine by accessing your creation history with pagination controls.

Instructions

Lists all generations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The handler function that implements the core logic for listing generations. It extracts limit and offset from parameters, calls the Luma API's /generations endpoint, formats the response with IDs, states, and video URLs, and returns the formatted text.
    async def list_generations(parameters: dict) -> str:
        """List all generations."""
        try:
            limit = parameters.get("limit", 10)
            offset = parameters.get("offset", 0)
    
            result = await _make_luma_request("GET", "/generations", {"limit": limit, "offset": offset})
    
            if not isinstance(result, dict) or "generations" not in result:
                raise ValueError("Invalid response from API")
    
            output = ["Generations:"]
            for gen in result["generations"]:
                output.extend(
                    [
                        f"ID: {gen['id']}",
                        f"State: {gen['state']}",
                    ]
                )
                if gen.get("assets", {}).get("video"):
                    output.append(f"Video URL: {gen['assets']['video']}")
                output.append("")
    
            return "\n".join(output)
        except Exception as e:
            logger.error(f"Error in list_generations: {str(e)}", exc_info=True)
            return f"Error listing generations: {str(e)}"
  • Pydantic BaseModel defining the input schema for the list_generations tool, with optional limit (default 10) and offset (default 0). Used for validation and JSON schema generation.
    class ListGenerationsInput(BaseModel):
        limit: int = 10
        offset: int = 0
  • Registration of the list_generations tool in the MCP server's list_tools() function, specifying name, description, and input schema.
    Tool(
        name=LumaTools.LIST_GENERATIONS,
        description="Lists all generations",
        inputSchema=ListGenerationsInput.model_json_schema(),
    ),
  • Dispatcher case in the call_tool() handler that routes calls to list_generations with the provided arguments and formats the response as TextContent.
    case LumaTools.LIST_GENERATIONS:
        result = await list_generations(arguments)
        return [TextContent(type="text", text=result)]
  • Enum value in LumaTools defining the tool name constant 'list_generations'.
    LIST_GENERATIONS = "list_generations"
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to mention that this is a read-only operation, how pagination works with 'limit' and 'offset', potential rate limits, or what the output format looks like. This leaves critical behavioral traits undisclosed.

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

Conciseness2/5

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

The description is overly concise to the point of under-specification. While it uses only two words, it does not front-load essential information or structure it effectively, as it omits key details needed for tool selection and usage, making it inefficient rather than appropriately concise.

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 listing operations, lack of annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It does not address what 'generations' are, how results are returned, or any contextual details, leaving the agent with insufficient information.

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

Parameters1/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 mention or explain the parameters 'limit' and 'offset'. It adds no meaning beyond the schema, failing to compensate for the lack of coverage, which is inadequate for a tool with 2 parameters.

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 'Lists all generations' restates the tool name 'list_generations' with minimal elaboration, making it tautological. It specifies the verb 'lists' and resource 'generations' but lacks detail on what 'generations' refers to or how it differs from sibling tools like 'get_generation' or 'create_generation', leaving the purpose vague.

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 such as 'get_generation' for a specific generation or 'create_generation' for creating new ones. There is no mention of context, prerequisites, or exclusions, making it misleading for an agent to select the correct tool.

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