Skip to main content
Glama

Generate speech

generate_speech
Destructive

Convert text into spoken audio with OpenAI text-to-speech models, saving the file and returning its path by default or returning inline base64 audio when needed.

Instructions

Convert text to spoken audio using an OpenAI text-to-speech model. By default returns the local file path the audio was saved to rather than inline data; set returnAs to 'base64' for inline audio instead

Input Schema

NameRequiredDescriptionDefault
inputYesThe text to convert to speech (max 4096 characters)
modelYesOpenAI model to use for speech generation
speedNoPlayback speed from 0.25 to 4.0 (default 1.0)
voiceNoVoice to use, e.g. alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, verse, marin, or cedaralloy
formatNoAudio file format to generatemp3
returnAsNoHow to return the generated audio. 'path' (default) saves it to disk and returns its file path, avoiding the large inline payloads that can exceed an MCP client's tool result size limit. 'base64' returns the audio data inline insteadpath
outputPathNoFile path to save the audio to when returnAs is 'path'. Ignored when returnAs is 'base64'. Defaults to a temp file if omitted
instructionsNoOptional guidance on tone, style, or delivery. Ignored by tts-1 and tts-1-hd

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations only flag readOnlyHint=false and destructiveHint=true; the description adds the important behavior that a file is written to disk and that inline base64 payloads can exceed MCP client result-size limits. It does not cover API key/auth requirements or file cleanup, but the side-effect of disk writing is disclosed, consistent with destructiveHint=true rather than contradicting it.

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?

Two sentences, no padding, and the default-return-behavior fact is placed first because it is what an agent most needs to know before parsing a result. Every clause carries information.

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?

With no output schema, the description usefully explains what comes back (a file path by default, inline audio otherwise), which is the critical missing piece. It could say more about cost/latency or that the saved file persists, but for an 8-param tool with full schema coverage this is largely complete.

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 all eight parameters are already documented in detail, including voice enumeration, speed range, format enum, and the outputPath/returnAs interaction. The description only restates the returnAs semantics, adding no syntax or constraints beyond the schema, so baseline 3 applies.

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?

The description states a specific verb and resource ('Convert text to spoken audio') plus the backing engine (OpenAI TTS model). This is unmistakable against siblings like generate_text, transcribe_audio, or generate_image, none of which produce synthesized speech.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit rule for the returnAs decision (default path, use base64 for inline), which is genuinely useful. But it offers no guidance on model selection, voice choice, or when to prefer this over sibling tools such as transcribe_audio in a round-trip workflow. Usage is implied rather than fully framed.

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