Skip to main content
Glama

listFolderContents

Lists files and subfolders in a Google Drive folder, with optional recursive traversal and pagination for large directories. Use 'root' to browse the top level.

Instructions

Lists files and subfolders within a Drive folder. Use folderId='root' to browse the top-level of the Drive. With depth omitted or 1, returns a single {folders, files, truncated, truncationReason?} page capped by maxResults; truncated reports when Drive has more pages. With depth 2 through 10 or 'all', returns a flat breadth-first {entries, count, truncated, truncationReason?, unreadable, apiCalls} tree; each entry has path and parentIds. A node is listed once, using its first-discovered BFS path, while parentIds preserves multiple discovered parent edges. Shortcuts include shortcutDetails.targetId but are never expanded. Recursive calls cap output with maxItems (default 500, maximum 5000), report every truncation, and use maxResults only for the single depth-1 page. Use getFilePath for the inverse, upward path lookup.

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": {
      "folderId": "<folderId>"
    },
    "name": "listFolderContents"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoHow many levels to list: 1 (default) through 10, or 'all'.
folderIdYesID of the folder to list contents of. Use "root" for the root Drive folder.
maxItemsNoHard cap across a recursive traversal. Defaults to 500; only valid when depth is greater than 1.
maxResultsNoMaximum number of items to return at depth 1. Ignored for recursive traversal.
includeFilesNoWhether to include files in results.
includeSubfoldersNoWhether to include subfolders in results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A4.3/5.0
Behavior5/5

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

No annotations exist, so the description carries the full disclosure burden and does so in depth: exact return shapes per mode, truncation flags and reasons, dedupe semantics (first-discovered BFS path with parentIds preserving multiple edges), non-expanded shortcuts, and the 500/5000 caps. Missing only auth/permission expectations and error behavior for invalid or unreadable folders.

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?

Front-loaded with the primary purpose and the root affordance, then ordered by mode: single-page behavior, recursive behavior, then edge cases. It is dense but nearly every clause conveys a distinct rule; a slight tightening of the truncation/maxItems sentences would remove the only 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?

For a six-parameter tool with no output schema, the description fills the biggest gap by fully describing both return shapes and truncation fields. The remaining holes are operational rather than structural: permission requirements, error cases, and how 'unreadable' folders are decided are left unexplained.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter including depth ranges, maxResults limits, and the maxItems/depth-1 restriction. The description reinforces the interaction between depth, maxResults, and maxItems but adds little semantic detail the schema does not already provide; baseline 3 applies.

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?

Opens with a specific verb+resource ('Lists files and subfolders within a Drive folder') and immediately clarifies scope with the 'root' special case. It further distinguishes the two operating modes (single page vs. recursive BFS tree) and names the sibling that performs the inverse operation, so an agent can separate it from getFilePath and the other list* tools.

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?

Clear conditional guidance: depth omitted/1 means single page, depth 2-10 or 'all' means flat recursive tree, and getFilePath is named for the inverse upward lookup. It stops short of explicitly excluding the other listing siblings (listDriveFiles, listSharedDrives, listSharedWithMe), so the agent must infer when this tool beats those alternatives.

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