Skip to main content
Glama

list_sharepoint_files

Read-onlyIdempotent

List the files and folders in a SharePoint site's document library, as the authorized user sees them. Without driveId it reads the site's default library and also returns the site's other libraries (driveId each). Pass folderId to open a folder, or search to find files by name or content in the library. Each item's driveItemId (with driveId for a non-default library) is what attach_sharepoint_document takes. Read only; requires Sites.Read.All delegated scope, like list_sharepoint_sites.

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": {
      "siteId": "<siteId>"
    },
    "name": "list_sharepoint_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
cursorNonextCursor from a previous call, for the next page.
searchNoFind files by name or content in the library instead of listing a folder.
siteIdYesSite id from list_sharepoint_sites.
driveIdNoA document library id from this tool's libraries list. Omit for the site's default library.
folderIdNoA folder's driveItemId to list its contents. Omit for the library root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, and the description reinforces this with 'Read only' plus the Sites.Read.All delegated scope requirement and per-user visibility filtering — context the annotations don't carry. It stops short of describing the result shape (how libraries and items are interleaved) despite having no output schema, so a 4 rather than 5.

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?

Four tight sentences, front-loaded with the main action, then mode selection, then the handoff to attach_sharepoint_document. The trailing 'like list_sharepoint_sites' is minor filler but otherwise every sentence earns its place.

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?

With no output schema, the description still conveys enough structure to act on: items carry driveItemId, non-default libraries carry driveId, and pagination via cursor from a prior call. A brief note on what a page contains (folders vs files) would make it complete.

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 already 100%, but the description adds real meaning beyond it: driveId omission semantics, folderId as a driveItemId, search as an alternative to folder listing, and the composite (driveItemId + driveId) needed downstream. It adds semantic links the schema does not.

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?

Specific verb and resource ('List the files and folders in a SharePoint site's document library'), scoped to what the authorized user sees. It is clearly separable from list_sharepoint_sites (sites, not files) and list_libraries (the internal document library list), both of which appear as siblings.

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

Usage Guidelines5/5

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

Explicit routing rules: omit driveId for the default library, pass folderId to open a folder, pass search to find by name or content, and it names attach_sharepoint_document as the downstream consumer of driveItemId. An agent can decide among these modes without inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.