Skip to main content
Glama

Agent Data Tools: Speech to text and text to speech

Text to speech: long text, up to 2,000 characters as one MP3, natural voices

text_to_speech
Read-only

Text to speech for a paragraph or a page: up to 2,000 characters as one MP3 in 7 languages (English, Spanish, German, French, Dutch, Italian and Japanese; 89 voices) with Deepgram Aura-2; zh and ko are retired with MeloTTS (Workers AI, 20 Nov 2026). Pick a voice by name or leave the default. Use for narration, article and summary read-outs, voice replies, IVR prompts and accessibility; for a sentence of up to 300 characters ai_speech costs less. Price $0.08/call via x402 USDC or a card key (/credits); failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": "text_to_speech"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoLanguage: en, es, de, fr, nl, it or ja (Aura-2 MP3, many voices); zh and ko are retired (MeloTTS was removed from Workers AI, 20 Nov 2026); default en
textYesText to speak, up to 2,000 characters
voiceNoVoice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier, agustina, antonia, gloria, luciano, olivia, silvia, valerio. German: julius, elara, aurelia, lara, fabian, kara, viktoria. French: agathe, hector. Dutch: rhea, beatrix, daphne, cornelia, sander, hestia, lars, roman, leda. Italian: livia, melia, elio, flavio, maia, cinzia, cesare, dionisio, demetra. Japanese: izanami, uzume, ebisu, fujin, ama. Default: luna (en), aquila (es), else the first listed
formatNoAudio format: mp3 (default), wav, pcm (raw 16-bit little-endian mono), ulaw or alaw (8 kHz telephony, e.g. Twilio), opus (Ogg) or flac. opus and flac only for text spoken in one part (up to 450 characters)
sample_rateNoSample rate in Hz for wav and pcm (8000, 16000, 24000 default, 32000, 48000) or ulaw/alaw (8000 default, 16000)
pronunciationsNoHow to say words: JSON {"Nginx":"engine x","GIF":"jif"} or Nginx=engine x, GIF=jif (up to 50, whole words, any case)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / voice / description
      Previous value: -"Voice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier. German: julius, elara, aurelia, lara, fabian, kara, viktoria. French: agathe, hector. Dutch: rhea, beatrix, daphne, cornelia, sander, hestia, lars, roman, leda. Italian: livia, melia, elio, flavio, maia, cinzia, cesare, dionisio, demetra. Japanese: izanami, uzume, ebisu, fujin, ama. Default: luna (en), aquila (es), else the first listed"New value: +"Voice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier, agustina, antonia, gloria, luciano, olivia, silvia, valerio. German: julius, elara, aurelia, lara, fabian, kara, viktoria. French: agathe, hector. Dutch: rhea, beatrix, daphne, cornelia, sander, hestia, lars, roman, leda. Italian: livia, melia, elio, flavio, maia, cinzia, cesare, dionisio, demetra. Japanese: izanami, uzume, ebisu, fujin, ama. Default: luna (en), aquila (es), else the first listed"
  2. Changed3 schema fields changed
    • changedInput schema / properties / lang / description
      Previous value: -"Language: en or es (Aura-2 MP3, many voices); fr, zh, ja and ko are retired (MeloTTS was removed from Workers AI, 20 Nov 2026); default en"New value: +"Language: en, es, de, fr, nl, it or ja (Aura-2 MP3, many voices); zh and ko are retired (MeloTTS was removed from Workers AI, 20 Nov 2026); default en"
    • changedInput schema / properties / lang / enum
      Previous value: -[
      -  "en",
      -  "es"
      -]New value: +[
      +  "en",
      +  "es",
      +  "de",
      +  "fr",
      +  "nl",
      +  "it",
      +  "ja"
      +]
    • changedInput schema / properties / voice / description
      Previous value: -"Voice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier. Default: luna (en), aquila (es)"New value: +"Voice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier. German: julius, elara, aurelia, lara, fabian, kara, viktoria. French: agathe, hector. Dutch: rhea, beatrix, daphne, cornelia, sander, hestia, lars, roman, leda. Italian: livia, melia, elio, flavio, maia, cinzia, cesare, dionisio, demetra. Japanese: izanami, uzume, ebisu, fujin, ama. Default: luna (en), aquila (es), else the first listed"
  3. Changed3 schema fields changed
    • changedInput schema / properties / lang / description
      Previous value: -"Language: en or es (Aura-2 MP3, many voices), fr, zh, ja or ko (MeloTTS WAV, one voice each); default en"New value: +"Language: en or es (Aura-2 MP3, many voices); fr, zh, ja and ko are retired (MeloTTS was removed from Workers AI, 20 Nov 2026); default en"
    • changedInput schema / properties / lang / enum
      Previous value: -[
      -  "en",
      -  "es",
      -  "fr",
      -  "zh",
      -  "ja",
      -  "ko"
      -]New value: +[
      +  "en",
      +  "es"
      +]
    • changedInput schema / properties / text / description
      Previous value: -"Text to speak, up to 2,000 characters (1,200 in fr, zh, ja and ko)"New value: +"Text to speak, up to 2,000 characters"
  4. Changed3 schema fields changed
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "Audio format: mp3 (default), wav, pcm (raw 16-bit little-endian mono), ulaw or alaw (8 kHz telephony, e.g. Twilio), opus (Ogg) or flac. opus and flac only for text spoken in one part (up to 450 characters)",
      +  "enum": [
      +    "mp3",
      +    "wav",
      +    "pcm",
      +    "ulaw",
      +    "alaw",
      +    "opus",
      +    "flac"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / pronunciations
      Added value: +{
      +  "description": "How to say words: JSON {\"Nginx\":\"engine x\",\"GIF\":\"jif\"} or Nginx=engine x, GIF=jif (up to 50, whole words, any case)",
      +  "type": "string"
      +}
    • addedInput schema / properties / sample_rate
      Added value: +{
      +  "description": "Sample rate in Hz for wav and pcm (8000, 16000, 24000 default, 32000, 48000) or ulaw/alaw (8000 default, 16000)",
      +  "type": [
      +    "string",
      +    "number",
      +    "boolean"
      +  ]
      +}
  5. Changed3 schema fields changed
    • changedInput schema / properties / lang / description
      Previous value: -"Language: en or es (default en)"New value: +"Language: en or es (Aura-2 MP3, many voices), fr, zh, ja or ko (MeloTTS WAV, one voice each); default en"
    • changedInput schema / properties / lang / enum
      Previous value: -[
      -  "en",
      -  "es"
      -]New value: +[
      +  "en",
      +  "es",
      +  "fr",
      +  "zh",
      +  "ja",
      +  "ko"
      +]
    • changedInput schema / properties / text / description
      Previous value: -"Text to speak, up to 2,000 characters"New value: +"Text to speak, up to 2,000 characters (1,200 in fr, zh, ja and ko)"
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: cost model ($0.08/call via x402 USDC or card key), failed calls free, and that repeat calls are charged — which explains the idempotentHint=false in practical terms, and the payment path is real auth-relevant information. It also confirms the read-only nature in plain language. The gap is the return payload: no output schema exists and the description never says what comes back (audio bytes/base64, URL, or a container reference), nor anything about latency for long text.

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-loaded with capability and limits before pricing and use cases, and nearly every clause carries decision-relevant information. It is a single dense block and the zh/ko retirement note duplicates the lang enum description, which is minor redundancy rather than waste.

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

Completeness4/5

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

For a six-parameter generation tool with no output schema and rich annotations, the description covers scope, pricing, language availability, and alternative routing, which is most of what an agent needs. The missing piece is the shape of the successful response and behavior on partial failure, which matters for a paid-per-call tool.

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

Parameters3/5

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

Schema description coverage is 100%, so voice enumerations, format/sample-rate constraints, and pronunciation syntax are already fully documented in structured fields. The description adds only the light hint 'pick a voice by name or leave the default' and repeats the 2,000-character/text and language facts. No additional syntax or interaction detail (e.g. how pronunciations apply per language, how sample_rate interacts with opus) is contributed.

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 verb and resource (text to speech) plus hard scope limits: 2,000 characters, one MP3, 7 languages, 89 voices, Deepgram Aura-2. It also names the retired language case and explicitly distinguishes itself from ai_speech for short inputs, so an agent can route without opening any schema.

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 concrete positive use cases (narration, article/summary read-outs, voice replies, IVR prompts, accessibility) and an explicit exclusion rule with the alternative named: sentences under 300 characters should use ai_speech because it costs less. Both the when and the when-not are stated.

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.

Resources