Skip to main content
Glama

tts

Convert text to speech to generate MP3 audio files for accessibility, content creation, or multimedia projects using customizable voice options.

Instructions

Convert text to speech (MP3) ($0.002)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
voiceNoalloy

Implementation Reference

  • index.js:25-25 (registration)
    The "tts" tool is defined in the TOOLS array with its schema, endpoint, and pricing.
    { name: 'tts', description: 'Convert text to speech (MP3)', inputSchema: { type: 'object', properties: { text: { type: 'string' }, voice: { type: 'string', default: 'alloy' } }, required: ['text'] }, endpoint: '/tts', price: '$0.002' },
  • index.js:94-115 (handler)
    The request handler for tools dynamically finds the tool definition and delegates execution to the callTool function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      
      if (!API_KEY) {
        return {
          content: [{ type: 'text', text: 'Error: ITERATOOLS_API_KEY environment variable not set. Get a key at https://iteratools.com' }],
          isError: true,
        };
      }
      
      const tool = TOOLS.find(t => t.name === name);
      if (!tool) {
        return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
      }
      
      try {
        const result = await callTool(tool.endpoint, args);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
      }
    });
  • The callTool helper function performs the network request to the IteraTools API based on the tool's configured endpoint.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
Behavior3/5

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

With no annotations provided, the description discloses key behavioral traits: output format (MP3) and cost per use ($0.002). However, it fails to document available voice options (only 'alloy' is shown as default in schema), rate limits, or whether the operation is idempotent.

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, information-dense sentence with zero wasted words. It front-loads the action ('Convert'), specifies the format ('MP3'), and appends cost—every element earns its place.

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

Completeness3/5

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

For a two-parameter generative tool without output schema, the description covers the essential purpose and cost but leaves significant gaps: valid voice options are unexplained, and handling of the MP3 output (returned as bytes, URL, or file ID) is not described.

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

Parameters2/5

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

Schema description coverage is 0%, requiring the description to compensate. While 'Convert text' implicitly clarifies the 'text' parameter, the description completely omits the 'voice' parameter and its valid values (e.g., 'alloy', other options), leaving critical parameter semantics undocumented.

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 core function with specific verb ('Convert'), resource ('text to speech'), and output format ('MP3'), plus cost information. However, it does not explicitly distinguish from sibling tool 'audio_transcribe' (speech-to-text), which would be necessary for a top score.

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?

The description includes cost information ('$0.002') which guides usage economics, but lacks explicit guidance on when to use this tool versus alternatives like 'audio_transcribe', and omits prerequisites such as text length limits or voice availability.

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/fredpsantos33/itera-tools-mcp'

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