Skip to main content
Glama

retell_get_voice

Retrieve voice configuration details from Retell AI's platform to manage AI phone agents and conversation flows.

Instructions

Retrieve details of a specific voice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
voice_idYesThe voice ID to retrieve

Implementation Reference

  • Switch case in executeTool function that handles the retell_get_voice tool by making a GET request to the Retell API endpoint `/get-voice/{voice_id}`.
    case "retell_get_voice":
      return retellRequest(`/get-voice/${args.voice_id}`, "GET");
  • Tool definition in the tools array, including name, description, and input schema requiring 'voice_id'.
    {
      name: "retell_get_voice",
      description: "Retrieve details of a specific voice.",
      inputSchema: {
        type: "object",
        properties: {
          voice_id: {
            type: "string",
            description: "The voice ID to retrieve"
          }
        },
        required: ["voice_id"]
      }
    },
  • Generic helper function that performs authenticated HTTP requests to the Retell AI API, used by all tool handlers including retell_get_voice.
    async function retellRequest(
      endpoint: string,
      method: string = "GET",
      body?: Record<string, unknown>
    ): Promise<unknown> {
      const apiKey = getApiKey();
    
      const headers: Record<string, string> = {
        "Authorization": `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      };
    
      const options: RequestInit = {
        method,
        headers,
      };
    
      if (body && method !== "GET") {
        options.body = JSON.stringify(body);
      }
    
      const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options);
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`Retell API error (${response.status}): ${errorText}`);
      }
    
      // Handle 204 No Content
      if (response.status === 204) {
        return { success: true };
      }
    
      return response.json();
    }
  • src/index.ts:1283-1285 (registration)
    Registration of the ListToolsRequestSchema handler that returns the full list of tools, including retell_get_voice.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1287-1313 (registration)
    Registration of the CallToolRequestSchema handler which dispatches to executeTool based on tool name, enabling execution of retell_get_voice.
    // Register tool execution handler
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        const result = await executeTool(name, args as Record<string, unknown>);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    });

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/itsanamune/retellsimp'

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