Search messages
messages_searchSearch local iMessage and SMS history by text query, with optional chat or date filters, to find matching messages.
Instructions
Search message text: SQL LIKE on the plain text column, then a bounded decode-scan of empty-text / Tahoe rows. No MESSAGES_SCOPE and MESSAGES_ALLOW_UNSCOPED is unset; list/search/thread/send/watch return SCOPE. Returns truncated:true and scanned when the Tahoe window is exhausted. With no chat_id, searches across all readable chats (or the allowlist). Case-insensitive. Does not search attachment binaries. Does not write FTS into chat.db.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Default 25. | |
| query | Yes | Substring to find. | |
| chat_id | No | Restrict to this chat.ROWID. | |
| to_date | No | ISO-8601 inclusive upper bound. | |
| from_date | No | ISO-8601 inclusive lower bound. |