Skip to main content
Glama

retell_get_call

Retrieve call details including transcript, recording URL, duration, and analysis from Retell AI's voice agent platform.

Instructions

Retrieve details of a specific call including transcript, recording URL, duration, and analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
call_idYesThe unique identifier of the call to retrieve

Implementation Reference

  • Handler logic for the retell_get_call tool. Makes a GET request to the Retell API endpoint `/v2/get-call/{call_id}` using the provided call_id argument.
    case "retell_get_call":
      return retellRequest(`/v2/get-call/${args.call_id}`, "GET");
  • Input schema definition for the retell_get_call tool, specifying that a 'call_id' string parameter is required.
    {
      name: "retell_get_call",
      description: "Retrieve details of a specific call including transcript, recording URL, duration, and analysis.",
      inputSchema: {
        type: "object",
        properties: {
          call_id: {
            type: "string",
            description: "The unique identifier of the call to retrieve"
          }
        },
        required: ["call_id"]
      }
    },
  • src/index.ts:1283-1285 (registration)
    Registration of the tool list handler, which returns the array of tools including the schema for retell_get_call.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1287-1313 (registration)
    Registration of the tool execution handler, which dispatches to executeTool based on the tool name 'retell_get_call'.
    // 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,
        };
      }
    });
  • Helper function used by the retell_get_call handler to make authenticated HTTP requests to the Retell AI API.
    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();
    }

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