Search Microsoft 365
search_queryQuery Microsoft 365 mail, files, calendar, SharePoint, and Teams content; returns relevance-ranked, merged hits with rank, summary, IDs, URLs, and last-modified times.
Instructions
Runs a relevance-ranked Microsoft Search query across Microsoft 365 and returns a flattened list of hits, each with its rank, a text summary and the resource's id, name or subject, web URL and last-modified time. Defaults to 10 hits per entity-type group over ['message','driveItem']; page with from. Each entity type is searched in its own request and the hits merged, because Graph rejects some combinations outright (observed: message+driveItem 400s) and ranks stay per-request; chatMessage hits ignore fields. Each split asks only for the scopes its own index needs — Sites.Read.All for driveItem, listItem and site, Mail.Read for message, Calendars.Read for event, and BOTH Chat.Read and ChannelMessage.Read.All for chatMessage. That last pair is the one to watch: ChannelMessage.Read.All needs tenant admin consent and is carried by the teams group, so a chat search needs teams enabled as well as chat, and without it Graph refuses the chatMessage split with a 403 naming both permissions while every other split still returns; results are ranked, not sorted by date, and freshly changed items may not be indexed yet. This is read-only despite using POST.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Zero-based offset of the first hit to return; use it to page. Defaults to 0. | |
| size | No | Maximum hits to return per entity-type group. Defaults to 10, capped at 25. | |
| query | Yes | The search terms, in Microsoft Search KQL. Free text works ("quarterly budget"), as do property restrictions such as "subject:budget", "from:sara@contoso.com", "filetype:pptx" and "lastModifiedTime>=2026-01-01", combined with AND/OR/NOT. | |
| fields | No | Extra resource properties to retrieve and include on each hit, for example ["from","importance"] or a SharePoint managed property. Ignored for chatMessage, which does not support field selection. | |
| entityTypes | No | Which kinds of content to search. Defaults to ['message','driveItem'] (Outlook mail plus OneDrive/SharePoint files). |