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 and since (strict yyyy-MM-dd; an unparseable value is an error), newest first. address matches a raw case-insensitive substring, a digits-only substring after normalizing formatting (+1 (555) 010-9999 → +15550109999), or PhoneNumberUtils.compare (tolerates national vs international prefixes). A SQL LIKE pre-filter (SmsUtils.addressPrefilter) narrows the rows the provider returns, and SmsUtils.addressMatches is the precise check in the cursor loop. 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; %, _ and \ in query match literally) 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; the body is always split with divideMessage/sendMultipartTextMessage. Requires SEND_SMS.

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).