# Plivo MCP

> Plivo MCP Server connects your AI agent directly to global telecommunications infrastructure. It lets you send live SMS messages, manage VoIP calls across E.164 formats, and audit call logs without writing boilerplate API code. Use it to check account balances, list active phone numbers, or hang up stuck SIP sessions instantly.

## Overview
- **Category:** communication-messaging
- **Price:** Free
- **Tags:** voice-api, sip-trunking, sms-gateway, telecom-infrastructure, e164-formatting, real-time-communication

## Description

Look, forget those clunky web dashboards and boilerplate API calls. This Plivo MCP Server connects your AI client right into the global telecom infrastructure. You're not just managing data; you're handling actual communication—sending texts, bridging live VoIP calls, and digging through call logs, all without writing a line of code yourself.

When you use this server, your agent gets control over every aspect of Plivo’s services. It lets you check account balances, list out every active phone number, or hang up a stuck SIP session instantly. Here's what you can make your AI client do:

### Account Status and Inventory

You need to know where you stand before you start calling. Your agent can pull the core Plivo account details using `get_account_info`, giving you immediate visibility into usage limits and current billing status. To see all the numbers you've got, use `list_plivo_numbers`; this tool lists every single active, registered DID (Direct Inward Dialing) number in your account. For routing calls, it gives you a list of configured SIP endpoints via `list_sip_endpoints`. You can also get an accounting of all recent connections by running `list_calls`, which provides a history of both voice calls that came in and those that went out.

### Managing Voice Calls

Controlling the phone lines is straightforward. To start a call, your agent executes `make_voice_call`, initiating an outbound voice connection to any specific destination number you give it. If the call is already running but gets stuck, use `terminate_call` to cleanly end that active session. Need details on a call that just happened? You can fetch granular data about one specific voice call using its unique ID with `get_call_details`. This lets you trace everything about that single interaction.

### Sending Texts and Auditing Messages

When it comes to SMS, your agent sends new texts by executing `send_sms`, mapping the destination number and the message content directly into the prompt. If you need a record of what happened before or after sending a text, use `list_messages` to get a full history of both sent and received messages. For deep troubleshooting, you can retrieve granular details for any single message using `get_message_details`; this is critical because it tells you exactly why a delivery failed.

### Workflow Summary

In short, your agent handles the whole cycle. You tell it to send an SMS and provide the E.164 format number; it executes that via `send_sms`. If you need to check if your account has bandwidth left, you call `get_account_info`. To confirm which numbers are active for a campaign, you run `list_plivo_numbers`, or to track down why last week's message bounced, you pull the failure reason using `get_message_details` after checking the main log with `list_messages`. You never write boilerplate code; just tell your AI client what telecom operation you need done.

## Tools

### get_account_info
Retrieves core Plivo account details, including usage limits and billing status.

### get_call_details
Fetches specific data about a single voice call based on its unique identifier.

### get_message_details
Retrieves granular details for one message, including the reason for delivery failure.

### list_calls
Lists all recent voice calls made or received through the account.

### list_messages
Provides a history of both sent and received SMS messages.

### list_plivo_numbers
Lists all active, registered phone numbers (DIDs) available in the account.

### list_sip_endpoints
Provides a list of configured SIP endpoints used for routing calls.

### make_voice_call
Initiates an outbound voice call to a specified destination number.

### send_sms
Sends a new SMS message from a source number to a target number.

### terminate_call
Ends an active voice call session that is currently in progress.

## Prompt Examples

**Prompt:** 
```
Check Plivo account status and let me know my remaining wallet balance.
```

**Response:** 
```
Retrieval confirmed via `get_account`. Primary Plivo account is active securely. Current remaining balance mapped to `$412.55`. Would you like me to ping the `list_calls` node to verify active expenses burning constraints right now?
```

**Prompt:** 
```
Send an SMS message to `15551234567` from our main `15559876543` local number saying the servers are online.
```

**Response:** 
```
Action logged and sent. Executed the mutation `send_sms` seamlessly passing source E.164 and target destinations simultaneously. Plivo acknowledged payload receipt queue mapping it successfully holding object UUID: `a7d-22r9`. I will monitor the background if required.
```

**Prompt:** 
```
Check Plivo network to list all presently active voice phone calls.
```

**Response:** 
```
Query deployed against the active telecom trunk node (`list_calls`). Result: Empty array bounding currently parsed instances. The network endpoints are clean, reporting identically 0 concurrent routing states or phantom SIP loops tied to your active parameters.
```

## Capabilities

### Send SMS Messages
Sends a text message to any destination number using the E.164 format.

### Manage Voice Calls
Initiates, lists details for, or terminates active phone calls through the network.

### Check Account Status
Retrieves your current Plivo account balance and operational limits.

### List Phone Numbers
Gets a list of all active DID numbers registered to the Plivo account.

### Audit Message History
Retrieves logs for both sent and received SMS messages, including failure reasons.

