search_messages
Search email messages across accounts and folders by text, sender, recipient, subject, date, folder, or read status, returning newest headers first.
Instructions
Search messages; newest first. Returns headers only (use get_message for the body). Every message lists its sender-controlled fields in untrusted_fields; invisible and text-direction characters are removed from them (invisible_chars_removed appears when any were).
query: free text (IMAP TEXT, headers+body). from_addr/to_addr/subject: substring matches.
since/before: YYYY-MM-DD arrival date (IMAP INTERNALDATE; before is exclusive). unread: true=only unread, false=only read.
folder: name or alias (sent, drafts, trash, junk, archive, all). limit: 1-200 (above 200 is capped and noted, below 1 is an error).
gmail_query: Gmail search syntax (X-GM-RAW), Gmail accounts only.
account="all" searches every enabled account in parallel.Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account": "<account>"
},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | No | ||
| since | No | ||
| before | No | ||
| folder | No | INBOX | |
| unread | No | ||
| account | Yes | ||
| subject | No | ||
| to_addr | No | ||
| from_addr | No | ||
| gmail_query | No |