Does anyone know how to limit the length
# general-english
s
Does anyone know how to limit the length of SMS messages from Vapi? Some of the messages are too long so when I receive them on my phone, they are cut off. I tried to add instructions in the prompt to limit the number of words but it's not working
r
This won’t reliably work from the prompt because SMS length is controlled outside Vapi, at the sending layer. You need to enforce a hard character limit or truncation in the tool or API that actually sends the message, otherwise long responses will still go through and get cut off.
@Rita Heritage
s
Hi Rita, thanks for responding! Do you know how to do that? I imported my number from Twilio. Would I need to go somewhere in the Twilio settings to fix this?
r
Yes since your number is on Twilio, you’ll need to handle it there (or in whatever is triggering the SMS send, if it’s coming from Vapi via Twilio). Twilio itself doesn’t limit message length by default, but you can control what gets sent before it hits Twilio. So the real fix is usually in your sending logic (Vapi tool / middleware / API function), where you truncate or split the message before calling Twilio’s send message endpoint. If you want a quick Twilio-side safety check, you can review your messaging logs in Twilio Console to confirm how long the payloads are but the actual length control won’t be a Twilio setting toggle. Hope you understand me @Selina
s
@Rita Heritage Do you mind providing a bit more detail on how to fix it in my sending logic? I'm not sure what to do to fix it. Do I need to create a new Vapi tool?