Plivo

PlivoTools enables agents to interact with Plivo for sending SMS, placing calls, and looking up phone numbers.

PlivoTools enables an Agent to interact with Plivo services, such as sending SMS, placing calls, looking up numbers, and reviewing call and message history.

Prerequisites

The following examples require the plivo library and a Plivo Auth ID and Auth Token, which can be obtained from the Plivo console.

uv pip install agno plivo openai

Set the following environment variables:

export PLIVO_AUTH_ID=***
export PLIVO_AUTH_TOKEN=***

Replace the sample lookup number with a real number in E.164 format.

Example

The following agent will look up carrier information for a phone number using Plivo:

from agno.agent import Agent
from agno.tools.plivo import PlivoTools

agent = Agent(
    instructions=[
        "Use your tools to send messages and place calls using Plivo.",
    ],
    tools=[PlivoTools()],
)

agent.print_response("Look up carrier info for +1234567890", markdown=True)

Toolkit Params

NameTypeDefaultDescription
auth_idOptional[str]NonePlivo Auth ID for authentication. If not provided, uses PLIVO_AUTH_ID environment variable.
auth_tokenOptional[str]NonePlivo Auth Token for authentication. If not provided, uses PLIVO_AUTH_TOKEN environment variable.
debugboolFalseEnable debug logging for troubleshooting.
enable_send_smsboolTrueEnable the send_sms functionality.
enable_make_callboolTrueEnable the make_call functionality.
enable_get_call_detailsboolTrueEnable the get_call_details functionality.
enable_list_messagesboolTrueEnable the list_messages functionality.
enable_list_callsboolTrueEnable the list_calls functionality.
enable_lookup_numberboolTrueEnable the lookup_number functionality.
allboolFalseEnable all functionality.

Toolkit Functions

FunctionDescription
send_smsSends an SMS to a single recipient. Parameters: to (str, E.164 format), from_ (str, a Plivo number, short code, or alphanumeric sender ID), body (str). Returns the message UUID if successful or an error message if failed.
make_callPlaces an outbound call. Parameters: to (str, E.164 format), from_ (str, a Plivo voice-enabled number), answer_url (str, must return Plivo XML), answer_method (str, GET or POST, default POST). Returns the call request UUID if successful or an error message if failed.
get_call_detailsRetrieves details of a call using its UUID. Parameters: call_uuid (str). Returns a dictionary with the call's to, from, state, duration, direction, initiation_time, answer_time, and total_amount.
list_messagesLists recent messages. Parameters: limit (int, default 20, capped at the Plivo per-request maximum of 20), offset (int, default 0, for paging past the cap), message_direction (str, optional, inbound or outbound). Returns a list of message details.
list_callsLists recent calls. Parameters: limit (int, default 20, capped at the Plivo per-request maximum of 20), offset (int, default 0, for paging past the cap), call_direction (str, optional, inbound or outbound). Returns a list of call details.
lookup_numberLooks up carrier and line-type information for a phone number. Parameters: number (str, E.164 format). Returns a dictionary with the number's number, country, format, and carrier.

Developer Resources