Skip to main content
Glama

generate_audio

Generate speech from text (text-to-speech): pick a voice and language, get an audio file back. Returns request_id and cost in credits immediately — narration is quick, poll with wait_generation until COMPLETED, then output.audio.url is the file and output.audio.format its format (mp3 or wav, depending on the model). Pass the resulting request_id as voiceover_request_id in compose_video to narrate a multi-scene video, or use the file on its own.

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

Input Schema

NameRequiredDescriptionDefault
textYesThe text to speak in a language supported by the selected model. The allowed length depends on the model: 10–10000 characters per call on the default model, considerably more on some others — get_model returns text_limits.min_chars / text_limits.max_chars. Text outside the model limits is rejected with 400 before anything is charged: pick a model with a higher limit, or split the narration into separate calls and download the parts; standalone audio stitching is not a public MCP tool.
inputNoModel-specific parameters from get_model input_schema.parameters, keyed by parameter name and merged with the fields above — e.g. the default model's directing fields style / pace / accent / audio_profile / scene / sample_context / temperature. Some parameters can change the cost of the call — get_model shows the reference pricing. A misspelled name, or a parameter this model is known not to apply, is rejected before the generation starts; the error lists the parameters the model declares.
modelNoModel slug from list_models (type audio). Omit to use the default text-to-speech model.
voiceNoExact voice ID from input_schema.parameters voice.options (see get_model); labels are not IDs — different male/female narrators. Omit for the model default.
languageNoLanguage of the text, e.g. 'ru' or 'en'. Omit for the model default.
stabilityNoElevenLabs v4: delivery stability, from 0 to 1. Lower is more expressive, higher is more even. Other speech models reject the call.
similarityNoElevenLabs v4 voice similarity, from 0 to 1. Other speech models reject the call.
wait_secondsNoHow long to wait inline for completion before returning a request_id.
previous_textNoElevenLabs v4: preceding script context for continuity across separate calls. Other speech models reject the call.
idempotency_keyNoOptional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse.
secondary_voiceNoElevenLabs v4: second voice ID for lines prefixed B:. Lines prefixed A: use voice. Other speech models reject the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / text / description
      Previous value: -"The text to speak in a language supported by the selected model. The allowed length depends on the model: 10–500 characters per call on the default model, considerably more on some others — get_model returns text_limits.min_chars / text_limits.max_chars. Text outside the model limits is rejected with 400 before anything is charged: pick a model with a higher limit, or split the narration into separate calls and download the parts; standalone audio stitching is not a public MCP tool."New value: +"The text to speak in a language supported by the selected model. The allowed length depends on the model: 10–10000 characters per call on the default model, considerably more on some others — get_model returns text_limits.min_chars / text_limits.max_chars. Text outside the model limits is rejected with 400 before anything is charged: pick a model with a higher limit, or split the narration into separate calls and download the parts; standalone audio stitching is not a public MCP tool."
  2. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Optional stable key to safely retry without creating a duplicate generation. Reuse the same key when retrying the same request."New value: +"Optional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse."
    • addedInput schema / properties / idempotency_key / maxLength
      Added value: +255
  3. First observed

TDQS

A4.4/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 async contract (request_id and credit cost returned immediately, poll with wait_generation), the exact result paths (output.audio.url, output.audio.format), and that over-limit text is rejected with 400 before charging. It also explains the idempotency_key reuse rule, which clarifies why idempotentHint=false does not make retries unsafe.

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 core action and the immediate return, then the polling and composition guidance. It is dense but nearly every clause carries operational information; the return-value detail in the opening paragraph slightly crowds the purpose statement.

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?

No output schema exists, and the description compensates by naming the response fields and the completion flow, plus the cross-tool integration path. For an 11-parameter async generation tool, nothing an agent needs to invoke it correctly appears missing.

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 every parameter including nested model-specific input is already documented in the schema. The description only adds the high-level 'pick a voice and language' framing, not new meaning beyond what the schema states. Baseline 3 is appropriate.

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 — 'Generate speech from text (text-to-speech)' — plus the immediate outcome ('get an audio file back'). It is clearly distinct from siblings like generate_music, generate_video, and compose_video, which are named or implicitly contrasted by the narration framing.

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?

Gives concrete routing guidance: poll with wait_generation until COMPLETED, pass request_id as voiceover_request_id in compose_video for multi-scene narration, or use the file standalone. There is no explicit 'when not to use this' or contrast with generate_music for non-speech audio, so it falls short of a full 5.

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.