Skip to content

feat(drive): add listDriveFiles and searchDriveFiles tools#99

Merged
a-bonus merged 1 commit intoa-bonus:mainfrom
thehien93:feat/drive-list-search-all-files
Mar 28, 2026
Merged

feat(drive): add listDriveFiles and searchDriveFiles tools#99
a-bonus merged 1 commit intoa-bonus:mainfrom
thehien93:feat/drive-list-search-all-files

Conversation

@thehien93
Copy link
Copy Markdown

Problem

The existing listDocuments and searchDocuments tools only work with Google Docs (application/vnd.google-apps.document). There is no way to list or search Sheets, PDFs, presentations, folders, or other Drive file types from MCP.

Solution

Add two new Drive tools:

listDriveFiles

Lists files across all of Google Drive with:

  • MIME type filter — shortcuts (document, spreadsheet, presentation, folder, form, pdf, zip) or full MIME type strings
  • Folder scope — restrict to a specific folder via folderId
  • Ownership filterownedByMe / sharedWithMe flags
  • Sort controlorderBy (name, modifiedTime, createdTime, quotaBytesUsed) + sortDirection (asc/desc)
  • modifiedAfter date filter

searchDriveFiles

Searches all Drive file types by name or content with:

  • searchIn: name | content | both
  • MIME type filter (same shortcuts as above)
  • Folder subtree scope via 'folderId' in ancestors (recursive, unlike listFolderContents)
  • Sort controlorderBy + sortDirection
  • Pagination — returns nextPageToken + hasMore flag; accepts pageToken for subsequent pages
  • modifiedAfter date filter

Compatibility

Existing tools (listDocuments, searchDocuments, listFolderContents) are unchanged.

Add two new MCP tools for working with all file types in Google Drive,
not just Google Docs:

- `listDriveFiles`: lists files across Drive with optional MIME type
  filter (supports shortcuts like "spreadsheet", "pdf", etc.), folder
  scope (folderId), ownership filter (ownedByMe / sharedWithMe),
  configurable orderBy field, and sort direction (asc/desc).

- `searchDriveFiles`: searches Drive by name or content across all file
  types, with MIME type filtering, folder subtree scoping via the
  `ancestors` Drive query, configurable sort order, and pagination
  support via nextPageToken.

Existing tools (listDocuments, searchDocuments) are unchanged — they
remain the preferred tools for Docs-only workflows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@a-bonus a-bonus merged commit ec9388e into a-bonus:main Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants