Skip to main content
Glama

venice_text_to_speech

Convert text to speech audio using Venice AI's TTS models and customizable voices for accessible audio content creation.

Instructions

Convert text to speech audio using Venice AI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to convert to speech
modelNoTTS modeltts-kokoro
voiceNoVoice ID (e.g., af_sky, af_bella, am_adam)af_sky

Implementation Reference

  • The main handler function that executes the text-to-speech logic by calling the Venice AI API, processing the audio response into base64, and formatting the output.
    async ({ text, model, voice }) => {
      const response = await veniceAPI("/audio/speech", { method: "POST", body: JSON.stringify({ model, input: text, voice }) });
      if (!response.ok) {
        const data = await response.json() as { error?: { message?: string } };
        return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] };
      }
      const arrayBuffer = await response.arrayBuffer();
      const base64 = Buffer.from(arrayBuffer).toString("base64");
      return { content: [{ type: "text" as const, text: `Audio generated (${Math.round(base64.length / 1024)}KB MP3): data:audio/mp3;base64,${base64.substring(0, 50)}...` }] };
    }
  • Zod schema defining the input parameters for the tool: text, optional model, and optional voice.
    {
      text: z.string().describe("Text to convert to speech"),
      model: z.string().optional().default("tts-kokoro").describe("TTS model"),
      voice: z.string().optional().default("af_sky").describe("Voice ID (e.g., af_sky, af_bella, am_adam)"),
    },
  • The server.tool() call that registers the venice_text_to_speech tool with its schema and handler.
    server.tool(
      "venice_text_to_speech",
      "Convert text to speech audio using Venice AI",
      {
        text: z.string().describe("Text to convert to speech"),
        model: z.string().optional().default("tts-kokoro").describe("TTS model"),
        voice: z.string().optional().default("af_sky").describe("Voice ID (e.g., af_sky, af_bella, am_adam)"),
      },
      async ({ text, model, voice }) => {
        const response = await veniceAPI("/audio/speech", { method: "POST", body: JSON.stringify({ model, input: text, voice }) });
        if (!response.ok) {
          const data = await response.json() as { error?: { message?: string } };
          return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] };
        }
        const arrayBuffer = await response.arrayBuffer();
        const base64 = Buffer.from(arrayBuffer).toString("base64");
        return { content: [{ type: "text" as const, text: `Audio generated (${Math.round(base64.length / 1024)}KB MP3): data:audio/mp3;base64,${base64.substring(0, 50)}...` }] };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the basic function but lacks details on rate limits, authentication requirements, output format (e.g., audio file type, size), latency, or error handling. For a tool that likely involves external API calls and media generation, this is a significant gap in transparency.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance. Every part of the sentence earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a text-to-speech tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like audio output format, usage limits, or error conditions. While the schema covers parameters well, the overall context for safe and effective use is lacking.

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?

The input schema has 100% description coverage, clearly documenting all three parameters (text, model, voice) with defaults and examples. The description adds no additional parameter semantics beyond what the schema provides, such as explaining model differences or voice characteristics. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Convert text to speech audio using Venice AI'. It specifies the verb ('convert'), resource ('text to speech audio'), and service provider ('Venice AI'). However, it doesn't explicitly differentiate from sibling tools like venice_chat or venice_create_embeddings, which might also involve text processing.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, constraints, or comparison with sibling tools such as venice_chat (which might involve speech-related functions) or venice_generate_image (another media generation tool). Usage context is implied but not explicitly stated.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/georgeglarson/venice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server