Skip to main content
Glama

tool_clone_voice_from_audio

Create a reusable voice profile from a 5–30 second speech sample. Provide a local WAV file or a YouTube URL clip with an exact transcript to save the voice for later text-to-speech synthesis.

Instructions

Save a voice profile from a reference audio (5-30s WAV ideal).

Two input modes (EITHER ref_audio_path OR audio_url must be provided, not both): A) Local file: pass ref_audio_path='/path/to/sample.wav'. B) URL clip: pass audio_url='https://youtu.be/...', ts=30, tf=45. yt-dlp downloads the audio and ffmpeg slices [ts, tf] into a 24kHz mono 16-bit PCM WAV, which is then used as the reference.

Workflow:

  1. Pick a clean 5-30s speech sample (local file OR URL clip).

  2. Write the exact transcript in ref_text.

  3. Pick a memorable voice_name (used later as voice_name= in synthesize_speech).

  4. Returns a dict with 'status', 'voice_name', 'profile_path', 'ref_audio_path', and (for URL mode) 'source_url', 'ts', 'tf', 'clip_duration_s'.

Common errors:

  • both ref_audio_path and audio_url provided: pick one.

  • voice_exists: pass overwrite=True or pick a different voice_name.

  • bad local path: check the path exists and is readable.

  • bad URL: yt-dlp/ffmpeg failure will be reported in the raised RuntimeError.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tfNoMode B only: end second of the URL clip (default: end of stream). Example: ts=30, tf=45 yields a 15-second clip from 30s to 45s. Voice cloning needs >=3s; 5-30s is the ideal range. Ignored if audio_url is not provided.
tsNoMode B only: start second of the URL clip (default 0). Example: ts=30 starts at 30s into the video. Combined with tf, defines the [ts, tf] clip window.
languageNoLanguage of the reference audio. 'auto' (default, OmniVoice detects), or one of: 'English', 'Italian', 'French', 'German', 'Spanish', etc.auto
ref_textYesExact transcript of what is spoken in the reference audio, including punctuation. OmniVoice uses this for prosody matching. Wrong transcripts degrade clone quality. Required in BOTH input modes (local file or URL clip).
audio_urlNoMode B: YouTube (or any yt-dlp-supported) URL. Combined with ts/tf it downloads + slices a clip into a temp file and uses that as the reference. Example: 'https://www.youtube.com/watch?v=21X5lGlDOfg'. SUGGESTED DURATION: 5-30 seconds ideal for voice cloning. Pipeline: yt-dlp download -> ffmpeg slice [ts, tf] -> 24kHz mono 16-bit PCM WAV. Use EITHER this OR ref_audio_path, not both.
overwriteNoIf True, replace an existing profile with the same voice_name. Default: False.
voice_nameYesUnique identifier for this voice (alphanumeric + underscores, 1-64 chars). Will be slugified. Use a memorable name like 'claudia_asmr' or 'nasa_male_v1'. Used in subsequent synthesize_speech(voice_name=...) calls.
descriptionNoOptional human-readable description (e.g. 'ASMR whisper, female, CC0 from archive.org' or 'NASA mission audio, male, PD US Gov').
ref_audio_pathNoMode A: absolute path to the reference audio file (WAV, 16-bit PCM, 24kHz ideal). 5-30 seconds of clear, single-speaker speech works best. Example: '/home/jagones/Repositories/VoiceStudio/inputs/asmr_sample.wav'. Use EITHER this OR audio_url, not both. Omit both to get a validation error.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the behavioral burden and delivers rich disclosure: the exact transformation pipeline (yt-dlp download -> ffmpeg slice [ts, tf] -> 24kHz mono 16-bit PCM WAV), validation behavior (providing both modes fails; omitting both fails), overwrite semantics, voice_name slugification, and precise failure reporting ('yt-dlp/ffmpeg failure will be reported in the raised RuntimeError'). It even discloses the full return-dict shape, which is essential given there is 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?

Long but exceellently structured: purpose line up front, mode blocks, numbered workflow, and error bullet list — highly scannable. Minor redundancy exists (the 5-30s ideal and 24kHz format appear multiple times across description and schema), but the length is proportionate to a 9-parameter, two-mode tool and every block serves a purpose.

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 a high-complexity tool with no annotations and no output schema, this description is remarkably complete: it covers input modes, prerequisites, transformation side-effects, exact return keys, and all realistic failure modes. The only omissions (rate limits, timeouts) are minor for a local-file/URL pipeline, and the description compensates fully for the missing structured metadata.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds meaning beyond the per-property schema text by grouping parameters into modes (A: ref_audio_path; B: audio_url + ts + tf), sequencing them in a workflow ('Write the exact transcript in ref_text' before picking a name), and linking voice_name to downstream synthesize_speech calls. This cross-parameter framing helps an agent reason about parameter relationships without redundantly restating schema content.

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?

Opens with a specific action verb and resource: 'Save a voice profile from a reference audio (5-30s WAV ideal)'. The two input modes (local file vs URL clip) and the numbered workflow make the tool's function unambiguous, and the explicit tie to 'used later as voice_name= in synthesize_speech' positions it distinctly from siblings like list_voices, delete_voice, and design_voice.

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

Usage Guidelines4/5

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

Provides explicit when-to-use guidance: prerequisites (5-30s clean single-speaker speech, exact transcript), a numbered 4-step workflow, mode-selection rules ('EITHER ref_audio_path OR audio_url must be provided, not both'), and common-error remedies (overwrite=True for existing voice names). It does not explicitly name tool_design_voice as the alternative when no reference audio exists, so the exclusions dimension is slightly incomplete.

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

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/jagones84/mcp-voice-studio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server