Skip to main content
Glama

retell_register_phone_call

Register inbound calls from custom telephony providers to connect callers with AI agents for handling conversations.

Instructions

Register an inbound call from a custom telephony provider.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe agent ID to handle the call
from_numberYesThe caller's phone number
to_numberYesThe called number
metadataNoOptional metadata for the call

Implementation Reference

  • Handler implementation for the retell_register_phone_call tool. It invokes the generic retellRequest helper to POST to the Retell API endpoint /register-phone-call with the provided arguments.
    case "retell_register_phone_call":
      return retellRequest("/register-phone-call", "POST", args);
  • Input schema definition for the retell_register_phone_call tool, specifying required parameters: agent_id, from_number, to_number, and optional metadata.
    inputSchema: {
      type: "object",
      properties: {
        agent_id: {
          type: "string",
          description: "The agent ID to handle the call"
        },
        from_number: {
          type: "string",
          description: "The caller's phone number"
        },
        to_number: {
          type: "string",
          description: "The called number"
        },
        metadata: {
          type: "object",
          description: "Optional metadata for the call"
        }
      },
      required: ["agent_id", "from_number", "to_number"]
    }
  • src/index.ts:1091-1116 (registration)
    Tool definition and registration in the static tools array used for ListTools response.
    {
      name: "retell_register_phone_call",
      description: "Register an inbound call from a custom telephony provider.",
      inputSchema: {
        type: "object",
        properties: {
          agent_id: {
            type: "string",
            description: "The agent ID to handle the call"
          },
          from_number: {
            type: "string",
            description: "The caller's phone number"
          },
          to_number: {
            type: "string",
            description: "The called number"
          },
          metadata: {
            type: "object",
            description: "Optional metadata for the call"
          }
        },
        required: ["agent_id", "from_number", "to_number"]
      }
    }
  • Generic helper function for making authenticated API requests to Retell AI, used by the tool handler.
    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