Search mail
search_messagesFind emails across mailboxes by sender, subject, text, date, folder, read/starred status, or attachments, returning newest-first summaries with IDs and pagination cursors for follow-up.
Instructions
Find mail, newest first. All filters narrow together. To search every folder, give folder all. Without an account it searches every account you may read, or those of account_ids, and folder must be a role. It reads only and marks nothing read. Answers summaries with ids and a next_cursor for more, each with sender_check, the receiving server's check of the domain in from. get_message reads one mail, get_thread a whole conversation. For what arrived since an earlier call, use whats_new.
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 | Part of To. One line, at most 200 characters | |
| text | No | Anywhere in the mail. One line, at most 200 characters | |
| after | No | Received from this day, YYYY-MM-DD | |
| limit | No | At most this many in one answer | |
| before | No | Received before this day, YYYY-MM-DD | |
| cursor | No | next_cursor of the previous call, for more | |
| folder | No | Folder id, or a role such as inbox, sent, archive. Left out: the inbox. all: every folder but the trash and junk, where the account has it | |
| sender | No | Part of From. One line, at most 200 characters | |
| unread | No | true: unread mail only. false: read mail only | |
| starred | No | true: starred mail only. false: the rest only | |
| subject | No | Part of the subject. One line, at most 200 characters | |
| account_id | No | One account. Left out: every account, or those of account_ids | |
| account_ids | No | Several accounts, not beside account_id. Left out: every account | |
| has_attachments | No | true: mail with attachments only. false: without |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| messages | Yes | ||
| next_cursor | Yes | ||
| accounts_not_answering | No |