Skip to content
agentskit.js
ToolsIntegrations

twilio

Twilio SMS — send via the REST Messages endpoint with E.164 validation.

import { twilio } from '@agentskit/tools/integrations'

const tools = twilio({
  accountSid: process.env.TWILIO_ACCOUNT_SID!,
  authToken: process.env.TWILIO_AUTH_TOKEN!,
  fromNumber: '+14155551234',
})

#Tools

ToolPurpose
twilio_send_smsPOST a message to a recipient.

#Schema

{
  to: string;        // E.164 (e.g. +14155559999)
  body: string;      // <= 1600 chars; Twilio segments at 160
  from?: string;     // override fromNumber (E.164)
}

Returns { sid, status } — Twilio message SID and the queued/sending/delivered/etc. status.

#E.164 validation

The adapter rejects any number that isn't E.164 at construction time and at execute time. This prevents silent malformed sends.

#Why send-only

Receive-side requires a webhook handler in your app (Twilio doesn't push, you pull from Twilio's POSTs). Wire that up alongside the agent's outbound surface.

Explore nearby

Ask the docs
Ask anything about AgentsKit. Answers come from the docs corpus and cite their sources.