Skip to main content
Glama

Text To Audio

text_to_audio

Convert text to speech audio using TTS models.

Generates natural-sounding speech from text with customizable voice and parameters.

Supports three modes, and each model implements exactly one — passing the wrong one is rejected with a 422. Leave mode unset and it is taken from the model's own card:

  • custom_voice: pick a preset voice (e.g. Kokoro, Chatterbox)

  • voice_clone: reproduce the speaker in ref_audio (+ optional ref_text)

  • voice_design: build a voice from an instruct description

lang and voice values are per-model and listed under each model in the "Available models" section below (Kokoro: lang 'en-us', voice 'af_alloy'; Qwen3: lang 'English'). Leave them unset to use the model's own defaults.


Available models:

  • Qwen3_TTS_12Hz_1_7B_VoiceDesign: text=10-5000 chars, speed=1 (fixed), sample_rate: 24000, mode=voice_design, format=mp3 langs: English, Italian, Spanish, Portuguese, Russian, French, German, Korean, Japanese, Chinese (voice from instruct)

  • Qwen3_TTS_12Hz_1_7B_Base: text=10-5000 chars, speed=1 (fixed), sample_rate: 24000, mode=voice_clone, format=mp3 langs: English, Italian, Spanish, Portuguese, Russian, French, German, Korean, Japanese, Chinese (voice from ref_audio, 5-15s)

  • Qwen3_TTS_12Hz_1_7B_CustomVoice: text=10-5000 chars, speed=1 (fixed), sample_rate: 24000, mode=custom_voice, format=mp3 langs: Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian (10); voices (9, shared): Vivian, Serena, Uncle_Fu, Dylan, Eric, Ryan, Aiden, Ono_Anna, Sohee (Chinese lacks Ryan)

  • Chatterbox: text=10-2000 chars, speed=1 (fixed), sample_rate: 24000, mode=custom_voice, format=mp3 langs: ar, da, de, el, en, es, fi, fr, he, hi, it, ja, ko, ms, nl, no, pl, pt, ru, sv, sw, tr, zh (23); voices (1, same in every language): default

  • Kokoro: text=3-10001 chars, speed=0.5-2, sample_rate: 24000, mode=custom_voice, format=mp3 langs: en-us [20: af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa]; en-gb [8: bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis]; es [3: ef_dora, em_alex, em_santa]; fr-fr [1: ff_siwis]; hi [4: hf_alpha, hf_beta, hm_omega, hm_psi]; it [2: if_sara, im_nicola]; pt-br [3: pf_dora, pm_alex, pm_santa]

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>",
      "model": "<model>"
    },
    "name": "text_to_audio"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoLanguage code as the model expects it (Kokoro: 'en-us'; Qwen3: 'English'). Defaults to the model's own
modeNoTTS mode: 'custom_voice', 'voice_clone' or 'voice_design'. Leave unset to use the mode the model supports
textYesText to convert to speech
modelYesTTS model name (e.g., 'Kokoro')
speedNoSpeech speed. Per model (see 'speed' in the model list; most fix it at 1). Defaults to the model's own
voiceNoVoice name from the model list for the chosen lang (e.g. Kokoro en-us 'af_alloy'). Defaults to the model's default voice for that language
instructNoVoice description for voice_design models (required there), or style/emotion control in custom_voice mode, e.g. 'speak slowly and warmly'
ref_textNoTranscript of ref_audio, improves cloning accuracy
ref_audioNoReference audio sample to clone (data URI, base64 or URL). Requires mode='voice_clone'
sample_rateNoSample rate in Hz. Defaults to the model's own
webhook_urlNoHTTPS URL for deAPI to call when this job finishes. Notifies your own systems; the tool still returns the result here
audio_formatNoOutput format. Defaults to the model's own; most models emit mp3 only
webhook_secretNo32-255 char key deAPI signs the callback with (HMAC-SHA256). Needs webhook_url. A secret given in chat stays in the transcript

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the 422 rejection on mode mismatch, the implicit defaulting behavior for `mode`, `lang`, `voice`, `speed` and `sample_rate`, per-model hard constraints (character ranges, speed fixed at 1 for most, mp3-only output), and that `webhook_url` notifies external systems while the result is still returned here. It also warns that a `webhook_secret` supplied in chat persists in the transcript, which is a genuine safety-relevant behavior an agent could not derive from the 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 mode block is front-loaded and well structured, and the model catalog is dense rather than padded. The sentence 'Generates natural-sounding speech from text with customizable voice and parameters' is pure filler that restates the first line. The long voice inventory is justified by real per-model divergence, though it dominates the definition's length.

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 13-parameter, multi-mode generation tool with no annotations, the definition covers model selection, mode/parameter coupling, defaults, validation failures, and webhook side effects; the output schema handles return values. An agent can construct a valid call without opening any other source.

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, but the description adds concrete allowed values the schema only gestures at: exact lang codes (Kokoro 'en-us' vs Qwen3 'English'), the 20/8/3/1/4/2/3 voice inventories per language, and the 5-15s duration expectation for `ref_audio`. It also ties parameters to modes (e.g., `ref_audio` only under voice_clone), which the schema states only in one param's description.

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 first line states a specific verb and resource ('Convert text to speech audio using TTS models') and the mode block clarifies exactly what kind of synthesis is offered. It never mentions the sibling `text_to_audio_price`, so an agent must infer the free/paid split rather than being routed to it. The purpose itself is unmistakable.

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?

Mode selection guidance is explicit and actionable: each model implements exactly one mode, a mismatch returns 422, and leaving `mode` unset resolves from the model card. The three modes are described with the parameter each requires (`voice`, `ref_audio`, `instruct`). What is missing is when to choose this tool over `text_to_audio_price` or `get_available_models`.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.