## Use Cases

### Debugging Stuck VoIP Sessions
A telecom ops worker notices several calls are stuck in 'connected' state, tying up resources. Instead of manually logging into the dashboard and finding the IDs, they instruct their agent to run `list_calls` first. The agent finds the phantom sessions, allowing the worker to then sweep them with a batch of `terminate_call` operations.

### Emergency Alerting
A system outage happens at 3 AM. Instead of writing a Python script and deploying it, an on-call engineer simply prompts the agent: 'Send an SMS to all site managers.' The agent executes `send_sms` immediately using the configured source number.

### Pre-Deployment Testing
A backend architect needs to confirm a new webhook is working. They ask their agent to `make_voice_call` to a test number and then use `get_call_details` to verify the call connected correctly, simulating real traffic before production.

### Compliance Auditing
An auditor needs proof that all client communication attempts were logged. They prompt the agent to `list_messages`, filtering by dates and status codes, ensuring they pull comprehensive records of both success and failure events using `get_message_details`.

## Benefits

- **Handle Emergencies Instantly:** Don't wait for a developer to write code. Just ask the agent to `send_sms` or `make_voice_call` in plain language to trigger immediate communications.
- **Full Visibility into Call Logs:** Use `list_calls` and then `get_call_details` to track every connection state, helping debug why a call failed without digging through raw logs.
- **Maintain Operational Readiness:** Run automated balance checks using `get_account_info`. You'll know if you hit a billing constraint before an important outreach campaign starts.
- **Debug Message Failures:** If an SMS didn't go out, use `list_messages` followed by `get_message_details` to pull the exact carrier rejection code. No guesswork needed.
- **Manage Infrastructure:** Quickly get visibility into your assets by calling `list_plivo_numbers` or mapping SIP routes with `list_sip_endpoints`. It's a quick inventory check.

## How It Works

The bottom line is: your AI client handles all the complex API interaction; you just talk naturally about telecom tasks.

1. Enable the Plivo integration module on Vurb and supply your required Auth ID and Auth Token.
2. Tell your AI client exactly what you need to do (e.g., 'Check my balance' or 'Send an SMS to X').
3. The agent executes the necessary tool calls, communicates with Plivo, and reports the result back to you.

## Frequently Asked Questions

**How do I check my Plivo account balance using get_account_info?**
You ask the agent to run `get_account_info`. The tool returns your current billing status and remaining wallet amount directly in the chat.

**What is the difference between list_calls and make_voice_call?**
`list_calls` shows you a history of calls that happened. `make_voice_call` initiates an actual, live outbound call right now.

**I need to send a test SMS; what tool should I use? Use send_sms.**
Use the `send_sms` tool. You just provide the destination E.164 number and the message text, and it handles sending the payload.

**How do I find out why a specific SMS failed? Use get_message_details.**
Use `list_messages` to find the object ID first. Then pass that ID to `get_message_details`. It pulls the exact reason, like 'carrier rejection' or 'invalid destination.'

**I need to audit my infrastructure; how do I use `list_sip_endpoints` to check all active SIP trunks?**
It lists every registered SIP endpoint tied to your account. This shows you exactly which virtual phone numbers or gateways are currently connected and ready for routing, helping prevent connection gaps.

**If a voice call fails unexpectedly, how do I use `get_call_details` to find out why it dropped?**
You provide the Call SID to get deep details on any specific call. This tool returns metadata like connection duration, routing path, and the exact failure code, letting you diagnose the issue immediately.

**I have phantom calls stuck in a loop state; how do I use `terminate_call` to hang them up?**
You pass the Call SID into `terminate_call`. This forces an immediate disconnect on an active or looping session. It’s your tool for clearing out any rogue, persistent voice connections.

**When I use `list_messages`, what information can I pull about message status and delivery attempts?**
The list shows both sent and received messages with rich metadata. You get the final delivery status, including any specific carrier error codes or bounce reasons for failed transmissions.

**Can my AI directly check why a specific SMS message failed to send?**
Yes. When anomalous delivery states occur, the AI can query `list_messages` identifying problematic entries. Then, executing `get_message` feeding the discrete UUID returns explicit structural insights straight from Plivo’s carrier networks (e.g., 'Destination Not Found', 'Blocked by telecom firewall').

**Is it possible to terminate a live stuck call from my text prompt?**
Absolutely. If you detect logic loops keeping Voice trunks active in `list_calls`, instruct the agent to issue the `cancel_call` action. Supplying the precise UUID forces the HTTP architecture to literally send a `DELETE` tear-down protocol, instantly vaporizing the connection physically.

**Can the agent interact with my billing limits to warn me?**
Correct. Plivo natively exposes account architecture. Prompting the system to fetch `get_account` pulls cash balances, available capacity boundaries, and current currency mapping logic. It allows your Agent to perform autonomous diagnostics warning you natively before critical telecom endpoints shutdown due to zero-balance errors.