Skip to main content
Glama

Text to speech

text_to_speech
Destructive

Converts text into natural speech and saves it as audio files in Hindi, other Indian languages, or English. Select a voice, language, and format to generate speech from up to 50,000 characters.

Instructions

Convert text to natural speech with Bakbak and save it as an audio file on this computer. Uses Bakbak credits for every character, so call it once per text and do not retry a success. Pick a voice for the language with list_voices first and pass its id as voice_id and its model as model (a voice works only with its own model). Hindi text must be in Devanagari script. Text up to 50,000 characters; long text is split at sentence boundaries and joined into one file.

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

Input Schema

NameRequiredDescriptionDefault
textYesThe text to speak, up to 50,000 characters. Hindi must be in Devanagari script; Indian names in English text are best written in Devanagari.
modelNostandard or m1. Must be the voice's model; if omitted, the chosen voice's own model is used.
speedNoSpeaking rate from 0.5 to 1.5 (default 1.0). Standard voices only; m1 voices ignore it.
languageYesLanguage of the text: hi, mr, te, kn, bn, as, gu, ne, ml, ta, pa, en, en-in or en-us. English m1 voices use en; standard English voices use en-in or en-us.
voice_idNoA voice id from list_voices. If omitted, the first voice for the language (and model, if given) is used.
overwriteNoReplace output_path if it already exists. Without it, an existing file is never touched.
output_pathNoWhere to save the file: an absolute path, or a path relative to the output directory. Its directory must exist and its extension must match the format. Default: a new file in the output directory.
include_audioNoAlso return the audio inline as an audio content block. Only for audio up to 1 MB (about 20 s of the default WAV).
output_formatNoThe API output_format object. Default {"container":"wav","encoding":"pcm_s16le","sample_rate":24000}.

Output Schema

NameRequiredDescriptionDefault
modelYes
formatYes
languageYes
voice_idYes
file_pathYesAbsolute path of the saved audio file.
charactersYesCharacters of text synthesized (code points).
request_idsYesBakbak request ids, for support.
duration_secondsYesLength of the audio in seconds.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.3

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the billing model ('Uses Bakbak credits for every character'), which makes retries costly, and by explaining the file-safety rule (an existing file is never touched without overwrite) and the long-text splitting behavior that yields a single joined file. These are operational consequences an agent cannot derive from destructiveHint/idempotentHint alone.

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 the purpose and artifact, then cost/retry policy, then voice-selection mechanics, then limits. Four dense sentences with little waste, though the length and script constraints in the final sentence partly duplicate the schema.

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 nine-parameter tool with a nested output_format object and an output schema, the description covers the non-obvious parts: cost per character, retry hazard, voice/model pairing, splitting of long input, and file overwrite safety. Nothing an agent needs in order to call it correctly is missing from description-plus-schema together.

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 coverage is 100%, so every parameter is already documented. The description restates the 50,000-character cap, the Devanagari requirement, and the voice/model coupling that the schema also states, adding emphasis but little new meaning. Baseline 3 is appropriate when the schema carries the semantics.

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 (convert text to speech), the service used (Bakbak), and the concrete artifact produced (an audio file saved on this computer). It is immediately distinguishable from the sibling list_voices, which it explicitly names as a prerequisite rather than a substitute.

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 explicit ordering ('Pick a voice for the language with list_voices first'), an explicit retry policy ('call it once per text and do not retry a success'), and a data-format precondition for Hindi (Devanagari). An agent knows exactly what to do before and after calling.

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

Deploy Server

Other Tools