Skip to main content
Glama

graph_search_files

Search OneDrive or SharePoint files by name or content and page through results with next-link URLs when large result sets exceed the requested limit.

Instructions

Search for files by name or content in OneDrive or a SharePoint document library.

Graph rejects $skip on the search function, so page with next_link instead.

Args: query: Search query string. top: Maximum number of results (default 25). compact: Whether to return only the identifying fields instead of the full record (default false). Use it to page through large collections cheaply. next_link: Opaque nextLink URL from a previous call, used to fetch the next page. Overrides the other paging arguments when supplied. include_next_link: Whether to wrap the result as {items, next_link} so paging can continue (default false, which returns a bare list). drive_id: Drive ID to act on. Empty targets your own OneDrive.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "graph_search_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNo
queryYes
compactNo
drive_idNo
next_linkNo
include_next_linkNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that Graph rejects $skip on the search function, that include_next_link changes the return shape to {items, next_link} versus a bare list, that compact trims to identifying fields, and that next_link overrides other paging args. Missing are auth/permission requirements and whether SharePoint libraries need a particular drive_id form.

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

Conciseness4/5

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

Purpose is front-loaded in one sentence, followed immediately by the paging caveat that matters most for correct invocation, then a scannable Args block. Slightly verbose line wrapping, but no sentence is filler.

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?

For a six-parameter tool with no annotations and no output schema, the definition covers the two things an agent would otherwise get wrong: paging and return shape. It is not fully complete on permissions or on how drive_id differs between OneDrive and SharePoint document libraries.

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 description coverage is 0%, so the description must compensate, and it documents all six parameters with meaning, defaults, and interaction rules (next_link overriding paging args, empty drive_id meaning own OneDrive, compact for cheap paging). It stops short on query syntax (e.g. KQL) and on the practical bounds of top.

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

Purpose4/5

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

States a specific verb and resource (search files) plus both scopes it covers (OneDrive or a SharePoint document library), which is more than a restatement of the name. It does not name a sibling such as graph_list_files or graph_search_all, so the agent must infer the boundary between search and listing on its own.

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

Usage Guidelines3/5

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

Usage is implied: use this to find files by name or content, and page with next_link rather than $skip. There is no explicit when-to-use versus graph_list_files or graph_search_all, and no stated prerequisites, so the routing decision is left to inference.

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

Deploy Server

Other Tools