make_call
Initiate phone calls using Twilio by specifying recipient, sender, and TwiML URL for call behavior.
Instructions
Make a phone call via Twilio with a TwiML URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| twiml_url | Yes |
Implementation Reference
- src/apis/twilio/twilio.ts:84-91 (handler)Handler function that executes the 'make_call' tool: validates inputs (to, from, twiml_url) and calls TwilioClient.makeCall.async make_call(args: Record<string, unknown>) { if (!cfg.twilioAccountSid || !cfg.twilioAuthToken) throw new Error("TWILIO_ACCOUNT_SID/TWILIO_AUTH_TOKEN are not configured"); const to = String(args.to || ""); const from = String(args.from || ""); const twimlUrl = String(args.twiml_url || ""); if (!to || !from || !twimlUrl) throw new Error("to, from, twiml_url are required"); return client.makeCall(to, from, twimlUrl); },
- src/apis/twilio/twilio.ts:60-64 (schema)Input schema definition for the 'make_call' tool specifying required string parameters: to, from, twiml_url.inputSchema: { type: "object", properties: { to: { type: "string" }, from: { type: "string" }, twiml_url: { type: "string" } }, required: ["to", "from", "twiml_url"], },
- src/apis/twilio/twilio.ts:57-65 (registration)Registration of the 'make_call' tool in the tools array returned by registerTwilio().{ name: "make_call", description: "Make a phone call via Twilio with a TwiML URL", inputSchema: { type: "object", properties: { to: { type: "string" }, from: { type: "string" }, twiml_url: { type: "string" } }, required: ["to", "from", "twiml_url"], }, },
- src/apis/twilio/twilio.ts:25-32 (helper)TwilioClient.makeCall helper method that sends POST request to Twilio API to initiate the call.makeCall(to: string, from: string, twimlUrl: string) { const form = new URLSearchParams({ To: to, From: from, Url: twimlUrl }); return this.request(`/Accounts/${this.accountSid}/Calls.json`, { method: "POST", headers: { Authorization: `Basic ${this.authHeader}`, "content-type": "application/x-www-form-urlencoded" }, body: form as any, }); }