Skip to main content
Glama

list_files

Read-only

Lists files in a Google Drive folder and optionally filters by MIME type, helping users locate documents, spreadsheets, or folders by type.

Instructions

List files in a Google Drive folder, optionally filtered by MIME type.

For a spreadsheet-only listing, list_spreadsheets(folder_id) is a narrower convenience wrapper around this same call pre-filtered to the spreadsheet MIME type.

Args: folder_id: The Google Drive folder ID to list files from. mime_type: Optional MIME type filter. Common values: 'application/vnd.google-apps.document' (Google Docs) 'application/vnd.google-apps.spreadsheet' (Google Sheets) 'application/vnd.google-apps.folder' (folders) max_results: Maximum number of results to return (default 100, max 1000)

Returns: List of files with their ID, name, MIME type, modified time, web link, starred status, and md5_checksum. md5_checksum is only present for binary files — Google Workspace files (Docs, Sheets, Slides, etc.) have no fixed byte content and the Drive API omits the field for them, so it's None for those. Compare it to a local file's md5 to detect real content drift instead of inferring change from modifiedTime alone; sync_folder(use_checksum=True) does that comparison itself (see its docstring for the cases where modifiedTime misleads). Results are cached; call refresh_cache(folder_id=folder_id) to invalidate, or refresh_cache() to clear all caches.

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": {
      "folder_id": "<folder_id>"
    },
    "name": "list_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
folder_idYes
mime_typeNo
max_resultsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true; the description adds real behavior the agent could not otherwise know — results are cached and must be invalidated via refresh_cache, and md5_checksum is None for Google Workspace files because the Drive API omits it. It even warns that modifiedTime alone can mislead, which directly shapes how results should be interpreted.

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?

Well front-loaded: purpose first, then sibling routing, then Args, then Returns. The Returns block runs long for a tool that already has an output schema, and the md5/checksum aside plus the sync_folder cross-reference add bulk, though both carry useful information.

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 3-parameter read tool this is thorough, covering parameters, caching side effects, and output-field nuances. The return-value discussion is partly redundant given an output schema exists, so it is complete but slightly over-served in that section rather than under-served.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: it names the common MIME type values with human-readable mappings, and adds a constraint absent from the schema ('default 100, max 1000'). folder_id's role is also restated unambiguously.

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?

States a specific verb and resource ('List files in a Google Drive folder') plus the scoping constraint ('optionally filtered by MIME type'), and explicitly names the narrower sibling list_spreadsheets so an agent can distinguish the two without opening either schema.

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?

Gives concrete routing: use list_spreadsheets for spreadsheet-only listings (it is the same call pre-filtered), and use sync_folder(use_checksum=True) when the goal is detecting content drift rather than enumerating files. It also tells the agent when to call refresh_cache instead, covering the cache-staleness case.

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