Plivo
Send SMS messages, place calls, and look up numbers with PlivoTools.
PlivoTools gives an agent functions for sending SMS messages, placing calls, looking up carrier information, and reviewing call and message history.
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.plivo import PlivoTools
agent = Agent(
name="Plivo Agent",
model=OpenAIResponses(id="gpt-5.5"),
tools=[PlivoTools()], # all functions are enabled by default
markdown=True,
)
sender_phone_number = "+1234567890"
receiver_phone_number = "+1234567890"
if __name__ == "__main__":
# Look up carrier and line-type info for a number
agent.print_response(f"Look up carrier info for {receiver_phone_number}")
# Send an SMS
agent.print_response(
f"Send an SMS saying 'Your package has arrived' to {receiver_phone_number} from {sender_phone_number}"
)
# Place a phone call (answer_url must return Plivo XML)
agent.print_response(
f"Call {receiver_phone_number} from {sender_phone_number} using answer_url "
"https://s3.amazonaws.com/static.plivo.com/answer.xml with answer_method GET"
)
# Review recent call history
agent.print_response("Show my 5 most recent calls with their status and duration")
# Check recent message history
agent.print_response("List my 10 most recent messages")The script sends a real SMS and places a call. Save it as plivo_tools.py and replace both phone-number placeholders before running it. To try lookups and history first, remove the SMS and call prompts and use PlivoTools(enable_send_sms=False, enable_make_call=False).
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openai plivoExport your credentials
export OPENAI_API_KEY="your_openai_api_key_here"
export PLIVO_AUTH_ID="your_auth_id_here"
export PLIVO_AUTH_TOKEN="your_auth_token_here"Set the phone numbers
Replace sender_phone_number with your Plivo phone number and receiver_phone_number with the recipient's E.164 phone number.
Run the example
python plivo_tools.pyFull source: cookbook/91_tools/plivo_tools.py