VX Agents

OpenAPI Marketplace · Documents & E-signature

Google Drive Files

v1.0.0 · 10 endpoints · 0 connections · shared by vx.ai

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.

MethodPathOperationDescription
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

  1. In the Google Cloud Console (https://console.cloud.google.com) create or pick a project and enable the Google Drive API (APIs & Services > Library).
  2. Configure the OAuth consent screen (Google Auth Platform > Branding / Audience) and add the scopes below under Data Access. drive.readonly is a restricted scope: apps used outside your own Workspace need Google verification; internal or testing apps work right away.
  3. 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.
  4. 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 q query syntax (string values need single quotes) or an unsupported export mimeType.
  • 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 fields on list/get tools to keep responses small, e.g. files(id,name,mimeType,modifiedTime,webViewLink),nextPageToken for listFiles.
  • For shared drives, preset supportsAllDrives=true, and on listFiles includeItemsFromAllDrives=true + corpora=allDrives.

Find and read a document

  1. 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 with and / or; string values use single quotes. Add orderBy=modifiedTime desc and pageSize.
  2. getFile with fields=id,name,mimeType,owners,modifiedTime,webViewLink,size to confirm it is the right file.
  3. exportFile with mimeType: Docs to text/plain (or text/markdown), Sheets to text/csv (first tab only), Slides to text/plain, any of them to application/pdf. Exports are limited to 10 MB.
  4. 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 fileId of a template + name and parents to produce a new document.
  • createFile with name, mimeType: application/vnd.google-apps.folder and optional parents creates a folder (or an empty Doc/Sheet with the matching Google mimeType). It does not upload file content.
  • createComment needs fields=id,content and 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 webViewLink instead.
  • 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

  1. Create a free VX Agents account (sandbox tools included).
  2. Open the marketplace and connect “Google Drive Files” to an agent.
  3. Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.

Related APIs