send_sms
Send SMS messages to Android emulators for testing communication features during development and QA workflows.
Instructions
Send an SMS to the emulator (emulator only)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"phone_number": "<phone_number>",
"message": "<message>"
},
"name": "send_sms"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone_number | Yes | ||
| message | Yes | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:1117-1126 (handler)The primary handler for the send_sms tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints. Executes the ADB emulator SMS send command via the run_adb helper.
@mcp.tool() def send_sms( phone_number: str, message: str, device_serial: str | None = None ) -> str: """Send an SMS to the emulator (emulator only)""" return run_adb([ "emu", "sms", "send", phone_number, message ], device_serial) - src/adb_mcp_server/server.py:24-39 (helper)Core utility helper function that runs ADB commands using subprocess, handles device serial, timeouts, and errors. Directly used by the send_sms handler to execute the 'adb emu sms send' command.
def run_adb(args: list[str], device_serial: str | None = None, timeout: int = 30) -> str: """Run an ADB command and return output""" cmd = ["adb"] if device_serial: cmd.extend(["-s", device_serial]) cmd.extend(args) try: result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout) if result.returncode != 0 and result.stderr: return f"Error: {result.stderr}" return result.stdout except subprocess.TimeoutExpired: return "Error: Command timed out" except Exception as e: return f"Error: {str(e)}"