Google Drive Files
Find and read documents in Google Drive: search files and folders, read metadata, export Google Docs, Sheets and Slides as text, CSV or PDF, read comments, revisions and who has access, copy files, create folders and add comments. Based on the Google Drive API specification.
Connect this API to an AI agent Browse all specs
What you can do with Google Drive Files via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /about |
getAbout | Get the connected user and storage quota (pass fields=user,storageQuota) |
| GET | /files |
listFiles | Search files and folders with a Drive query, e.g. name contains 'invoice' |
| POST | /files |
createFile | Create a folder or an empty file (metadata only) |
| GET | /files/{fileId} |
getFile | Get a file's metadata (name, type, owners, links, modified time) |
| GET | /files/{fileId}/export |
exportFile | Export a Google Doc, Sheet or Slides file as text, CSV or PDF |
| GET | /files/{fileId}/comments |
listComments | List the comments on a file |
| POST | /files/{fileId}/comments |
createComment | Add a comment to a file |
| GET | /files/{fileId}/permissions |
listPermissions | See who has access to a file (read only) |
| GET | /files/{fileId}/revisions |
listRevisions | List a file's revision history |
| POST | /files/{fileId}/copy |
copyFile | Make a copy of a file, e.g. from a template |
Authentication
googleOAuth
OAuth 2.0
Scopes: https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.file
Google OAuth 2.0 (authorization code flow) on behalf of the signed-in user.
How to get a credential
- In the Google Cloud Console (https://console.cloud.google.com) create or pick a project and enable the Google Drive API (APIs & Services > Library).
- Configure the OAuth consent screen (Google Auth Platform > Branding / Audience) and add the scopes below under Data Access.
drive.readonlyis a restricted scope: apps used outside your own Workspace need Google verification; internal or testing apps work right away. - Create an OAuth client ID of type Web application and add the VX Agents redirect URI shown in the credential dialog as an authorized redirect URI.
- Paste the client ID and client secret into the VX Agents credential and connect your Google account; request offline access so the token can refresh.
Permissions used
| Scope | Operations |
|---|---|
https://www.googleapis.com/auth/drive.readonly |
getAbout, listFiles, getFile, exportFile, listComments, listPermissions, listRevisions |
https://www.googleapis.com/auth/drive.file |
createFile (folders/metadata), copyFile (copy is created as an app file), createComment on files the app created or opened |
https://www.googleapis.com/auth/drive (optional) |
createComment on any file the user can comment on |
Common errors
- 401 Unauthorized: the access token expired or was revoked; reconnect the account or refresh the token.
- 403 Forbidden:
insufficientPermissions= missing scope (e.g. commenting on a file with only drive.file);cannotExportFile/exportSizeLimitExceeded= the file is not a Google Workspace file or is over 10 MB to export;accessNotConfigured= enable the Drive API. - 400 Bad Request: invalid
qquery syntax (string values need single quotes) or an unsupported exportmimeType. - 404 Not Found: the file id is wrong or not shared with the connected account.
- 429 / 403 userRateLimitExceeded: back off exponentially and retry.
Store the connected Google account as a VX Agents credential for this spec; never paste tokens into chat.
Usage guide
Setup
- Credential: connect a Google account with OAuth (drive.readonly to search and read, drive.file to create folders, copies and comments).
- Preset
fieldson list/get tools to keep responses small, e.g.files(id,name,mimeType,modifiedTime,webViewLink),nextPageTokenfor listFiles. - For shared drives, preset
supportsAllDrives=true, and on listFilesincludeItemsFromAllDrives=true+corpora=allDrives.
Find and read a document
- listFiles with
q, e.g.name contains 'proposal' and trashed = false,mimeType = 'application/vnd.google-apps.folder','<folderId>' in parents,modifiedTime > '2026-10-01T00:00:00'. Combine withand/or; string values use single quotes. AddorderBy=modifiedTime descandpageSize. - getFile with
fields=id,name,mimeType,owners,modifiedTime,webViewLink,sizeto confirm it is the right file. - exportFile with
mimeType: Docs totext/plain(ortext/markdown), Sheets totext/csv(first tab only), Slides totext/plain, any of them toapplication/pdf. Exports are limited to 10 MB. - Use listComments (
fields=comments(author/displayName,content,resolved)), listRevisions and listPermissions for context. Permissions are read only: this spec cannot share files.
Create and comment
- copyFile with
fileIdof a template +nameandparentsto produce a new document. - createFile with
name,mimeType: application/vnd.google-apps.folderand optionalparentscreates a folder (or an empty Doc/Sheet with the matching Google mimeType). It does not upload file content. - createComment needs
fields=id,contentand body{content: "..."}. Confirm copies, new folders and comments with the user first: comments notify the file's owners and collaborators.
Good to know
- Regular files (PDF, images, .docx) cannot be exported; read their metadata and share the
webViewLinkinstead. - Lists page with
pageToken/nextPageToken(pageSize up to 1000). - Ids are long opaque strings found in file URLs (
/d/<id>/,/folders/<id>). - Delete, trash and sharing changes are intentionally not available.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “Google Drive Files” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.