Skip to main content

At a glance

Credentials

Set these per environment. See Connect an integration.
VariableRequiredDescription
TWILIO_ACCOUNT_SIDYesTwilio Account SID (starts with AC) Docs.
TWILIO_AUTH_TOKENYesTwilio Auth Token Docs.
TWILIO_PHONE_NUMBERYesYour Twilio phone number (E.164 format: +1234567890) Docs.

Setup

  1. Create a Twilio Account: Sign up for a free Twilio account at https://www.twilio.com/try-twilio
  2. Get Your Account SID and Auth Token: Navigate to the Twilio Console Dashboard. Your Account SID and Auth Token are displayed on the main dashboard page. Click the eye icon to reveal your Auth Token.
  3. Get a Phone Number: Go to Phone Numbers > Manage > Buy a number. Select a phone number with SMS and Voice capabilities. Trial accounts come with one free phone number.
  4. Set Up WhatsApp (Optional): To send WhatsApp messages, join the Twilio Sandbox for WhatsApp. Go to Messaging > Try it out > Send a WhatsApp message. Follow the instructions to connect your WhatsApp to the sandbox.
  5. Add Environment Variables: Add your Twilio credentials to your .env file: - TWILIO_ACCOUNT_SID=ACxxxxx - TWILIO_AUTH_TOKEN=your_auth_token - TWILIO_PHONE_NUMBER=+1234567890
  6. Test the Integration: Try sending a test SMS using the send-sms tool. For trial accounts, you can only send messages to verified phone numbers. Add your phone number at Phone Numbers > Manage > Verified Caller IDs.
  • Twilio authenticates with HTTP Basic auth: Account SID as the username and Auth Token as the password
  • Trial accounts have limitations: you can only send messages to verified phone numbers
  • All trial messages will be prefixed with ‘Sent from your Twilio trial account’
  • WhatsApp messages require recipients to first opt-in by messaging your sandbox number
  • Phone numbers must be in E.164 format: +[country code][number] (e.g., +14155552671)
  • Upgrade your account to remove trial restrictions and enable production features

Tools

ToolAccessDescription
Send SMSWriteSend an SMS text message to a phone number
Send WhatsApp MessageWriteSend a WhatsApp message to a phone number
List MessagesReadList recent SMS and WhatsApp messages
Get MessageReadGet details about a specific message
List CallsReadList recent phone calls

Example prompts

  • Help me send an SMS notification to a customer about their order status.
  • Show me the most recent SMS and WhatsApp messages from the last 24 hours.
  • Give me a summary of recent calls including duration and status.
  • Help me draft and send a WhatsApp message for customer outreach.