> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1781706951-9d0138e.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentPhone Toolkit

> Integrate with the AgentPhone toolkit using LangChain Python.

[AgentPhone](https://agentphone.to) 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

| Class               | Package                                                                  | Serializable | [JS support](https://js.langchain.com) |                                               Version                                              |
| :------------------ | :----------------------------------------------------------------------- | :----------: | :------------------------------------: | :------------------------------------------------------------------------------------------------: |
| `AgentPhoneToolkit` | [`langchain-agentphone`](https://pypi.org/project/langchain-agentphone/) |       ❌      |                    ❌                   | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-agentphone?style=flat-square\&label=%20) |

### Available tools

| Tool                          | Description                            |
| :---------------------------- | :------------------------------------- |
| `AgentPhoneSendSMS`           | Send a text message                    |
| `AgentPhoneMakeCall`          | Make an AI-powered outbound phone call |
| `AgentPhoneGetTranscript`     | Get the transcript of a phone call     |
| `AgentPhoneListCalls`         | List phone calls with optional filters |
| `AgentPhoneListConversations` | List conversations                     |
| `AgentPhoneGetConversation`   | Get a conversation with its messages   |
| `AgentPhoneBuyNumber`         | Buy a new phone number                 |
| `AgentPhoneListNumbers`       | List phone numbers on the account      |
| `AgentPhoneCreateAgent`       | Create a new AI phone agent            |
| `AgentPhoneListAgents`        | List AI phone agents                   |
| `AgentPhoneCreateContact`     | Create a new contact                   |
| `AgentPhoneListContacts`      | List contacts                          |

## Setup

Install the package:

```bash theme={null}
pip install -qU langchain-agentphone
```

### Credentials

You need an AgentPhone API key. Sign up at [agentphone.to](https://agentphone.to) to get one.

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
from langchain_agentphone import AgentPhoneSendSMS, AgentPhoneListNumbers

send_sms = AgentPhoneSendSMS()
list_numbers = AgentPhoneListNumbers()
```

## Invocation

### Invoke directly with args

```python theme={null}
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

```python theme={null}
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

```python theme={null}
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](https://docs.agentphone.to).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/tools/agentphone.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
