Skip to main content
Glama

generate_speech

Convert text to speech audio using a specific voice replica for video content, conversational AI, and multimedia projects.

Instructions

Generate speech audio from text using a replica

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
replica_idYesReplica to use for speech generation
scriptYesText script to convert to speech
speech_nameNoName for the generated speech
callback_urlNoURL to receive completion callback

Implementation Reference

  • The main handler function that executes the generate_speech tool logic. It makes a POST request to the '/speech' API endpoint with the provided arguments and returns the response as formatted JSON.
    private async generateSpeech(args: any) {
      const response = await this.axiosInstance.post('/speech', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(response.data, null, 2),
        }],
      };
    }
  • The input schema definition for the generate_speech tool, defining the required parameters: replica_id (required), script (required), speech_name (optional), and callback_url (optional).
    // Speech
    {
      name: 'generate_speech',
      description: 'Generate speech audio from text using a replica',
      inputSchema: {
        type: 'object',
        properties: {
          replica_id: {
            type: 'string',
            description: 'Replica to use for speech generation',
          },
          script: {
            type: 'string',
            description: 'Text script to convert to speech',
          },
          speech_name: {
            type: 'string',
            description: 'Name for the generated speech',
          },
          callback_url: {
            type: 'string',
            description: 'URL to receive completion callback',
          },
        },
        required: ['replica_id', 'script'],
      },
    },
  • src/index.ts:750-751 (registration)
    The switch-case routing that maps the 'generate_speech' tool name to its handler method generateSpeech().
    case 'generate_speech':
      return await this.generateSpeech(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates speech audio but doesn't cover critical aspects like whether this is a read-only or mutating operation, authentication requirements, rate limits, or what happens after generation (e.g., storage, retrieval via 'get_speech'). This leaves significant gaps in understanding the tool's behavior.

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 function without any wasted words. It is front-loaded with the core purpose, making it easy to parse quickly. This level of conciseness is ideal for tool descriptions.

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 generation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a speech ID, audio file, or status), how to handle the callback URL, or behavioral traits like side effects. This leaves the agent with insufficient information to use the tool effectively.

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 the schema fully documents all parameters. The description adds no additional meaning beyond the schema, such as explaining parameter interactions or constraints. However, since the schema provides complete coverage, the baseline score of 3 is appropriate, as the description doesn't need to compensate but also doesn't enhance parameter understanding.

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: generating speech audio from text using a replica. It specifies the verb ('generate'), resource ('speech audio'), and method ('using a replica'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'generate_video' or 'create_lipsync', which might involve similar text-to-media processes, so it doesn't reach a perfect score.

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 sibling tools like 'generate_video' for video generation or 'create_lipsync' for lip-syncing, nor does it specify prerequisites such as needing an existing replica. This lack of context leaves the agent without clear usage instructions.

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/rakeshdavid/Tavus-MCP'

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