# Smsmobile MCP

> Smsmobile connects your AI agent directly to your phone's communication services. It lets you read incoming SMS and WhatsApp messages, send replies from either channel, track call logs, and manage contacts—all through natural conversation with no need for manual app switching.

## Overview
- **Category:** communication-messaging
- **Price:** Free
- **Tags:** sms-gateway, whatsapp-api, mobile-automation, call-logs, messaging-api, telephony

## Description

Smsmobile hooks up your AI agent directly to your phone’s communication services. This server treats your smartphone like a full-featured gateway, letting you manage texting, WhatsApp chats, emails, and calls—all through natural conversation with no manual app switching.

**Sending Messages: SMS, WhatsApp, and Email**

*   You can send new messages using `send_sms`, which sends an SMS from your connected phone number. You also use `send_whatsapp` to dispatch a chat message to any contact. For email communications, you just call `send_email` with the recipient address. When things go sideways and a message fails delivery, you'll need to run `resend_sms` to try sending that SMS again, or hit `resend_whatsapp` if the WhatsApp send failed or got stuck in the queue.

*   **Sending Alerts & Notifications:** You can push specific alerts using `send_notification`, which creates and pushes a notification right to a target mobile device. 

**Managing Communications History: Texts, Chats, and Calls**

*   To read texts, you first pull any unread SMS messages from your phone using `get_received_sms`. Once you grab them, you can mark their status as 'read' in the API system records via `mark_sms_read`. For WhatsApp, remember you gotta run `sync_whatsapp` first; that downloads all pending chats. After syncing, you pull the latest messages with `get_whatsapp_messages`. To see everything together—both incoming and outgoing texts—you grab grouped conversation data using `list_sms_conversations`. 

*   **Call Logs:** You get full visibility on your phone usage by retrieving call records. Use `list_incoming_calls` for calls that hit your number, or check `list_missed_calls` for unanswered rings. If you wanna see what calls *you* initiated, run `list_outgoing_calls`. 

**Gateway and Account Management**

*   The server lets you keep tabs on all the gear connected to your gateway. You can list every mobile device attached with `list_gateway_mobiles`, or change a device's label or status using `update_gateway_mobile`. If a device is disconnected, you use `delete_gateway_mobile` to remove it from the SMS Gateway panel.

*   You also handle contacts and communication records. You can retrieve all email addresses tied to your account with `get_emails`, and check who's pulled their plug on emails using `get_unsubscribed_emails`. For texts, you can get a complete history of every single SMS that passed through the API, including status codes, by calling `get_sms_logs`; this also lets you see all SMS messages sent directly from the phone itself via `list_mobile_sent_sms`. You can view general system alerts with `list_notifications`.

*   When texts come in, you'll need to manage how they look. Use `update_sms_alias` to change the display name shown for any received SMS message inside the system logs. 

**Advanced Functionality & Maintenance**

*   You can also maintain and modify the WhatsApp feature itself; use `set_whatsapp_active` to turn sending or receiving chats on or off. If you need to know if a number is even active on WhatsApp, check it with `check_whatsapp_number`. Finally, for backend cleanup, you pull any general records of communications by calling `list_incoming_calls`, `list_missed_calls`, and reviewing the conversation history via `list_sms_conversations`.

## Tools

### check_whatsapp_number
Verifies if a given number is currently registered on WhatsApp.

### delete_gateway_mobile
Removes a specific mobile device connection from the SMS Gateway management panel.

### delete_sms
Clears specific SMS messages from the server's internal log records.

### get_emails
Retrieves email addresses associated with your account.

### get_received_sms
Pulls any SMS messages that were recently received on the connected smartphone.

### get_sms_logs
Retrieves historical records of all SMS messages that passed through the API, including status codes.

### get_unsubscribed_emails
Lists contacts who have unsubscribed from email communications.

### get_whatsapp_messages
Retrieves the latest WhatsApp messages received on your connected device.

### list_gateway_mobiles
Shows and manages all mobile devices currently attached to the SMS Gateway.

### list_incoming_calls
Retrieves a list of calls that arrived on your phone number.

### list_missed_calls
Lists call records for missed or unanswered calls.

### list_mobile_sent_sms
Retrieves a list of SMS messages sent directly using the mobile device itself.

### list_notifications
Lists general system notifications related to your gateway account.

### list_outgoing_calls
Retrieves logs for calls that were initiated by the connected phone number.

### list_sms_conversations
Pulls grouped conversation data, showing both incoming and outgoing messages in one thread.

### mark_sms_read
Changes the status of a retrieved SMS message to 'read' within the API system records.

### resend_sms
Attempts to resend an SMS that previously failed delivery (must be flagged as error).

### resend_whatsapp
Retries sending a WhatsApp message that failed or was queued.

### send_email
Sends an email to a specified recipient address.

### send_notification
Creates and pushes a specific push notification alert to a target mobile device.

### send_sms
Sends a new SMS message from your connected phone number.

### send_whatsapp
Dispatches a WhatsApp message to a specific contact.

### set_whatsapp_active
Activates or deactivates the WhatsApp sending/receiving feature for your gateway account.

### sync_whatsapp
Must be run first to download and synchronize all pending WhatsApp messages before retrieval tools work.

### update_gateway_mobile
Modifies the label or status of a mobile device connected to your SMS Gateway.

### update_sms_alias
Changes the display name (alias) shown for a received SMS message in the system logs.

## Prompt Examples

**Prompt:** 
```
Send an SMS to +1234567890 saying 'Your appointment is confirmed for tomorrow at 10 AM'.
```

