Skip to main content
Glama

gemini_generate_audio

Converts written text into spoken audio using Gemini TTS and saves it to a file, with optional voice selection and duration reporting.

Instructions

Read text aloud with Gemini TTS (google-genai SDK, API credit) and save it to output_path.

.wav is written directly; other extensions (.mp3, .m4a ...) are converted with ffmpeg when available, otherwise a .wav next to it is returned. Put only the words to be spoken in text: gemini-3.8-flash-tts reads directions such as "Say cheerfully:" aloud. Choose the tone with voice_name instead. Returns the saved path and the length in seconds; to check what was said, pass the file to gemini_analyze_media.

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>",
      "output_path": "<output_path>"
    },
    "name": "gemini_generate_audio"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
session_idNo
voice_nameNoKore
output_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses API credit consumption, that .wav is written natively while other extensions are converted via ffmpeg when available, and that a fallback .wav path may be returned instead. It omits overwrite behavior when output_path already exists and any permission/auth constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then the file-format caveat, then the parameter guidance, then the return value. Dense but every sentence carries actionable information with no restatement of the schema.

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?

No output schema exists, and the description supplies the return contract (saved path and duration in seconds) plus format-conversion edge cases. Missing only session_id semantics and behavior on existing files, which are modest gaps for a two-required-parameter generation tool.

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 0%, so the description must compensate, and it does for three of four parameters: text is constrained to spoken words only, voice_name controls tone, and output_path drives the extension/conversion behavior. The session_id parameter is never mentioned, leaving one gap.

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 ('Read text aloud with Gemini TTS') plus the terminal effect ('save it to output_path'). It is clearly distinguishable from siblings like gemini_generate_image and gemini_analyze_media, and even names the latter as the downstream verification step.

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 usage rules: put only spoken words in text, since the model reads stage directions aloud, and use voice_name to set tone instead. It also routes the agent to gemini_analyze_media to check output. It does not, however, say when to prefer this over other media tools such as media_audio.

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