search-onedrive-files
Search OneDrive files by name or content using KQL queries. Returns matching items with id, name, webUrl, size, and last modified date.
Instructions
Search the hierarchy of items for items matching a query. You can search within a folder hierarchy, a whole drive, or files shared with the current user.
đź’ˇ TIP: Searches for files in a drive by name or content. The q parameter searches file names, metadata, and file content. Returns matching driveItems with id, name, webUrl, size, lastModifiedDateTime. Use list-drives first to get the drive-id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Path parameter: q | |
| top | No | Page size (Graph $top). Start small (e.g. 5–15) so responses fit the model context; raise only if needed. Use $select to return fewer fields per item. For more rows, use @odata.nextLink from the response instead of a very large $top. | |
| skip | No | Items to skip for pagination. Not supported with $search. | |
| count | No | Set true to enable advanced query mode (ConsistencyLevel: eventual). Required for complex $filter on flag/flagStatus or contains(). | |
| expand | No | Expand related entities | |
| filter | No | OData filter expression. Add $count=true for advanced filters (flag/flagStatus, contains()). Cannot combine with $search. | |
| search | No | KQL search query — wrap value in double quotes. Cannot combine with $filter. | |
| select | No | Comma-separated fields to return, e.g. id,subject,from,receivedDateTime | |
| driveId | Yes | Path parameter: driveId | |
| orderby | No | Sort expression, e.g. receivedDateTime desc | |
| fetchAllPages | No | Follow @odata.nextLink and merge up to 100 pages into one response. Can return enormous payloads—only when the user explicitly needs a full export. Prefer a small $top first, then paginate or narrow with $filter/$search. | |
| includeHeaders | No | Include response headers (including ETag) in the response metadata | |
| excludeResponse | No | Exclude the full response body and only return success or failure indication |