Skip to main content
Glama

add_audio

Add audio to generated videos by providing a prompt and generation ID, enabling synchronized sound creation for visual content.

Instructions

Adds audio to a video generation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
generation_idYes
promptYes
negative_promptNo
callback_urlNo

Implementation Reference

  • The main handler function for the 'add_audio' tool. It validates parameters, constructs the request to the Luma API to add audio to a video generation, and returns the status.
    async def add_audio(parameters: dict) -> str:
        """Add audio to a video generation."""
        try:
            generation_id = parameters.get("generation_id")
            if not generation_id:
                raise ValueError("generation_id parameter is required")
    
            prompt = parameters.get("prompt")
            if not prompt:
                raise ValueError("prompt parameter is required")
    
            request_data = {"generation_type": "add_audio", "prompt": prompt}
            if "negative_prompt" in parameters:
                request_data["negative_prompt"] = parameters["negative_prompt"]
    
            result = await _make_luma_request(
                "POST", f"/generations/{generation_id}/audio", request_data
            )
    
            return (
                f"Audio generation initiated for generation {generation_id}\n"
                f"Status: {result['state']}\n"
                f"Prompt: {prompt}"
            )
        except Exception as e:
            logger.error(f"Error in add_audio: {str(e)}", exc_info=True)
            return f"Error adding audio to generation {generation_id}: {str(e)}"
  • Pydantic input schema for the 'add_audio' tool, defining required generation_id and prompt, with optional negative_prompt and callback_url.
    class AddAudioInput(BaseModel):
        generation_id: str
        prompt: str
        negative_prompt: Optional[str] = None
        callback_url: Optional[str] = None
  • Tool registration in the MCP server's list_tools() function, specifying name, description, and input schema for 'add_audio'.
    Tool(
        name=LumaTools.ADD_AUDIO,
        description="Adds audio to a video generation",
        inputSchema=AddAudioInput.model_json_schema(),
    ),
  • Dispatcher in call_tool() that routes calls to the 'add_audio' handler function.
    case LumaTools.ADD_AUDIO:
        result = await add_audio(arguments)
        return [TextContent(type="text", text=result)]
  • Enum value in LumaTools defining the tool name 'add_audio'.
    ADD_AUDIO = "add_audio"
Behavior2/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 states the action ('adds audio') but doesn't describe key traits: whether this is a mutation (likely, given 'adds'), what permissions or credits might be required, if it's asynchronous (hinted by 'callback_url' but not explained), or what happens on failure. This leaves significant gaps for a tool with 4 parameters and no output schema.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without fluff. It's appropriately sized for a simple action, though it could be more front-loaded with key details. No wasted words, but it risks under-specification due to brevity.

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 (a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema), the description is incomplete. It doesn't explain the tool's behavior, parameter roles, or expected outcomes, making it inadequate for an AI agent to use correctly without guesswork. More context is needed to compensate for the lack of structured data.

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 for undocumented parameters. It mentions 'audio' and 'video generation' but doesn't explain any parameters: e.g., what 'generation_id' refers to, how 'prompt' relates to audio generation, the purpose of 'negative_prompt' or 'callback_url'. This adds minimal meaning beyond the schema's basic titles, failing to address the coverage gap.

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 'Adds audio to a video generation' states the basic action (add audio) and resource (video generation), but it's vague about what this entails—does it generate audio from a prompt, upload existing audio, or something else? It distinguishes from siblings like 'create_generation' or 'upscale_generation' by focusing on audio addition, but lacks specificity on the verb's mechanism.

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. For example, it doesn't clarify if this is for adding audio to an existing video generation (implied by 'generation_id') or how it relates to other tools like 'create_generation'. There's no mention of prerequisites, exclusions, or typical workflows, leaving usage context unclear.

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