search_emails
Search a full mailbox with KQL-style queries such as from:, subject:, or hasAttachment: to locate emails across all folders and years, returning message IDs.
Instructions
Full-text search across the user's ENTIRE mailbox (all folders, all years). Supports KQL-like operators: 'from:acme.com', 'subject:contract', 'hasAttachment:true', 'body:Pantheon', plus quoted phrases and AND/OR. Works on both personal (hotmail.com / outlook.com) and work/school accounts — the tool picks the correct backend automatically. IMPORTANT: results are ranked by relevance, NOT sorted by date. Date filters like 'received:this-week' are honored on AAD (work/school) but are IGNORED by the personal-account search backend, which returns matches from any time period. If you need strict date filtering, use list_emails (folder-scoped) with since/until instead. Returns a compact JSON array of hits with message IDs usable by read_email.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results. Default 25, max 250. | |
| query | Yes | Full-text search query using Microsoft Graph search syntax. Examples: 'invoice from:acme.com', 'subject:contract received:this week', 'hasAttachment:true Q4 report'. |