Search and list files
search_filesLocate Google Drive files and folders by name, text, type, or parent folder, and get metadata like size, owner, and links. Filter with raw Drive queries and paginate results.
Instructions
Searches and lists files and folders: id, name, mimeType, size, parents, driveId, modifiedTime, trashed, starred, webViewLink and shortcutDetails per file, plus nextPageToken. The convenience filters (name_contains, full_text_contains, mime_type, parent_id, only_folders) are AND-ed together and with the raw Drive query expression (q syntax, e.g. "modifiedTime > '2026-01-01T00:00:00'"). Trashed files are hidden unless include_trashed=true. Names are NOT unique in Drive — expect several hits and pick by id. parent_id lists a folder's direct children (use 'root' for My Drive's top level). Shared drives: pass drive_id to search one drive, or include_all_drives=true to search everything at once. Paginate with page_token; order_by e.g. 'modifiedTime desc,name'. incompleteSearch=true in the result means some corpora were skipped — narrow the search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Raw Drive search expression (q syntax), AND-ed with the other filters, e.g. "modifiedTime > '2026-01-01T00:00:00' and not name contains 'draft'". | |
| drive_id | No | Search only this shared drive. | |
| order_by | No | Sort keys: createdTime, folder, modifiedTime, name, quotaBytesUsed, recency, starred; add ' desc' to reverse, e.g. 'modifiedTime desc,name'. | |
| mime_type | No | Exact mimeType, e.g. application/pdf, application/vnd.google-apps.document (Google Doc), application/vnd.google-apps.spreadsheet (Google Sheet). | |
| page_size | No | Files per page (1..1000; API default 100). | |
| parent_id | No | Only direct children of this folder ('root' = My Drive top level). | |
| page_token | No | nextPageToken from the previous page. | |
| only_folders | No | Only folders (mimeType application/vnd.google-apps.folder). | |
| name_contains | No | Substring match on the file name (case-insensitive prefix matching per word). | |
| include_trashed | No | Include trashed files (default false — the trash is a separate view, as in the Drive UI). | |
| full_text_contains | No | Full-text match over the file's content and description. | |
| include_all_drives | No | Search My Drive and every shared drive together (slower; ignored when drive_id is set). |