search_emails
Search emails by subject, sender, recipient, body, date, or flag using himalaya filter syntax with and/or/not conditions and sorted results.
Instructions
Search emails using himalaya filter syntax. Combine conditions with and/or (REQUIRED between every condition pair — omitting them causes parse errors). Negate any condition with not. Multi-word values: quote them or backslash-escape the spaces. Sort results with order by <date|from|to|subject> <asc|desc>. Conditions: subject, from, to, body, date (exact day), after (strictly after), flag. Flag values: seen, answered, flagged, draft, deleted. On himalaya v2 every word must belong to a condition (no bare words: use subject <word>), and there is no before: use not after <date>.
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": {
"query": "<query>"
},
"name": "search_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query. Use `and`/`or` between every condition pair (e.g. 'from alice and after 2026-07-01'; NOT 'from alice after 2026-07-01'). Negate with `not` (e.g. 'not from spammer', 'not flag seen'). Multi-word values: quote them ('subject "quarterly report"') or backslash-escape the spaces ('subject quarterly\ report'). Older than a date: 'not after 2026-06-30' (there is no `before` on himalaya v2). Always name the field ('subject invoice', 'body invoice'): bare words are rejected on v2. Sort with 'order by date desc'. Full example: 'subject invoice and after 2026-01-01 order by date desc'. | |
| folder | No | Folder to search in (default: INBOX) | |
| account | No | Account name (uses default if omitted) |