> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive

> Access, search, and manage files and folders in Google Drive

## At a glance

* **Availability**: Enabled by default.
* **Auth**: OAuth 2.0.
* **Connection**: A user authorizes the connection in the provider's consent screen.
* **Scopes**: `https://www.googleapis.com/auth/drive`.

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.

| Variable               | Required | Description                                                                           |
| ---------------------- | -------- | ------------------------------------------------------------------------------------- |
| `GOOGLE_CLIENT_ID`     | Yes      | Google OAuth Client ID [Docs](https://console.cloud.google.com/apis/credentials).     |
| `GOOGLE_CLIENT_SECRET` | Yes      | Google OAuth Client Secret [Docs](https://console.cloud.google.com/apis/credentials). |

## Setup

1. **Create a Google Cloud Project**: Go to the Google Cloud Console and create a new project
2. **Enable the Google Drive API**: Navigate to APIs & Services > Library and enable the Google Drive API
3. **Configure OAuth Consent Screen**: Go to APIs & Services > OAuth consent screen. Set up your app name, user support email, and developer contact. Add scope: drive (full access)
4. **Create OAuth 2.0 Client ID**: Go to APIs & Services > Credentials. Click 'Create Credentials' > 'OAuth client ID'. Choose 'Web application'. Add authorized redirect URI: [http://localhost:3000/api/auth/drive/callback](http://localhost:3000/api/auth/drive/callback) (adjust port/domain for production)
5. **Copy Credentials to .env**: Copy the Client ID and Client Secret to your .env file as GOOGLE\_CLIENT\_ID and GOOGLE\_CLIENT\_SECRET
6. **Test the Integration**: Start your application and navigate to /api/auth/drive to initiate the OAuth flow

* The same Google OAuth credentials work for all Google services (Gmail, Calendar, Sheets, Drive)
* In production, make sure to add your production callback URL to authorized redirect URIs
* The drive scope grants full access to all files; tools like update\_file and delete\_file require it for files not created by this app
* You may need to verify your app if you plan to distribute it publicly

## Tools

| Tool          | Access | Description                                                                                                                      |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| List Files    | Read   | List files and folders in a Google Drive folder or root                                                                          |
| Get File      | Read   | Get metadata and details about a specific file or folder                                                                         |
| Search Files  | Read   | Search for files and folders using queries                                                                                       |
| Create Folder | Write  | Create a new folder in Google Drive                                                                                              |
| Upload File   | Write  | Upload or create a file in Google Drive                                                                                          |
| Update File   | Write  | Rename a file, update its description, or move it to a different folder in Google Drive                                          |
| Delete File   | Write  | Permanently delete a file or folder from Google Drive                                                                            |
| Download File | Read   | Download the content of a binary or text file stored in Google Drive (not Google Docs/Sheets/Slides; use export\_file for those) |
| Export File   | Read   | Export a Google Docs/Sheets/Slides file to another format such as text/plain, text/csv, or application/pdf                       |

## Example prompts

* Help me organize files in Google Drive by creating folders and moving files based on file types or names.
* Search Google Drive for a specific file or document by name, type, or content.
* Create a backup folder structure in Google Drive and organize important files.
