search_messages
Search an IMAP email folder by sender, subject, body text, date range, and unread status. Combines criteria with AND, performs server-side search, and returns newest messages first.
Instructions
Search a folder. All supplied criteria are combined with AND.
Server-side IMAP search, so it works over the whole folder without downloading anything. Results are newest first.
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 |
|---|---|---|---|
| text | No | Free text, matched against headers and body. | |
| from_ | No | Substring of the sender address or name. | |
| limit | No | Max messages to return. | |
| since | No | On or after this date. | |
| before | No | Strictly before this date. | |
| folder | No | Folder role ('inbox', 'sent', 'junk', 'trash', 'drafts', 'archive') or a raw server folder name. | inbox |
| offset | No | Messages to skip, for paging. | |
| account | No | Account name. Optional when only one is configured. | |
| subject | No | Substring of the subject. | |
| unread_only | No | Only unread mail. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |