Skip to main content
Glama

search-onedrive-files

Read-only

Search files and folders in OneDrive by name or content using a KQL query. Returns matching items with metadata such as 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

TableJSON Schema
NameRequiredDescriptionDefault
topNoPage 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.
skipNoItems to skip for pagination. Not supported with $search.
searchNoKQL search query — wrap value in double quotes. Cannot combine with $filter.
filterNoOData filter expression. Add $count=true for advanced filters (flag/flagStatus, contains()). Cannot combine with $search.
countNoSet true to enable advanced query mode (ConsistencyLevel: eventual). Required for complex $filter on flag/flagStatus or contains().
selectNoComma-separated fields to return, e.g. id,subject,from,receivedDateTime
orderbyNoSort expression, e.g. receivedDateTime desc
expandNoExpand related entities
driveIdYesPath parameter: driveId
qYesPath parameter: q
fetchAllPagesNoFollow @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.
includeHeadersNoInclude response headers (including ETag) in the response metadata
excludeResponseNoExclude the full response body and only return success or failure indication
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds substantial behavioral info beyond annotations: explains q searches file names, metadata, and content; describes return fields; mentions pagination via @odata.nextLink and fetchAllPages behavior. No contradiction with readOnlyHint=true or destructiveHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is brief and front-loaded with the main action, followed by a clear tip. Every sentence provides useful information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 13 parameters and no output schema, the description covers the return format, pagination, and key behavioral notes. It could mention edge cases or error conditions, but it is sufficiently complete for most use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds value by advising small $top, warning about fetchAllPages payloads, and explaining q's search scope. Adds meaningful guidance beyond raw parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it searches for items matching a query across a folder hierarchy, whole drive, or shared files. It distinguishes from sibling tools like list-drives and list-folder-files by focusing on search, and even advises using list-drives first to get the drive-id.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context on when to use (search by name/content) and a useful tip about using list-drives first. Lacks explicit when-not-to-use scenarios, but the sibling tools list implies alternatives for list operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Softeria/ms-365-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server