Skip to main content
Glama

Media Generator — Images, Videos & Audios

text_to_speech

Input: Text to convert to speech, language ID, and voice type.

Output: Returns the URL of the generated audio file.

Functionality: This tool converts text to speech in the specified language and voice. It follows these steps:

  1. Gets user_id from context and validates tokens.

  2. Generates speech from the text using the specified language and voice.

Args: text: The text to convert to speech language_id: The language ID (defaults to "en" for English) voice_id: The voice type (defaults to "female")

Returns: The URL of the generated audio file

INSTRUCTION FOR CLIENT MODEL:

  • Extract the required input parameter 'text' (type: string) and optional parameters 'language_id' (type: string, default 'en') and 'voice_id' (type: string, default 'female') from the user's prompt.

  • If 'language_id' or 'voice_id' are not specified, use the default values.

  • Ignore any extraneous information in the user's input.

  • Pass the extracted values to this tool as 'text', 'language_id', and 'voice_id'.

  • RECOMMENDATION: Call get_languages() first to see available language IDs before choosing a language_id.

  • Example: For user input "Convert 'Hello world' to French with a male voice", extract 'text' as 'Hello world', 'language_id' as 'fr', and 'voice_id' as 'male'.

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
textYes
voice_idNofemale
language_idNoen

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / description
      Removed value: -"Generic wrapper for non-object return types."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description discloses meaningful behavior: it validates tokens, derives user_id from context, applies language and voice defaults, and returns a generated audio URL. It does not mention constraints such as text length limits, audio format, storage lifetime, or failure modes.

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

Conciseness3/5

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

The definition is front-loaded and structured, but it repeats the same information across Input/Output, Args/Returns, and client instructions. Some redundancy reduces conciseness, though the extra guidance is largely useful.

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 three-parameter text-to-speech tool with no annotations and an output schema, the description covers inputs, defaults, output, and a language-discovery recommendation well. It is still missing behavioral constraints such as maximum text length and supported voice/language values beyond the get_languages pointer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: it names all three parameters, explains defaults for language_id and voice_id, gives example values such as 'fr' and 'male', and points to get_languages() for valid language IDs.

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 uses a specific verb and resource: it converts text to speech in a specified language and voice and returns the audio URL. This clearly distinguishes it from siblings such as video_to_audio, music_generator, and song_generator.

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?

It gives clear usage context with defaults, an example mapping a user request to parameters, and a recommendation to call get_languages() first. It does not explicitly state when not to use this tool versus alternatives, so it falls short of full when/when-not guidance.

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.