Skip to main content
Glama

retell_create_phone_call

Initiate outbound AI phone calls using registered numbers and configured agents for automated voice interactions.

Instructions

Create a new outbound phone call using Retell AI. Initiates a call from a registered phone number to a target number using a configured AI agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_numberYesThe caller's phone number in E.164 format (e.g., +14157774444). Must be a number registered with Retell.
to_numberYesThe recipient's phone number in E.164 format (e.g., +12137774445)
override_agent_idNoOptional: Specific agent ID to use for this call instead of the number's default agent
metadataNoOptional: Custom metadata to attach to the call for tracking purposes
retell_llm_dynamic_variablesNoOptional: Dynamic variables to pass to the LLM for personalized responses

Implementation Reference

  • The execution handler for the retell_create_phone_call tool. It calls the retellRequest helper to POST the input arguments to the Retell API endpoint /v2/create-phone-call.
    case "retell_create_phone_call":
      return retellRequest("/v2/create-phone-call", "POST", args);
  • Input schema defining the parameters for creating a phone call: required from_number and to_number, optional override_agent_id, metadata, and retell_llm_dynamic_variables.
    inputSchema: {
      type: "object",
      properties: {
        from_number: {
          type: "string",
          description: "The caller's phone number in E.164 format (e.g., +14157774444). Must be a number registered with Retell."
        },
        to_number: {
          type: "string",
          description: "The recipient's phone number in E.164 format (e.g., +12137774445)"
        },
        override_agent_id: {
          type: "string",
          description: "Optional: Specific agent ID to use for this call instead of the number's default agent"
        },
        metadata: {
          type: "object",
          description: "Optional: Custom metadata to attach to the call for tracking purposes"
        },
        retell_llm_dynamic_variables: {
          type: "object",
          description: "Optional: Dynamic variables to pass to the LLM for personalized responses"
        }
      },
      required: ["from_number", "to_number"]
  • src/index.ts:62-91 (registration)
    Registration of the retell_create_phone_call tool in the tools array used by the MCP server's listTools handler.
    {
      name: "retell_create_phone_call",
      description: "Create a new outbound phone call using Retell AI. Initiates a call from a registered phone number to a target number using a configured AI agent.",
      inputSchema: {
        type: "object",
        properties: {
          from_number: {
            type: "string",
            description: "The caller's phone number in E.164 format (e.g., +14157774444). Must be a number registered with Retell."
          },
          to_number: {
            type: "string",
            description: "The recipient's phone number in E.164 format (e.g., +12137774445)"
          },
          override_agent_id: {
            type: "string",
            description: "Optional: Specific agent ID to use for this call instead of the number's default agent"
          },
          metadata: {
            type: "object",
            description: "Optional: Custom metadata to attach to the call for tracking purposes"
          },
          retell_llm_dynamic_variables: {
            type: "object",
            description: "Optional: Dynamic variables to pass to the LLM for personalized responses"
          }
        },
        required: ["from_number", "to_number"]
      }
    },
  • Helper function retellRequest that performs authenticated HTTP requests to the Retell API, 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