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);

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