> 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_docs.md).

# google\_docs

[Google Docs](https://docs.google.com/) is a powerful cloud-based document creation and editing service that allows users to create, edit, and collaborate on documents in real-time. As part of Google's productivity suite, Google Docs offers a versatile platform for text documents with robust formatting, commenting, and sharing capabilities.

With Google Docs, you can:

* **Create and edit documents**: Develop text documents with comprehensive formatting options
* **Collaborate in real-time**: Work simultaneously with multiple users on the same document
* **Track changes**: View revision history and restore previous versions
* **Comment and suggest**: Provide feedback and propose edits without changing the original content
* **Access anywhere**: Use Google Docs across devices with automatic cloud synchronization
* **Work offline**: Continue working without internet connection with changes syncing when back online
* **Integrate with other services**: Connect with Google Drive, Sheets, Slides, and third-party applications

In Agent Forge, the Google Docs integration enables your agents to interact directly with document content programmatically. This allows for powerful automation scenarios such as document creation, content extraction, collaborative editing, and document management. Your agents can read existing documents to extract information, write to documents to update content, and create new documents from scratch. This integration bridges the gap between your AI workflows and document management, enabling seamless interaction with one of the world's most widely used document platforms. By connecting Agent Forge with Google Docs, you can automate document workflows, generate reports, extract insights from documents, and maintain documentation - all through your intelligent agents.

## Usage Instructions

Integrate Google Docs functionality to manage documents. Read content from existing documents, write to documents, and create new documents using OAuth authentication. Supports text content manipulation for document creation and editing.

## Tools

### `google_docs_read`

Read content from a Google Docs document

#### Input

| Parameter     | Type   | Required | Description                              |
| ------------- | ------ | -------- | ---------------------------------------- |
| `accessToken` | string | Yes      | The access token for the Google Docs API |
| `documentId`  | string | Yes      | The ID of the document to read           |

#### Output

| Parameter        | Type    | Description           |
| ---------------- | ------- | --------------------- |
| `content`        | string  | Document content      |
| `metadata`       | json    | Document metadata     |
| `updatedContent` | boolean | Content update status |

### `google_docs_write`

Write or update content in a Google Docs document

#### Input

| Parameter     | Type   | Required | Description                              |
| ------------- | ------ | -------- | ---------------------------------------- |
| `accessToken` | string | Yes      | The access token for the Google Docs API |
| `documentId`  | string | Yes      | The ID of the document to write to       |
| `content`     | string | Yes      | The content to write to the document     |

#### Output

| Parameter        | Type    | Description           |
| ---------------- | ------- | --------------------- |
| `content`        | string  | Document content      |
| `metadata`       | json    | Document metadata     |
| `updatedContent` | boolean | Content update status |

### `google_docs_create`

Create a new Google Docs document

#### Input

| Parameter        | Type   | Required | Description                                                   |
| ---------------- | ------ | -------- | ------------------------------------------------------------- |
| `accessToken`    | string | Yes      | The access token for the Google Docs API                      |
| `title`          | string | Yes      | The title of the document to create                           |
| `content`        | string | No       | The content of the document to create                         |
| `folderSelector` | string | No       | Select the folder to create the document in                   |
| `folderId`       | string | No       | The ID of the folder to create the document in (internal use) |

#### Output

| Parameter        | Type    | Description           |
| ---------------- | ------- | --------------------- |
| `content`        | string  | Document content      |
| `metadata`       | json    | Document metadata     |
| `updatedContent` | boolean | Content update status |

## Notes

* Category: `tools`
* Type: `google_docs`


---

# 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_docs.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.