**Response:** 
```
I've sent the SMS via `send_sms`. The message is now queued on your mobile device with GUID: sms_98765.
```

**Prompt:** 
```
Check for any unread SMS messages received in the last hour.
```

**Response:** 
```
I'm checking `get_received_sms`... I found 2 unread messages. One from 'John' regarding 'Project Update' and another from an unknown number.
```

**Prompt:** 
```
Show me the logs for all SMS messages sent today that resulted in an error.
```

**Response:** 
```
Querying `get_sms_logs` for today's errors... I found 1 failed delivery to +1987654321 due to a mobile network timeout. Would you like me to try `resend_sms`?
```

## Capabilities

### Send Messages
Dispatch SMS messages, WhatsApp chats, and emails from your phone number directly through natural language requests.

### Manage Communications History
Retrieve grouped message threads (SMS/WhatsApp), full call logs, and detailed conversation archives to maintain a complete record of interactions.

### Handle Incoming Texts
Pull unread SMS messages from your phone and mark them as read within the API status after retrieval.

## Use Cases

### Handling a Support Inquiry
A customer texts in an urgent issue. Instead of you manually checking your phone or support software, your agent runs `get_received_sms`. The AI reads the text and uses that context to draft a detailed reply using `send_whatsapp`, keeping everything logged.

### Automating Outage Alerts
A system goes down. You need to notify 50 clients instantly. Your agent runs through your contact list and executes `send_sms` for each one, ensuring the alert is delivered via SMS regardless of their WhatsApp status.

### Auditing Communication Failures
A batch campaign failed to send messages. Instead of guessing why, you check the logs by calling `get_sms_logs` and pinpoint exactly which numbers failed and why. You then use `resend_sms` only for those specific failures.

### Pre-Interaction Prep Work
Before responding to a client, you want to know their history with your company. Your agent runs `list_sms_conversations` and checks for any missed calls via `list_missed_calls`, giving the AI full context before writing a single word.

## Benefits

- Full conversation history is instantly accessible. Instead of logging into a separate app to check logs, `list_sms_conversations` pulls all incoming and outgoing messages into one view for your agent.
- You get true omnichannel capability. Send alerts using `send_whatsapp` or stick to traditional SMS via `send_sms`. The AI client picks the right channel automatically based on context.
- No more missed data points. If a message failed, you don't have to wait for manual resending; you can use `resend_sms` or `resend_whatsapp` directly from your agent prompt.
- Complete visibility into calls and texts. Tools like `list_incoming_calls`, `list_missed_calls`, and `get_received_sms` let you audit communication activity even if no message was sent.
- Faster context switching means better support. After running `sync_whatsapp`, your agent can immediately use `get_whatsapp_messages` to respond, eliminating the need for manual data fetching.

## How It Works

The bottom line is: your AI client gets real-time access to every communication event happening on your connected mobile device.

1. Subscribe to the Smsmobile server and provide your unique API Key.
2. Your AI client runs a tool (e.g., `get_received_sms`) to pull data from the gateway.
3. The agent uses the retrieved context (the message body, sender ID, etc.) to formulate an action or response.

## Frequently Asked Questions

**How do I read unread SMS messages using get_received_sms?**
You run `get_received_sms` to pull the texts. The agent then shows you which ones are new and allows you to use `mark_sms_read` afterward to update their status.

**What is the difference between list_sms_conversations and get_whatsapp_messages?**
`list_sms_conversations` gives a grouped view of both SMS/WhatsApp history. `get_whatsapp_messages` specifically retrieves only WhatsApp messages after you've run `sync_whatsapp`.

**Can I resend an SMS that failed using resend_sms?**
Yes, but the message must first be logged with a failure status. Your agent reads the error via `get_sms_logs`, and if it's deliverable, you can ask it to try again with `resend_sms`.

**Do I need to run sync_whatsapp before getting WhatsApp messages?**
Yep. You must call `sync_whatsapp` first. This action pulls the latest chat data from your phone, making sure that `get_whatsapp_messages` has fresh content to retrieve.

**How does `list_gateway_mobiles` help me manage my connected devices?**
It shows a list of all mobile gateways tied to your account. This is how you check which SIM ports are active or if you need to connect new physical phones before starting message workflows.

**What's the difference between using `list_missed_calls` and checking my conversation history?**
Call logs track pure telephony events, while `list_sms_conversations` groups both incoming/outgoing messages. Use call tools for dial records, not text message content.

**I need to delete old data; how does the `delete_sms` tool handle server log cleanup?**
The `delete_sms` tool removes specific SMS records from the API's internal log. This is useful for compliance or simply reducing the volume of historical messages you retrieve.

**If I read a message, how do I update its status using `mark_sms_read`?**
Running `mark_sms_read` changes the API's record state for that SMS. This updates the system so your AI agent knows you’ve seen it without deleting the actual conversation.

**Can I send a message via WhatsApp instead of standard SMS?**
Yes! You can use the `send_whatsapp` tool directly, or use `send_sms` and set the `sendwa` parameter to 1 to route it through WhatsApp on your connected device.

**How do I check for new incoming messages on my phone?**
Use the `get_received_sms` tool. You can filter for only unread messages by setting `onlyunread` to 'yes', allowing your AI to process new inquiries automatically.

**Can I see the history of a specific conversation?**
Absolutely. Use `list_sms_conversations` with a specific phone number (`numero`) to retrieve the grouped history of incoming and outgoing messages for that contact.