Search messages
search_messagesSearch Proton Mail messages by text, subject, sender, recipient, date range, read state, star, or size; require at least one criterion and return matching headers newest first with paging.
Instructions
Searches a mailbox by text, subject, sender, recipient, date range, read state, star or size. At least one criterion is required. Returns headers only, newest first across pages, with paging. A full-text search walks the local database of the Bridge and takes a few seconds on a large mailbox, while criteria such as unread or date are fast. Subject, sender and recipient are compared by this server against the decoded headers, so umlauts and spaces match as written, in any case; without a date range that reads the headers of the whole mailbox, at most the 20000 most recently added, and the answer says when that limit was reached. Full text cannot reach attachments or parts sent as base64, which the answer says as well. Searching "All Mail" covers every mailbox including trash, and entries that are in the trash are marked "in trash" - the other marks are flags rather than places, so "draft" says a message is one, not that it is in Drafts.
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_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Substring of a recipient address. | |
| from | No | Substring of the sender address or display name. | |
| text | No | Free text, matched against body and headers. This is the slow criterion. | |
| limit | No | How many results to return. | |
| since | No | Only messages the sender dated on or after this day, as YYYY-MM-DD. Compared against the Date header, which is what the results show. | |
| before | No | Only messages the sender dated before this day, as YYYY-MM-DD. Compared against the Date header, which is what the results show. | |
| offset | No | How many results to skip, for paging. | |
| mailbox | No | Which mailbox to search. Defaults to "All Mail", which holds every message, discarded ones included. Those come back marked "in trash". | All Mail |
| subject | No | Substring of the subject. | |
| largerThan | No | Minimum size in bytes. Useful for finding messages with large attachments. | |
| unreadOnly | No | When true, only unread messages. False and omitted both mean no filter. | |
| starredOnly | No | When true, only starred messages. False and omitted both mean no filter. |