Skip to main content
Glama

get_generation

Check the status of a video or image generation created with Luma AI's Dream Machine.

Instructions

Gets the status of a generation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
generation_idYes

Implementation Reference

  • The main handler function that executes the get_generation tool logic: fetches generation status from Luma API using the provided generation_id and formats the response.
    async def get_generation(parameters: dict) -> str:
        """Get the status of a generation."""
        try:
            generation_id = parameters.get("generation_id")
            if not generation_id:
                raise ValueError("generation_id parameter is required")
    
            result = await _make_luma_request("GET", f"/generations/{generation_id}")
    
            if not isinstance(result, dict):
                raise ValueError("Invalid response from API")
    
            output = [f"Generation ID: {result['id']}", f"State: {result['state']}"]
    
            if result.get("failure_reason"):
                output.append(f"Reason: {result['failure_reason']}")
    
            if result.get("assets", {}).get("video"):
                output.append(f"Video URL: {result['assets']['video']}")
    
            return "\n".join(output)
        except Exception as e:
            logger.error(f"Error in get_generation: {str(e)}", exc_info=True)
            return f"Error getting generation {generation_id}: {str(e)}"
  • Pydantic input schema for the get_generation tool, defining the required 'generation_id' field.
    class GetGenerationInput(BaseModel):
        generation_id: str
  • Tool registration in the MCP server's list_tools() method, defining name, description, and input schema for get_generation.
    Tool(
        name=LumaTools.GET_GENERATION,
        description="Gets the status of a generation",
        inputSchema=GetGenerationInput.model_json_schema(),
    ),
  • Dispatch/handling of get_generation tool call in the MCP server's call_tool() method.
    case LumaTools.GET_GENERATION:
        result = await get_generation(arguments)
        return [TextContent(type="text", text=result)]
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 this is a read operation ('Gets'), implying it's non-destructive, but doesn't cover other traits like authentication needs, rate limits, error handling, or what 'status' includes (e.g., progress, completion, errors). This leaves significant gaps for a tool that likely interacts with asynchronous processes.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, though this conciseness comes at the cost of detail.

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

Completeness2/5

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

Given the complexity (likely checking status of an asynchronous generation process), no annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't explain what 'status' means, what the return values are, or how this fits into workflows with siblings like 'create_generation'. More context is needed for effective use.

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 input schema has 1 parameter with 0% description coverage, and the tool description adds no information about the 'generation_id' parameter. It doesn't explain what a generation_id is, how to obtain it, its format, or its relationship to other tools (e.g., from 'create_generation'). This fails to compensate for the schema's lack of documentation.

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

Purpose3/5

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

The description 'Gets the status of a generation' clearly states the verb ('Gets') and resource ('a generation'), but it's vague about what 'status' entails and doesn't differentiate from sibling tools like 'list_generations' or 'create_generation'. It's adequate but lacks specificity about the scope of information retrieved.

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

Usage Guidelines2/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 doesn't mention prerequisites (e.g., needing a generation_id from a prior operation), exclusions, or comparisons to siblings like 'list_generations' for bulk retrieval or 'create_generation' for initiating processes.

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