Search a folder
search_mailSearch Proton Mail folders or all mailboxes by text, sender, subject, date, unread or flagged status; get newest messages first with optional label and folder locations.
Instructions
Search a folder. Combine any of: text, from, subject, since (DD-Mon-YYYY), unread_only, flagged_only. Returns uids + envelopes, newest first. With no filters it lists the newest messages in the folder. Set include_locations to also report which labels and folders each message carries. Set all_folders to search every mailbox at once when you do not know where something is: duplicates collapse by Message-ID and each row says where the message lives.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_mail"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | ||
| text | No | ||
| limit | No | Max results (default 15, or the most recent 25 with all_folders). | |
| 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 | ||
| all_folders | No | Search every mailbox instead of one folder. Takes no folder, uidvalidity or include_locations. | |
| 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. |