Skip to main content
Glama

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 English (40 voices) or Spanish (10 voices) with Deepgram Aura-2; fr, zh, ja 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 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
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. Default: luna (en), aquila (es)
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. 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"
  2. 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"
      +  ]
      +}
  3. 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)"
  4. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, non-idempotent, non-destructive, so safety is covered; the description adds real economic and lifecycle context: $0.08/call via x402 USDC or card key, failed calls free, and repeats are not free (explaining the non-idempotent hint). It also warns that fr, zh, ja and ko are retired with MeloTTS. It does not say how the audio is returned, which keeps this short of a 5.

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, then usage, then pricing, then a safety/cost caveat — a sensible order. It is dense and packs pricing, retirement dates and alternatives into long clauses, and the closing 'reads or computes only and changes nothing' largely restates readOnlyHint.

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 6-parameter generation tool with no output schema, it covers limits, languages, voices, formats, cost and alternatives well. The remaining gap is the response contract — whether audio comes back as bytes, a URL, or a base64 payload — which an agent must know to use the result.

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% and the schema already lists voice names, defaults, format enums, sample rates and pronunciation syntax, so the baseline of 3 applies. The description adds only the framing that a voice can be picked by name or left at default, plus the character ceiling; the 'one MP3' phrasing slightly under-represents the wav/pcm/ulaw/opus/flac options the schema exposes.

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 with scope: text to speech, up to 2,000 characters, one MP3, English (40 voices) or Spanish (10 voices), engine named. It also names a cheaper sibling (ai_speech) for short input, so an agent can separate the two without opening either 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 use cases (narration, article and summary read-outs, voice replies, IVR prompts, accessibility) and an explicit routing rule: for a sentence of up to 300 characters ai_speech costs less. When-to-use and the alternative are both 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