retell_create_batch_call
Schedule multiple outbound phone calls simultaneously by specifying caller number, recipient numbers, and optional metadata for bulk communication tasks.
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 implementation in the executeTool function's switch statement. It forwards the tool arguments to the Retell API endpoint /create-batch-call using a POST request.case "retell_create_batch_call": return retellRequest("/create-batch-call", "POST", args);
- src/index.ts:1031-1061 (schema)Input schema defining the parameters for the retell_create_batch_call tool, including from_number, tasks array, optional name and trigger_timestamp.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:1028-1062 (registration)Tool definition and registration in the static tools array, which is returned by the ListToolsRequestHandler.{ 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:23-57 (helper)Shared helper function that performs authenticated HTTP requests to the Retell API, used by all tool handlers including retell_create_batch_call.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(); }