Skip to main content
Glama

generate_voiceover

Destructive

Convert text to speech audio for narrated demos, returning an audio path and cache status so you can pace video recording to the speech duration.

Instructions

[Cinematic Engine - PHASE 1] Generate voiceover audio from text using TTS.

IMPORTANT: Call this FIRST before recording! Audio duration determines video pacing. Use get_audio_duration() to know exact timing.

Workflow:

  1. generate_voiceover() -> get audio path

  2. get_audio_duration() -> know timing (e.g., 8 seconds)

  3. start_recording() -> record video paced to audio duration

  4. Use ffmpeg via shell -> combine in post-production (see check_environment())

Lazy-loads the TTS client on first call. Caches audio files to avoid redundant API costs during retakes.

Args: text: The text to convert to speech provider: TTS provider - "openai" (default) or "elevenlabs" voice: Voice ID - OpenAI: alloy, echo, fable, onyx, nova, shimmer ElevenLabs recommended voices (natural, expressive): - "H2JKG8QcEaH9iUMauArc" (Abhinav - warm, natural male) - "qr9D67rNgxf5xNgv46nx" (Tarun - expressive male) speed: Speech speed multiplier (0.25 to 4.0, default 1.0)

ElevenLabs voice modulation (for natural, less robotic speech):
stability: Voice consistency (0.0-1.0). Lower = more expressive/variable,
          higher = more consistent. Default 0.5. Try 0.3-0.4 for natural speech.
similarity_boost: Voice clarity (0.0-1.0). Higher = clearer but may sound
                 artificial. Default 0.75. Try 0.5-0.7 for natural speech.
style: Expressiveness/emotion (0.0-1.0). Higher = more emotive delivery.
      Default 0. Try 0.2-0.5 for engaging narration. Only works with v2 models.
use_speaker_boost: Enhance speaker clarity (bool). Default True.
                  Can help with clarity but may reduce naturalness.

Returns: {"success": True, "data": {"path": "/path/to/audio.mp3", "cached": bool}}

Example: # Natural, expressive voiceover vo = generate_voiceover( text="Welcome to our product demo.", provider="elevenlabs", voice="H2JKG8QcEaH9iUMauArc", # Abhinav - warm, natural stability=0.35, # More expressive similarity_boost=0.6, # Balanced clarity style=0.3 # Some emotion ) duration = get_audio_duration(vo["data"]["path"]) # Now record video paced to duration["data"]["duration_sec"]

Requires: pip install browser-director[video]

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "generate_voiceover"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
speedNo
styleNo
voiceNoalloy
providerNoopenai
stabilityNo
similarity_boostNo
use_speaker_boostNo

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing lazy client loading on first call, audio file caching to avoid redundant API costs during retakes, and a pip dependency requirement. It also gives the return payload shape and a concrete worked example. It does not discuss failure modes or rate limits, and it never addresses why the tool carries destructiveHint=true, which is a minor gap.

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?

Front-loads the phase label and the critical "call this first" rule, then uses clear Workflow/Args/Returns/Example sections. It is somewhat long, and the example restates voice names and tuning values already given in Args, which is mild redundancy rather than waste.

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

Completeness5/5

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

For an 8-parameter generation tool this covers everything an agent needs: ordering constraints, per-parameter tuning guidance, return shape, a runnable example, and the install prerequisite. The presence of an output schema means return values need not be explained further, yet the description supplies them anyway.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description must carry all parameter meaning, and it does: text, provider values, concrete voice IDs per provider, speed range (0.25-4.0), and the four ElevenLabs modulation params with ranges, defaults, and practical tuning advice (e.g. stability 0.3-0.4 for natural speech, style only on v2 models). This is meaningfully richer than the bare schema titles.

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

Purpose5/5

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

States a specific verb and resource ("Generate voiceover audio from text using TTS") and labels itself PHASE 1 of a named pipeline. It is immediately distinguishable from siblings like get_audio_duration and start_recording, which are named in the workflow.

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

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit ordering rule ("Call this FIRST before recording!") with the rationale that audio duration determines video pacing. The numbered workflow names the exact alternatives to call at each subsequent step, including the final ffmpeg/post-production step.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.