> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/google_drive.md).

# google\_drive

[Google Drive](https://drive.google.com/) is Google's cloud storage and file synchronization service that allows users to store files, synchronize files across devices, and share files with others. As a core component of Google's productivity ecosystem, Google Drive offers robust storage, organization, and collaboration capabilities.

With Google Drive, you can:

* **Store files in the cloud**: Upload and access your files from anywhere with internet access
* **Organize content**: Create folders, use color coding, and implement naming conventions
* **Share and collaborate**: Control access permissions and work simultaneously on files
* **Search efficiently**: Find files quickly with Google's powerful search technology
* **Access across devices**: Use Google Drive on desktop, mobile, and web platforms
* **Integrate with other services**: Connect with Google Docs, Sheets, Slides, and third-party applications

In Agent Forge, the Google Drive integration enables your agents to interact directly with your cloud storage programmatically. This allows for powerful automation scenarios such as file management, content organization, and document workflows. Your agents can upload new files to specific folders, download existing files to process their contents, and list folder contents to navigate your storage structure. This integration bridges the gap between your AI workflows and your document management system, enabling seamless file operations without manual intervention. By connecting Agent Forge with Google Drive, you can automate file-based workflows, manage documents intelligently, and incorporate cloud storage operations into your agent's capabilities.

## Usage Instructions

Integrate Google Drive functionality to manage files and folders. Upload new files, get content from existing files, create new folders, and list contents of folders using OAuth authentication. Supports file operations with custom MIME types and folder organization.

## Tools

### `google_drive_upload`

Upload a file to Google Drive

#### Input

| Parameter        | Type   | Required | Description                                               |
| ---------------- | ------ | -------- | --------------------------------------------------------- |
| `accessToken`    | string | Yes      | The access token for the Google Drive API                 |
| `fileName`       | string | Yes      | The name of the file to upload                            |
| `content`        | string | Yes      | The content of the file to upload                         |
| `mimeType`       | string | No       | The MIME type of the file to upload                       |
| `folderSelector` | string | No       | Select the folder to upload the file to                   |
| `folderId`       | string | No       | The ID of the folder to upload the file to (internal use) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file`    | json | File data   |
| `files`   | json | Files list  |

### `google_drive_create_folder`

Create a new folder in Google Drive

#### Input

| Parameter        | Type   | Required | Description                                      |
| ---------------- | ------ | -------- | ------------------------------------------------ |
| `accessToken`    | string | Yes      | The access token for the Google Drive API        |
| `fileName`       | string | Yes      | Name of the folder to create                     |
| `folderSelector` | string | No       | Select the parent folder to create the folder in |
| `folderId`       | string | No       | ID of the parent folder (internal use)           |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file`    | json | File data   |
| `files`   | json | Files list  |

### `google_drive_list`

List files and folders in Google Drive

#### Input

| Parameter        | Type   | Required | Description                                            |
| ---------------- | ------ | -------- | ------------------------------------------------------ |
| `accessToken`    | string | Yes      | The access token for the Google Drive API              |
| `folderSelector` | string | No       | Select the folder to list files from                   |
| `folderId`       | string | No       | The ID of the folder to list files from (internal use) |
| `query`          | string | No       | A query to filter the files                            |
| `pageSize`       | number | No       | The number of files to return                          |
| `pageToken`      | string | No       | The page token to use for pagination                   |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file`    | json | File data   |
| `files`   | json | Files list  |

## Notes

* Category: `tools`
* Type: `google_drive`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/google_drive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
