# Google Drive

Google Drive is a cloud storage solution for uploading, sharing, and collaborating on files across devices, with robust search and offline access

- **Category:** file management & storage
- **Auth:** OAUTH2
- **Tools:** 59
- **Triggers:** 7
- **Slug:** `GOOGLEDRIVE`
- **Version:** 20260217_00

## Frequently Asked Questions

### How do I set up custom Google OAuth credentials for Google Drive?

For a step-by-step guide on creating and configuring your own Google OAuth credentials with Devcaster, see [How to create OAuth2 credentials for Google Apps](https://devcaster.dev/auth/googleapps).

### Why am I seeing "App is blocked" when connecting Google Drive?

The OAuth client is requesting scopes that Google hasn't verified for that client. This usually happens when you add extra scopes beyond the defaults.

Remove the additional scopes from your auth config, or create your own OAuth app and submit the scopes for verification. See [How to create OAuth2 credentials for Google Apps](https://devcaster.dev/auth/googleapps).

### Why am I getting "Google Drive API has not been used in project" error?

When using custom OAuth credentials, the Google Drive API must be enabled in the Google Cloud project that owns those credentials. Enable it in Google Cloud Console under APIs & Services, wait a few minutes, and retry.

### Why am I getting "Error 400: invalid_scope"?

The requested scopes are invalid or incorrectly formatted in the authorization URL. Verify your scope values against the [Google OAuth scopes docs](https://developers.google.com/identity/protocols/oauth2). If you're creating auth configs programmatically, see the [programmatic auth config guide](/docs/auth-configuration/programmatic-auth-configs).

### Why does the OAuth consent screen show "Devcaster" instead of my app?

By default, the consent screen uses Devcaster's OAuth app. To show your own app name and logo, create your own OAuth app and set a custom redirect URL. See [White-labeling the OAuth consent screen](/docs/auth-configuration/custom-auth-configs#white-labeling-the-oauth-consent-screen).

### Why am I getting 401 errors on tool calls?

The user's access token is no longer valid. Common causes: the user revoked access, changed their password or 2FA, a Workspace admin policy changed, or Google's refresh token limit (~50 per account) was exceeded. Re-authenticating the user typically resolves this.

---

## Tools

### Add file sharing preference

**Slug:** `GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE`

Modifies sharing permissions for an existing Google Drive file, granting a specified role to a user, group, domain, or 'anyone'.

### Add Shared Drive Member

**Slug:** `GOOGLEDRIVE_ADD_SHARED_DRIVE_MEMBER`

Tool to add a member (user/group/domain) to a Shared Drive with a specified role. Use when you need to grant access to a Shared Drive, ensuring supportsAllDrives is set correctly.

### Copy file

**Slug:** `GOOGLEDRIVE_COPY_FILE`

Duplicates an existing file in Google Drive, identified by its `file_id`.

### Create Comment

**Slug:** `GOOGLEDRIVE_CREATE_COMMENT`

Tool to create a comment on a file. Use when you need to add a new comment to a specific file in Google Drive.

### Create Shared Drive

**Slug:** `GOOGLEDRIVE_CREATE_DRIVE`

Tool to create a new shared drive. Use when you need to programmatically create a new shared drive for collaboration or storage.

### Create File or Folder

**Slug:** `GOOGLEDRIVE_CREATE_FILE`

Creates a new file or folder with metadata. Use to create empty files or folders, or files with content by providing it in the request body (though this action primarily focuses on metadata creation).

### Create a File from Text

**Slug:** `GOOGLEDRIVE_CREATE_FILE_FROM_TEXT`

Creates a new file in Google Drive from provided text content (up to 10MB), supporting various formats including automatic conversion to Google Workspace types.

### Create a folder

**Slug:** `GOOGLEDRIVE_CREATE_FOLDER`

Creates a new folder in Google Drive, optionally within an EXISTING parent folder specified by its ID or name. The parent folder MUST already exist - use GOOGLEDRIVE_FIND_FOLDER first to verify the parent exists or find its ID.

### Create Reply

**Slug:** `GOOGLEDRIVE_CREATE_REPLY`

Tool to create a reply to a comment in Google Drive. Use when you need to respond to an existing comment on a file.

### Create Shortcut to File/Folder

**Slug:** `GOOGLEDRIVE_CREATE_SHORTCUT_TO_FILE`

Tool to create a shortcut to a file or folder in Google Drive. Use when you need to link to an existing Drive item from another location without duplicating it.

### Delete Comment

**Slug:** `GOOGLEDRIVE_DELETE_COMMENT`

Deletes a comment from a file. Use when you need to remove a specific comment from a Google Drive file.

### Delete Shared Drive

**Slug:** `GOOGLEDRIVE_DELETE_DRIVE`

Tool to permanently delete a shared drive. Use when you need to remove a shared drive and its contents (if specified).

### Delete Permission

**Slug:** `GOOGLEDRIVE_DELETE_PERMISSION`

Deletes a permission from a file by permission ID. IMPORTANT: You must first call GOOGLEDRIVE_LIST_PERMISSIONS to get valid permission IDs. Use when you need to revoke access for a specific user or group from a file.

### Delete Reply

**Slug:** `GOOGLEDRIVE_DELETE_REPLY`

Tool to delete a specific reply by reply ID. Use when you need to remove a reply from a comment on a file.

### Download a file from Google Drive

**Slug:** `GOOGLEDRIVE_DOWNLOAD_FILE`

Downloads a file from Google Drive by its ID. For Google Workspace documents (Docs, Sheets, Slides), optionally exports to a specified `mime_type`. For other file types, downloads in their native format regardless of mime_type. Examples: Export a Google Doc to plain text: {"file_id": "1N2o5xQWmAbCdEfGhIJKlmnOPq", "mime_type": "text/plain"} Download a Google Sheet as CSV: {"file_id": "1ZyXwVuTsRqPoNmLkJiHgFeDcB", "mime_type": "text/csv"}

### Download file via operation

**Slug:** `GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION`

Tool to download file content using long-running operations. Use when you need to download Google Vids files or export Google Workspace documents as part of a long-running operation. Operations are valid for 24 hours from creation.

### Edit File

**Slug:** `GOOGLEDRIVE_EDIT_FILE`

Updates an existing Google Drive file with binary content by overwriting its entire content with new text (max 10MB). IMPORTANT: This action only works with files that have binary content (text files, PDFs, images, etc.). It does NOT support editing Google Workspace native files (Google Docs, Sheets, Slides, etc.). For Google Workspace files, use the Google Docs API, Google Sheets API, or Google Slides API directly.

### Empty Trash

**Slug:** `GOOGLEDRIVE_EMPTY_TRASH`

Tool to permanently delete all of the user's trashed files. Use when you want to empty the trash in Google Drive. This action allows you to permanently remove all files that are currently in the trash of Google Drive. It can be applied to files in both the user's root trash and shared drives, ensuring a complete removal of unwanted files.

### Modify File Labels

**Slug:** `GOOGLEDRIVE_FILES_MODIFY_LABELS`

Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified. Use when you need to programmatically change labels on a Google Drive file, such as adding, updating, or removing them.

### Find file

**Slug:** `GOOGLEDRIVE_FIND_FILE`

The comprehensive Google Drive search tool that handles all file and folder discovery needs. Use this for any file finding task - from simple name searches to complex queries with date filters, MIME types, permissions, custom properties, folder scoping, and more. Searches across My Drive and shared drives with full metadata support. Examples: - Find PDFs: q="mimeType = 'application/pdf'" - Find recent files: q="modifiedTime > '2024-01-01T00:00:00'" - Search by name: q="name contains 'report'" - Files in folder: folderId="abc123" or q="'FOLDER_ID' in parents"

### Find folder

**Slug:** `GOOGLEDRIVE_FIND_FOLDER`

Tool to find a folder in Google Drive by its name and optionally a parent folder. Use when you need to locate a specific folder to perform further actions like creating files in it or listing its contents.

### Generate File IDs

**Slug:** `GOOGLEDRIVE_GENERATE_IDS`

Generates a set of file IDs which can be provided in create or copy requests. Use when you need to pre-allocate IDs for new files or copies.

### Get about

**Slug:** `GOOGLEDRIVE_GET_ABOUT`

Tool to retrieve information about the user, the user's Drive, and system capabilities. Use when you need to check storage quotas, user details, or supported import/export formats.

### Get Changes Start Page Token

**Slug:** `GOOGLEDRIVE_GET_CHANGES_START_PAGE_TOKEN`

Tool to get the starting pageToken for listing future changes in Google Drive. Use this when you need to track changes to files and folders.

### Get Comment

**Slug:** `GOOGLEDRIVE_GET_COMMENT`

Tool to get a comment by ID. Use when you need to retrieve a specific comment from a Google Drive file and have both the file ID and comment ID.

### Get Shared Drive

**Slug:** `GOOGLEDRIVE_GET_DRIVE`

Tool to get a shared drive by ID. Use when you need to retrieve information about a specific shared drive.

### Get File Metadata

**Slug:** `GOOGLEDRIVE_GET_FILE_METADATA`

Tool to get a file's metadata by ID. Use when you need to retrieve the metadata for a specific file in Google Drive.

### Get Permission

**Slug:** `GOOGLEDRIVE_GET_PERMISSION`

Gets a permission by ID. Use this tool to retrieve a specific permission for a file or shared drive.

### Get Reply

**Slug:** `GOOGLEDRIVE_GET_REPLY`

Tool to get a specific reply to a comment on a file. Use when you need to retrieve the details of a particular reply.

### Get Revision

**Slug:** `GOOGLEDRIVE_GET_REVISION`

Tool to get a specific revision's metadata by revision ID. Use when you need to retrieve information about a particular version of a file.

### Delete folder or file

**Slug:** `GOOGLEDRIVE_GOOGLE_DRIVE_DELETE_FOLDER_OR_FILE_ACTION`

Tool to delete a file or folder in Google Drive. Use when you need to permanently remove a specific file or folder using its ID. Note: This action is irreversible.

### Hide Shared Drive

**Slug:** `GOOGLEDRIVE_HIDE_DRIVE`

Tool to hide a shared drive from the default view. Use when you want to remove a shared drive from the user's main Google Drive interface without deleting it.

### List Access Proposals

**Slug:** `GOOGLEDRIVE_LIST_ACCESS_PROPOSALS`

Tool to list pending access proposals on a file. Use when you need to retrieve access proposals for a specific file. Note: Only approvers can list access proposals; non-approvers will receive a 403 error.

### List Approvals

**Slug:** `GOOGLEDRIVE_LIST_APPROVALS`

Tool to list approvals on a file for workflow-based access control. Use when you need to retrieve all approvals associated with a specific file in Google Drive.

### List Changes

**Slug:** `GOOGLEDRIVE_LIST_CHANGES`

Tool to list the changes for a user or shared drive. Use when you need to track modifications to files and folders, such as creations, deletions, or permission changes. The pageToken is optional - if not provided, the current start page token will be automatically fetched to begin monitoring changes from now. Example usage (continuing with pageToken): ```json { "pageToken": "22633", "pageSize": 100, "includeRemoved": true } ``` Returns changes with timestamps, file IDs, and modification details. Save the `nextPageToken` from the response to continue paginating through changes, or save the `newStartPageToken` to monitor future changes efficiently.

### List Comments

**Slug:** `GOOGLEDRIVE_LIST_COMMENTS`

Tool to list all comments for a file in Google Drive. Use when you need to retrieve comments associated with a specific file.

### List File Labels

**Slug:** `GOOGLEDRIVE_LIST_FILE_LABELS`

Tool to list the labels on a file. Use when you need to retrieve all labels associated with a specific file in Google Drive.

### List Files and Folders

**Slug:** `GOOGLEDRIVE_LIST_FILES`

Tool to list a user's files and folders in Google Drive. Use this to search or browse for files and folders based on various criteria.

### List Permissions

**Slug:** `GOOGLEDRIVE_LIST_PERMISSIONS`

Tool to list a file's permissions. Use when you need to retrieve all permissions associated with a specific file or shared drive.

### List Replies to Comment

**Slug:** `GOOGLEDRIVE_LIST_REPLIES_TO_COMMENT`

Tool to list replies to a comment in Google Drive. Use this when you need to retrieve all replies associated with a specific comment on a file.

### List File Revisions

**Slug:** `GOOGLEDRIVE_LIST_REVISIONS`

Tool to list a file's revisions. Use when you need to retrieve the revision history of a specific file in Google Drive.

### List Shared Drives

**Slug:** `GOOGLEDRIVE_LIST_SHARED_DRIVES`

Tool to list the user's shared drives. Use when you need to get a list of all shared drives accessible to the authenticated user.

### Move File

**Slug:** `GOOGLEDRIVE_MOVE_FILE`

Tool to move a file from one folder to another in Google Drive. Use when you need to reorganize files by changing their parent folder(s).

### Export or download a file

**Slug:** `GOOGLEDRIVE_PARSE_FILE`

DEPRECATED: Exports Google Workspace files (max 10MB) to a specified format using `mime_type`, or downloads other file types; use `GOOGLEDRIVE_DOWNLOAD_FILE` instead.

### Resumable Upload

**Slug:** `GOOGLEDRIVE_RESUMABLE_UPLOAD`

Tool to start and complete a Google Drive resumable upload session. Use when uploading large files that require resumable, chunked uploads.

### Stop Watch Channel

**Slug:** `GOOGLEDRIVE_STOP_WATCH_CHANNEL`

Tool to stop watching resources through a specified channel. Use this when you want to stop receiving notifications for a previously established watch.

### Trash File

**Slug:** `GOOGLEDRIVE_TRASH_FILE`

Tool to move a file or folder to trash (soft delete). Use when you need to delete a file but want to allow recovery via UNTRASH_FILE. This action is distinct from permanent deletion and provides a safer cleanup workflow.

### Unhide Shared Drive

**Slug:** `GOOGLEDRIVE_UNHIDE_DRIVE`

Tool to unhide a shared drive. Use when you need to restore a shared drive to the default view.

### Untrash File

**Slug:** `GOOGLEDRIVE_UNTRASH_FILE`

Tool to restore a file from the trash. Use when you need to recover a deleted file. This action updates the file's metadata to set the 'trashed' property to false.

### Update Comment

**Slug:** `GOOGLEDRIVE_UPDATE_COMMENT`

Tool to update an existing comment on a Google Drive file. Use when you need to change the content of a comment. NOTE: The 'resolved' field is read-only in the Google Drive API. To resolve or reopen a comment, use CREATE_REPLY with action='resolve' or action='reopen'.

### Update Shared Drive

**Slug:** `GOOGLEDRIVE_UPDATE_DRIVE`

Tool to update the metadata for a shared drive. Use when you need to modify properties like the name, theme, background image, or restrictions of a shared drive.

### Update File (Metadata)

**Slug:** `GOOGLEDRIVE_UPDATE_FILE_PUT`

Updates file metadata. Uses PATCH semantics (partial update) as per Google Drive API v3. Use this tool to modify attributes of an existing file like its name, description, or parent folders. Note: This action currently supports metadata updates only. File content updates require multipart/related upload and are not yet implemented.

### Update File Revision Metadata

**Slug:** `GOOGLEDRIVE_UPDATE_FILE_REVISION_METADATA`

Updates ONLY the metadata properties of a specific file revision (keepForever, published, publishAuto, publishedOutsideDomain). IMPORTANT: This action does NOT update file content. To update file content, use EDIT_FILE or UPDATE_FILE_PUT instead. This action requires BOTH file_id AND revision_id parameters. Use LIST_REVISIONS to get available revision IDs for a file. Valid parameters: file_id (required), revision_id (required), keep_forever, published, publish_auto, published_outside_domain. Invalid parameters (use other actions): file_contents, mime_type, content, name - these are NOT supported by this action.

### Update Permission

**Slug:** `GOOGLEDRIVE_UPDATE_PERMISSION`

Tool to update a permission with patch semantics. Use when you need to modify an existing permission for a file or shared drive.

### Update Reply

**Slug:** `GOOGLEDRIVE_UPDATE_REPLY`

Tool to update a reply to a comment on a Google Drive file. Use when you need to modify the content of an existing reply.

### Upload File

**Slug:** `GOOGLEDRIVE_UPLOAD_FILE`

Uploads a file (max 5MB) to Google Drive, moving it to a specified folder if a valid folder ID is provided, otherwise uploads to root.

### Upload File from URL to Drive

**Slug:** `GOOGLEDRIVE_UPLOAD_FROM_URL`

Tool to fetch a file from a provided URL server-side and upload it into Google Drive. Use when you need to reliably persist externally hosted files into Drive without client-side downloads or temporary storage.

### Watch Drive Changes

**Slug:** `GOOGLEDRIVE_WATCH_CHANGES`

Tool to subscribe to changes for a user or shared drive in Google Drive. Use when you need to monitor a Google Drive for modifications and receive notifications at a specified webhook URL.

### Watch File for Changes

**Slug:** `GOOGLEDRIVE_WATCH_FILE`

Tool to subscribe to push notifications for changes to a specific file. Use when you need to monitor a file for modifications and receive real-time notifications at a webhook URL.


## Triggers

### Comment Added (Docs/Sheets/Slides)

**Slug:** `GOOGLEDRIVE_COMMENT_ADDED_TRIGGER`

Triggers when a new comment is added to Google Docs, Sheets, or Slides.

### File Created

**Slug:** `GOOGLEDRIVE_FILE_CREATED_TRIGGER`

Triggers when a new file is created/added in Google Drive.
    This trigger monitors files and fires when new files are detected.

### File Deleted or Trashed

**Slug:** `GOOGLEDRIVE_FILE_DELETED_OR_TRASHED_TRIGGER`

Triggers when a file is moved to trash or permanently deleted in Google Drive.

### File Shared (Permissions Added)

**Slug:** `GOOGLEDRIVE_FILE_SHARED_PERMISSIONS_ADDED`

Triggers when new sharing permissions are granted to a file or folder in Google Drive.

    This trigger monitors the Drive Changes API to detect files that changed and, for those files,
    compares their current permissions against previously seen permissions to identify newly
    added sharing entries.

### File Updated

**Slug:** `GOOGLEDRIVE_FILE_UPDATED_TRIGGER`

Triggers when a file's metadata or content changes in Google Drive.
    Emits file ID, modification timestamp, and editor info.

### Google Drive Changes

**Slug:** `GOOGLEDRIVE_GOOGLE_DRIVE_CHANGES`

Triggers when changes are detected in a Google Drive.

### New File Matching Query

**Slug:** `GOOGLEDRIVE_NEW_FILE_MATCHING_QUERY_TRIGGER`

Triggers when a new Google Drive file matches a provided query.
