Search a folder
search_mailFind emails in a Proton Mail folder using filters for text, sender, subject, date, unread, or flagged status. Returns message IDs and envelope data, newest first, with optional folder/label locations.
Instructions
Search a folder. Combine any of: text, from, subject, since (DD-Mon-YYYY), unread_only, flagged_only. Returns uids + envelopes, newest first. Set include_locations to also report which labels and folders each message carries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | ||
| text | No | ||
| limit | No | Max results (default 15). | |
| since | No | DD-Mon-YYYY, e.g. 01-Jul-2026 | |
| before | No | DD-Mon-YYYY. Combine with since for a date range. | |
| folder | No | Folder to search, e.g. INBOX, 'All Mail', 'Folders/<name>'. Default INBOX. | |
| subject | No | ||
| uidvalidity | No | UIDVALIDITY reported alongside the uid. Pass it back so a mailbox resync cannot make this act on the wrong message. | |
| unread_only | No | ||
| flagged_only | No | ||
| include_locations | No | Report every other mailbox each message appears in, so you can tell what it is already labelled or filed as without a second search. Costs one search per mailbox. |