Skip to main content
Glama

retell_create_batch_call

Schedule bulk outbound phone calls with AI agents by specifying caller number, recipient list, and optional start time.

Instructions

Schedule bulk outbound phone calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_numberYesThe caller's phone number
tasksYesArray of call tasks with to_number and optional metadata
nameNoName for the batch job
trigger_timestampNoUnix timestamp to start the batch (optional, starts immediately if not set)

Implementation Reference

  • Handler logic for retell_create_batch_call tool: proxies arguments to POST /create-batch-call endpoint via retellRequest helper
    case "retell_create_batch_call": return retellRequest("/create-batch-call", "POST", args);
  • Input schema definition for the retell_create_batch_call tool, including parameters for from_number, tasks array, name, and trigger_timestamp
    { name: "retell_create_batch_call", description: "Schedule bulk outbound phone calls.", inputSchema: { type: "object", properties: { from_number: { type: "string", description: "The caller's phone number" }, tasks: { type: "array", description: "Array of call tasks with to_number and optional metadata", items: { type: "object", properties: { to_number: { type: "string" }, metadata: { type: "object" }, retell_llm_dynamic_variables: { type: "object" } }, required: ["to_number"] } }, name: { type: "string", description: "Name for the batch job" }, trigger_timestamp: { type: "integer", description: "Unix timestamp to start the batch (optional, starts immediately if not set)" } }, required: ["from_number", "tasks"] } },
  • src/index.ts:1283-1285 (registration)
    Registration of the listTools handler that returns the tools array containing retell_create_batch_call
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • Generic API request helper function used by all Retell tools, including authentication and error handling
    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(); }
  • Helper function to retrieve Retell API key from environment variable, used by retellRequest
    function getApiKey(): string { const apiKey = process.env.RETELL_API_KEY; if (!apiKey) { throw new Error("RETELL_API_KEY environment variable is required"); } return apiKey; }

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