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
| Name | Required | Description | Default |
|---|---|---|---|
| from_number | Yes | The caller's phone number | |
| tasks | Yes | Array of call tasks with to_number and optional metadata | |
| name | No | Name for the batch job | |
| trigger_timestamp | No | Unix timestamp to start the batch (optional, starts immediately if not set) |
Implementation Reference
- src/index.ts:1253-1254 (handler)Handler logic for retell_create_batch_call tool: proxies arguments to POST /create-batch-call endpoint via retellRequest helpercase "retell_create_batch_call": return retellRequest("/create-batch-call", "POST", args);
- src/index.ts:1028-1062 (schema)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_callserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:23-57 (helper)Generic API request helper function used by all Retell tools, including authentication and error handlingasync 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(); }
- src/index.ts:14-20 (helper)Helper function to retrieve Retell API key from environment variable, used by retellRequestfunction getApiKey(): string { const apiKey = process.env.RETELL_API_KEY; if (!apiKey) { throw new Error("RETELL_API_KEY environment variable is required"); } return apiKey; }