Search iMessage text
search_messagesSearch iMessage history by text, contact, or date range to find past conversations. Returns newest matches first and flags when results are capped.
Instructions
Case-insensitive substring search over message text, newest first. Also decodes attributedBody for messages whose plain text is empty. Optional contact (name, phone or email) and date filters are applied in SQL. Incoming messages include sender_name from Contacts. The scan is capped; the result says if the cap was hit, meaning the search was not exhaustive.
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": {
"query": "<query>"
},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of items to return (1-500, default 50). | |
| query | Yes | Text to look for (case-insensitive substring). | |
| since | No | ISO 8601 date or datetime, e.g. 2025-01-31 or 2025-01-31T09:00:00Z. | |
| until | No | ISO 8601 date or datetime, e.g. 2025-01-31 or 2025-01-31T09:00:00Z. | |
| contact | No | Contact name, phone number, email or handle id substring (e.g. 'Alice', '(415) 555-1234', 'alice@', '+1555'). Names are resolved from macOS Contacts. Matches messages from matching handles, and your replies in chats that include them. |