Package-level declarations

Types

Link copied to clipboard
class ReadMessagesTool(context: Context) : McpTool

Reads SMS from the inbox or sent box via ContentResolver on Telephony.Sms, optionally filtered by address (LIKE substring) and since (yyyy-MM-dd, kept only if it parses), newest first. Requires READ_SMS. Output: messages (list of {id, address, body, date formatted yyyy-MM-dd HH:mm, read}), count, and the resolved box. box is 'inbox' (default) or 'sent'; limit clamps to 1–100 (default 10).

Link copied to clipboard

Searches all SMS (across boxes) whose BODY matches query (SQL LIKE substring) via ContentResolver on Telephony.Sms, newest first. Requires READ_SMS. Output: messages (list of {id, address, body, date formatted yyyy-MM-dd HH:mm}), count, and the echoed query, capped at limit (1–100, default 10).

Link copied to clipboard
class SendMessageTool(context: Context) : McpTool

Sends an SMS to to with text body via SmsManager (version-checked: system service on API 31+, else getDefault()). The recipient must match phoneRegex or an error is returned; bodies over 160 chars are split with divideMessage/sendMultipartTextMessage. Requires SEND_SMS. Output on success: sent (true), echoed to, and body_length; failures return an error with the exception message.

Link copied to clipboard
object SmsTools

Provider for the SMS tool module. Wires up ReadMessagesTool, SendMessageTool, and SearchMessagesTool. Reads query Telephony.Sms (needs READ_SMS); sending uses SmsManager (needs SEND_SMS).