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

# Google Docs

> Read, create, edit, and manage Google Docs with formatting, tables, and templates via OAuth

The **Google Docs** toolkit lets agents read and edit Google Documents, search Drive for Docs, create documents (including from templates), apply formatting, and insert tables or page breaks. Authentication is **per-user OAuth** — each user connects their own Google account.

Add it on the agent **Toolkits** tab. The first use prompts the user to connect Google if they have not already. Docs shares the Google Workspace OAuth connection with Gmail, Drive, Sheets, Calendar, and related Google toolkits.

## Prerequisites

* A Google account with access to the Docs the agent should use
* An agent you can edit
* Google OAuth configured for your organization (admin)
* Users who will chat with the agent must complete the Google OAuth connect flow when prompted

## Setup

1. Open the agent → **Toolkits** → add **Google Docs**.
2. Optionally enable or disable individual tools in toolkit config.
3. Save the agent. In **Chat**, connect Google when prompted.
4. `@`-mention Docs tools in the personality prompt for document read/write tasks.

## Available tools

| Tool                      | Description                                                                   |
| ------------------------- | ----------------------------------------------------------------------------- |
| **Read Document**         | Reads document content as text, JSON, or markdown (optional max length).      |
| **Search Docs**           | Searches Google Docs via Drive (natural language or Drive query syntax).      |
| **Insert Text**           | Inserts text at a 1-based index position.                                     |
| **Append Text**           | Appends text at the end of the document (optional newline).                   |
| **Delete Range**          | Deletes content between start and end indexes.                                |
| **Apply Text Style**      | Applies bold, italic, underline, strikethrough, font, size, colors, or links. |
| **Apply Paragraph Style** | Applies headings (1–6), alignment, and spacing.                               |
| **Insert Table**          | Inserts a table at an index (`rows` × `columns`).                             |
| **Insert Page Break**     | Inserts a page break at an index.                                             |
| **Create Document**       | Creates a new Doc with optional initial content.                              |
| **Create from Template**  | Copies a template Doc and optionally replaces placeholder text.               |
| **Delete Document**       | Moves a Doc to trash (default) or permanently deletes it.                     |

## Use cases

* Summarize or extract sections from a shared policy or brief
* Draft a new Doc from chat, then append revisions
* Clone a template and fill placeholders for proposals or reports
* Search Drive for Docs by topic before editing

## Tips

* Index positions follow the Google Docs API (**1-based**).
* Search, create, template copy, and delete use **Drive** — the connected user needs Drive access to those files.
* Markdown export is best-effort (headings, lists, bold/italic, links, basic tables).
* Access is limited to what the **connected Google user** can open — not a shared service account unless that account connects.
* For spreadsheets, files, or slides, use [Google Sheets](/agents/toolkits/google-sheets), [Google Drive](/agents/toolkits/google-drive), or [Google Slides](/agents/toolkits/google-slides).

## Troubleshooting

| Symptom                      | What to check                                                                        |
| ---------------------------- | ------------------------------------------------------------------------------------ |
| Google OAuth not connected   | Complete the Google connect prompt; try disconnecting and connecting again           |
| Permission denied on a Doc   | Share the Doc with the connected Google account, or reconnect with the right account |
| Search returns nothing       | Confirm the files are Google Docs the user can access; try a broader query           |
| Insert/delete at wrong place | Recheck 1-based indexes from a fresh **Read Document**                               |
| Template create fails        | Confirm template Doc ID and that the user can copy it in Drive                       |

## Related

* [Google Drive](/agents/toolkits/google-drive)
* [Google Sheets](/agents/toolkits/google-sheets)
* [Google Slides](/agents/toolkits/google-slides)
* [Google Calendar](/agents/toolkits/google-calendar)
* [Toolkits overview](/agents/toolkits/overview)
