Skip to main content
Glama

upscale_generation

Increase video resolution to 540p, 720p, 1080p, or 4K by processing existing generations for enhanced clarity and detail.

Instructions

Upscales a video generation to higher resolution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
generation_idYes
resolutionYes

Implementation Reference

  • The main handler function that implements the core logic for the 'upscale_generation' tool, including validation, API request to Luma's upscale endpoint, and response formatting.
    async def upscale_generation(parameters: dict) -> str:
        """Upscale a video generation."""
        try:
            generation_id = parameters.get("generation_id")
            if not generation_id:
                raise ValueError("generation_id parameter is required")
    
            resolution = parameters.get("resolution")
            if not resolution:
                raise ValueError("resolution parameter is required")
    
            request_data = {"generation_type": "upscale_video", "resolution": resolution}
            result = await _make_luma_request(
                "POST", f"/generations/{generation_id}/upscale", request_data
            )
    
            return (
                f"Upscale initiated for generation {generation_id}\n"
                f"Status: {result['state']}\n"
                f"Target resolution: {resolution}"
            )
        except Exception as e:
            logger.error(f"Error in upscale_generation: {str(e)}", exc_info=True)
            return f"Error upscaling generation {generation_id}: {str(e)}"
  • Pydantic BaseModel defining the input schema for the 'upscale_generation' tool, specifying required fields: generation_id and resolution.
    class UpscaleGenerationInput(BaseModel):
        generation_id: str
        resolution: Resolution
  • Tool registration in the list_tools() function, defining the tool name, description, and input schema for 'upscale_generation'.
    Tool(
        name=LumaTools.UPSCALE_GENERATION,
        description="Upscales a video generation to higher resolution",
        inputSchema=UpscaleGenerationInput.model_json_schema(),
    ),
  • Dispatch/registration in the call_tool() match statement, routing calls to 'upscale_generation' to the handler function.
    case LumaTools.UPSCALE_GENERATION:
        result = await upscale_generation(arguments)
        return [TextContent(type="text", text=result)]
  • Enum constant defining the tool name string 'upscale_generation' within LumaTools.
    UPSCALE_GENERATION = "upscale_generation"
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as whether this is a mutation (likely), permissions required, rate limits, side effects, or what the output looks like (e.g., returns a new generation ID).

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 waste. It's appropriately sized for a simple tool and front-loaded with the core action, making it easy to parse quickly.

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?

For a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks crucial context like output format, error conditions, or behavioral details, leaving significant gaps for an agent to use it correctly.

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?

Schema description coverage is 0%, so the description must compensate but adds no parameter details. It mentions 'higher resolution' but doesn't explain the 'resolution' enum values or what 'generation_id' refers to, leaving both parameters semantically unclear beyond the schema.

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

Purpose4/5

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

The description clearly states the action ('upscales') and resource ('a video generation'), specifying the purpose as increasing resolution. It doesn't differentiate from siblings like 'create_generation' or 'get_generation', but the verb+resource combination is unambiguous.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing generation), exclusions, or how it relates to siblings like 'create_generation' or 'get_generation'.

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