Skip to main content
Glama

retell_register_phone_call

Register inbound calls from custom telephony providers to route them to AI agents for handling.

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

  • The handler logic within the executeTool switch statement that invokes the Retell API to register an inbound phone call from a custom telephony provider.
    case "retell_register_phone_call": return retellRequest("/register-phone-call", "POST", args);
  • src/index.ts:1091-1116 (registration)
    Tool registration in the tools array, including name, description, and input schema for MCP tool listing.
    { 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"] } }
  • Input schema defining parameters for registering a phone call: agent_id, from_number, to_number (required), 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"] }
  • Generic helper function that performs authenticated API requests to Retell AI backend, handling headers, body, errors, and JSON responses. 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