get_generation
Check the status of a video or image generation process on the Luma Dream Machine by providing a generation ID to track progress and results.
Instructions
Gets the status of a generation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| generation_id | Yes |
Implementation Reference
- src/luma_ai_mcp_server/server.py:306-330 (handler)The main handler function that implements the get_generation tool. It fetches the status of a specific generation from the Luma API using the provided generation_id and returns formatted status information including ID, state, failure reason if any, and video URL if available.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 BaseModel defining the input schema for the get_generation tool, requiring a 'generation_id' string.class GetGenerationInput(BaseModel): generation_id: str
- src/luma_ai_mcp_server/server.py:508-512 (registration)Registers the 'get_generation' tool with the MCP server in the list_tools() function, specifying name, description, and input schema.Tool( name=LumaTools.GET_GENERATION, description="Gets the status of a generation", inputSchema=GetGenerationInput.model_json_schema(), ),
- src/luma_ai_mcp_server/server.py:563-565 (registration)In the call_tool() handler, dispatches calls to the 'get_generation' tool by invoking the handler function and returning the result as TextContent.case LumaTools.GET_GENERATION: result = await get_generation(arguments) return [TextContent(type="text", text=result)]
- Enum constant in LumaTools defining the tool name 'get_generation' used for registration and dispatching.GET_GENERATION = "get_generation"