Skip to main content
AgentPhone is a telephony platform for AI agents. The langchain-agentphone package provides LangChain tools for sending messages, making AI-powered phone calls, managing phone numbers, and more.

Overview

Integration details

ClassPackageSerializableJS supportVersion
AgentPhoneToolkitlangchain-agentphonePyPI - Version

Available tools

ToolDescription
AgentPhoneSendSMSSend a text message
AgentPhoneMakeCallMake an AI-powered outbound phone call
AgentPhoneGetTranscriptGet the transcript of a phone call
AgentPhoneListCallsList phone calls with optional filters
AgentPhoneListConversationsList conversations
AgentPhoneGetConversationGet a conversation with its messages
AgentPhoneBuyNumberBuy a new phone number
AgentPhoneListNumbersList phone numbers on the account
AgentPhoneCreateAgentCreate a new AI phone agent
AgentPhoneListAgentsList AI phone agents
AgentPhoneCreateContactCreate a new contact
AgentPhoneListContactsList contacts

Setup

Install the package:
pip install -qU langchain-agentphone

Credentials

You need an AgentPhone API key. Sign up at agentphone.to to get one.
import getpass
import os

if not os.environ.get("AGENTPHONE_API_KEY"):
    os.environ["AGENTPHONE_API_KEY"] = getpass.getpass("AgentPhone API key:\n")

Instantiation

Use the toolkit to get all tools at once, or select specific ones:
from langchain_agentphone import AgentPhoneToolkit

# All tools
toolkit = AgentPhoneToolkit()
tools = toolkit.get_tools()

# Or select specific tools
toolkit = AgentPhoneToolkit(selected_tools=["send_sms", "list_numbers", "make_call"])
tools = toolkit.get_tools()
You can also instantiate individual tools directly:
from langchain_agentphone import AgentPhoneSendSMS, AgentPhoneListNumbers

send_sms = AgentPhoneSendSMS()
list_numbers = AgentPhoneListNumbers()

Invocation

Invoke directly with args

from langchain_agentphone import AgentPhoneSendSMS

tool = AgentPhoneSendSMS()
result = tool.invoke({
    "number_id": "num_abc123",
    "to_number": "+14155551234",
    "body": "Hello from LangChain!"
})
print(result)

Invoke with ToolCall

model_generated_tool_call = {
    "args": {
        "number_id": "num_abc123",
        "to_number": "+14155551234",
        "body": "Meeting at 3pm confirmed."
    },
    "id": "1",
    "name": "agentphone_send_sms",
    "type": "tool_call",
}
tool_msg = tool.invoke(model_generated_tool_call)
print(tool_msg.content)

Use within an agent

from langchain_agentphone import AgentPhoneToolkit
from langchain.chat_models import init_chat_model
from langgraph.prebuilt import create_react_agent

model = init_chat_model(model="claude-sonnet-4-6", model_provider="anthropic")

toolkit = AgentPhoneToolkit(
    selected_tools=["send_sms", "list_numbers", "list_contacts"]
)
agent = create_react_agent(model, toolkit.get_tools())

response = agent.invoke({
    "messages": [("user", "List my phone numbers, then send a message to +14155551234 saying 'Hello!'")]
})

API reference

For detailed documentation of the AgentPhone API, visit docs.agentphone.to.