Skip to main content
Glama

Drive List Files

drive_list_files
Read-onlyIdempotent

Search and list Google Drive files by folder, kind, modification time, full text, or raw Drive query, combining filters with AND and returning paginated results.

Instructions

Search or list Drive files in My Drive, shared with the user and in shared drives, by folder, kind, modification time, full text or a raw Drive query, all combined with AND. For a quick name lookup across Drive, contacts and Gmail at once use search_workspace, and for one known file use drive_get_file. Returns files (id, name, kind, mime_type, modified_at, parent_ids, owners, web_url, trashed, can_edit), count and next_page_token for the next page; trashed files are included unless the query says trashed = false.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "drive_list_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoOnly files of this kind, the same values as each result's kind: folder, document (Google Doc), spreadsheet (Google Sheet), presentation (Google Slides), form (Google Form), or image, video or audio (any stored file of that media type).
queryNoRaw Drive search query in Drive's q syntax, terms joined with and/or, e.g. "name contains 'budget' and trashed = false" or "starred = true"; combined by AND with folder_id, kind, modified_after and full_text when those are given. Omit it and every filter to list every file the user can access, trashed files included.
drive_idNoShared drive ID from drive_list_drives: search only that shared drive. Omit to search My Drive, files shared with the user and every shared drive they belong to.
order_byNoComma-separated sort keys, each optionally followed by ' desc': createdTime, folder, modifiedByMeTime, modifiedTime, name, name_natural, quotaBytesUsed, recency, sharedWithMeTime, starred, viewedByMeTime; e.g. 'folder,modifiedTime desc'. Omit for Google's default order.
folder_idNoOnly the direct children of this folder (not files in its subfolders); a folder ID from drive_list_files with kind 'folder', or a shared drive ID for its top level.
full_textNoOnly files whose name, description or content contains these words (Drive's fullText search); quotes in the text are escaped for you.
page_sizeNoFiles per page; next_page_token continues the list.
page_tokenNoThe next_page_token from the previous response of this same call; omit for the first page.
modified_afterNoOnly files last modified after this time: RFC3339 such as '2026-11-01T09:00:00-03:00', or a date such as '2026-11-01' (midnight); a date or a time without an offset is read in the account time zone.

Output Schema

NameRequiredDescriptionDefault
countNoNumber of items in this response.
filesNoFiles on this page.
has_moreNoWhether another page is available.
fetched_atNoRFC3339 time when this response was fetched.
next_page_tokenNoOpaque token for the next page, or null.
account_timezoneNoIANA time zone of every time in this result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.2.0
    • changedInput schema / properties / page_size / description
      Previous value: -"Files per page, 1 to 1000."New value: +"Files per page; next_page_token continues the list."
    • addedInput schema / properties / page_size / maximum
      Added value: +1000
    • addedInput schema / properties / page_size / minimum
      Added value: +1
    • addedOutput schema / properties / account_timezone / description
      Added value: +"IANA time zone of every time in this result."
    • addedOutput schema / properties / files / description
      Added value: +"Files on this page."
    • addedOutput schema / properties / files / items / description
      Added value: +"Drive file metadata; a field Google did not return is null."
    • addedOutput schema / properties / files / items / properties
      Added value: +{
      +  "can_download": {
      +    "description": "Whether the user can download it.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "can_edit": {
      +    "description": "Whether the user can edit it.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "created_at": {
      +    "description": "Creation time in the account time zone.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "description": {
      +    "description": "File description.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "drive_id": {
      +    "description": "Shared drive ID, null in My Drive.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "id": {
      +    "description": "File ID.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "kind": {
      +    "description": "folder, document, spreadsheet, presentation, form, image, video, audio or file.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "last_modified_by": {
      +    "description": "Person who last modified the file.",
      +    "type": [
      +      "object",
      +      "null"
      +    ]
      +  },
      +  "mime_type": {
      +    "description": "MIME type.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "modified_at": {
      +    "description": "Last modification time in the account time zone.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "name": {
      +    "description": "File name.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "owned_by_me": {
      +    "description": "Whether the user owns it.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "owners": {
      +    "description": "Owners (name, email); null for shared-drive files.",
      +    "items": {},
      +    "type": [
      +      "array",
      +      "null"
      +    ]
      +  },
      +  "parent_ids": {
      +    "description": "Parent folder IDs.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": [
      +      "array",
      +      "null"
      +    ]
      +  },
      +  "shared": {
      +    "description": "Whether the file is shared.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "size": {
      +    "description": "Size in bytes as Google sends it (a string); null for Google-native files.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "size_bytes": {
      +    "description": "Size in bytes as a number.",
      +    "type": [
      +      "integer",
      +      "null"
      +    ]
      +  },
      +  "starred": {
      +    "description": "Whether the user starred it.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "trashed": {
      +    "description": "Whether the file is in the trash.",
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  },
      +  "web_url": {
      +    "description": "Link that opens the file in Drive.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  }
      +}
    • addedOutput schema / properties / files / items / type
      Added value: +"object"
  2. Addedv2.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so safety is covered. The description still adds non-obvious behavior beyond that: trashed files are included by default unless the query says trashed = false, and pagination continues via next_page_token. Listing the return fields is partly redundant with the existing output schema, which keeps it from a 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?

Three sentences, front-loaded with purpose and scope, then routing to alternatives, then return shape and the trashed caveat. Structure is efficient, though the parenthetical field list of nine return values is the one segment that largely duplicates structured data and could be trimmed.

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

Completeness5/5

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

For a nine-parameter, zero-required search tool with full schema coverage, annotations and an output schema, the description supplies everything an agent needs: what is searched, how filters compose, default trashed behavior, and how to page. Nothing material is missing.

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 all nine parameters are already documented in detail, including the q syntax, order_by keys, RFC3339 date handling and page_size bounds. The description only restates that filters combine with AND and the trashed default, both of which the query parameter description already covers, so it adds little beyond the schema baseline.

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 opens with a specific verb and resource ("Search or list Drive files") and immediately bounds the scope to My Drive, files shared with the user, and shared drives. It enumerates the filter axes (folder, kind, modification time, full text, raw query) and names the two siblings it is not, so an agent can distinguish it from drive_get_file and search_workspace without opening any 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?

Explicit routing is given for both alternatives: search_workspace for a cross-product name lookup and drive_get_file for one known file. The multi-filter AND semantics and the "omit everything to list all accessible files" case also tell the agent when this tool is the right general-purpose choice.

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