mail_search_messages
Search an entire mailbox folder's retained message history via IMAP. Combine filters with AND/OR, match headers, dates, or properties, and page results across folders.
Instructions
Search the entire retained history of one folder using server IMAP search. Fields combine with AND; anyOf children combine with OR. headers supports Message-ID, References, In-Reply-To and arbitrary headers (string substring or true for existence). No implicit date cutoff. Search is server-defined and does not OCR or search inside binary attachments. Repeat across folders and all cursors for account-wide coverage. Results exceeding 64 KiB are saved completely to a private JSON file and return a compact summary with completeResultFile.
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": {
"accountId": "<accountId>",
"folder": "<folder>",
"query": "<query>"
},
"name": "mail_search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| cursor | No | ||
| folder | Yes | ||
| pageSize | No | ||
| accountId | Yes |