query_emails
Filter your Fastmail inbox by sender, subject, date, keywords, or attachments to retrieve matching emails with previews.
Instructions
Search for emails with structured filters. Returns matching emails with preview.
Args: in_mailbox: Mailbox ID to search within. text: Full-text search across all fields (from, to, subject, body). from_addr: Filter by sender address or name. to_addr: Filter by recipient address or name. subject: Filter by subject text. after: Emails received after this date (ISO 8601, e.g. "2024-01-01T00:00:00Z"). before: Emails received before this date (ISO 8601). has_keyword: Require keyword/flag ("$flagged", "$seen", "$draft", "$answered"). not_keyword: Exclude emails with this keyword. has_attachment: Filter by attachment presence. filter_json: Raw JSON FilterCondition for complex queries (overrides other filter params). sort_property: Sort field — receivedAt, sentAt, from, to, subject, size. sort_ascending: Sort direction (default: newest first). limit: Max results (1–100, default 20).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| in_mailbox | No | ||
| text | No | ||
| from_addr | No | ||
| to_addr | No | ||
| subject | No | ||
| after | No | ||
| before | No | ||
| has_keyword | No | ||
| not_keyword | No | ||
| has_attachment | No | ||
| filter_json | No | ||
| sort_property | No | receivedAt | |
| sort_ascending | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||