# Google Docs

Google Docs is a cloud-based word processor with real-time collaboration, version history, and integration with other Google Workspace apps

- **Category:** documents
- **Auth:** OAUTH2
- **Tools:** 35
- **Triggers:** 4
- **Slug:** `GOOGLEDOCS`
- **Version:** 20260217_00

## Frequently Asked Questions

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

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 Docs?

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 Docs API has not been used in project" error?

When using custom OAuth credentials, the Google Docs 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.

### Why am I getting "Quota Exhausted" or "rate limit exhausted"?

Google enforces per-minute and daily request quotas. If you're using Devcaster's default OAuth app, you share that quota with other users, which can cause limits to be hit faster. Use your own OAuth app credentials to get a dedicated quota, and add exponential backoff and retries to handle transient rate limits.

---

## Tools

### Copy Google Document

**Slug:** `GOOGLEDOCS_COPY_DOCUMENT`

Tool to create a copy of an existing Google Document. Use this to duplicate a document, for example, when using an existing document as a template. The copied document will have a default title (e.g., 'Copy of [original title]') if no new title is provided, and will be placed in the user's root Google Drive folder.

### Create a document

**Slug:** `GOOGLEDOCS_CREATE_DOCUMENT`

Creates a new Google Docs document using the provided title as filename and inserts the initial text at the beginning if non-empty, returning the document's ID and metadata (excluding body content).

### Create Document Markdown

**Slug:** `GOOGLEDOCS_CREATE_DOCUMENT_MARKDOWN`

Creates a new Google Docs document, optionally initializing it with a title and content provided as Markdown text.

### Create Footer

**Slug:** `GOOGLEDOCS_CREATE_FOOTER`

Tool to create a new footer in a Google Document. Use when you need to add a footer, optionally specifying its type and the section it applies to.

### Create Footnote

**Slug:** `GOOGLEDOCS_CREATE_FOOTNOTE`

Tool to create a new footnote in a Google Document. Use this when you need to add a footnote at a specific location or at the end of the document body.

### Create Header

**Slug:** `GOOGLEDOCS_CREATE_HEADER`

Tool to create a new header in a Google Document, optionally with text content. Use this tool when you need to add a header to a document. You can provide: - document_id: The ID of the document (required) - type: The header type (DEFAULT is the standard header) - text: Optional text content to add to the header - section_break_location: Optional location for section-specific headers

### Create Named Range

**Slug:** `GOOGLEDOCS_CREATE_NAMED_RANGE`

Tool to create a new named range in a Google Document. Use this to assign a name to a specific part of the document for easier reference or programmatic manipulation.

### Create Paragraph Bullets

**Slug:** `GOOGLEDOCS_CREATE_PARAGRAPH_BULLETS`

Tool to add bullets to paragraphs within a specified range in a Google Document. Use when you need to format a list or a set of paragraphs as bullet points.

### Delete Content Range in Document

**Slug:** `GOOGLEDOCS_DELETE_CONTENT_RANGE`

Tool to delete a range of content from a Google Document. Use when you need to remove a specific portion of text or other structural elements within a document. Note: Every segment (body, header, footer, footnote) in Google Docs ends with a final newline character that cannot be deleted. Ensure the endIndex does not include this trailing newline.

### Delete Footer

**Slug:** `GOOGLEDOCS_DELETE_FOOTER`

Tool to delete a footer from a Google Document. Use when you need to remove a footer from a specific section or the default footer.

### Delete Header

**Slug:** `GOOGLEDOCS_DELETE_HEADER`

Deletes the header from the specified section or the default header if no section is specified. Use this tool to remove a header from a Google Document.

### Delete Named Range

**Slug:** `GOOGLEDOCS_DELETE_NAMED_RANGE`

Tool to delete a named range from a Google Document. Use when you need to remove a previously defined named range by its ID or name.

### Delete Paragraph Bullets

**Slug:** `GOOGLEDOCS_DELETE_PARAGRAPH_BULLETS`

Tool to remove bullets from paragraphs within a specified range in a Google Document. Use when you need to clear bullet formatting from a section of a document.

### Delete Table

**Slug:** `GOOGLEDOCS_DELETE_TABLE`

Tool to delete an entire table from a Google Document. Use when you have the document ID and the specific start and end index of the table element to be removed. The table's range can be found by inspecting the document's content structure.

### Delete Table Column

**Slug:** `GOOGLEDOCS_DELETE_TABLE_COLUMN`

Tool to delete a column from a table in a Google Document. Use this tool when you need to remove a specific column from an existing table within a document.

### Delete Table Row

**Slug:** `GOOGLEDOCS_DELETE_TABLE_ROW`

Tool to delete a row from a table in a Google Document. Use when you need to remove a specific row from an existing table.

### Export Google Doc as PDF

**Slug:** `GOOGLEDOCS_EXPORT_DOCUMENT_AS_PDF`

Tool to export a Google Docs file as PDF using the Google Drive API. Use when you need to generate a PDF version of a Google Docs document for download or distribution. Note: Google Drive enforces a 10MB limit on export content.

### Get Charts from Spreadsheet

**Slug:** `GOOGLEDOCS_GET_CHARTS_FROM_SPREADSHEET`

Tool to retrieve a list of all charts from a specified Google Sheets spreadsheet. Use when you need to get chart IDs and their specifications for embedding or referencing elsewhere, such as in Google Docs.

### Get document by id

**Slug:** `GOOGLEDOCS_GET_DOCUMENT_BY_ID`

Retrieves an existing Google Document by its ID; will error if the document is not found.

### Get document plain text

**Slug:** `GOOGLEDOCS_GET_DOCUMENT_PLAINTEXT`

Retrieve a Google Doc by ID and return a best-effort plain-text rendering. Converts document structure into plain text including paragraphs, lists, and tables without requiring clients to traverse complex Docs API JSON.

### Insert Inline Image

**Slug:** `GOOGLEDOCS_INSERT_INLINE_IMAGE`

Tool to insert an image from a given URI at a specified location in a Google Document as an inline image. Use when you need to add an image to a document programmatically.

### Insert Page Break

**Slug:** `GOOGLEDOCS_INSERT_PAGE_BREAK`

Tool to insert a page break into a Google Document. Use when you need to start new content on a fresh page, such as at the end of a chapter or section.

### Insert Table in Google Doc

**Slug:** `GOOGLEDOCS_INSERT_TABLE_ACTION`

Tool to insert a table into a Google Document. Use when you need to add a new table at a specific location or at the end of a segment (like document body, header, or footer) in a document.

### Insert Table Column

**Slug:** `GOOGLEDOCS_INSERT_TABLE_COLUMN`

Tool to insert a new column into a table in a Google Document. Use this tool when you need to add a column to an existing table at a specific location.

### Insert Text into Document

**Slug:** `GOOGLEDOCS_INSERT_TEXT_ACTION`

Tool to insert a string of text at a specified location within a Google Document. Use when you need to add new text content to an existing document. IMPORTANT: Two ways to specify insertion location: 1. Use 'insertion_index' to insert at a specific position (index 1 is safe for document start) 2. Use 'append_to_end=true' to append text to the end of the document (recommended for appending) CRITICAL CONSTRAINT: When using insertion_index, the index MUST fall within the bounds of an EXISTING paragraph. You cannot insert text at arbitrary indices or at structural boundaries (e.g., table starts). The index must also be strictly less than the document's end index. To safely append text without index concerns, use append_to_end=true.

### List Charts from Spreadsheet

**Slug:** `GOOGLEDOCS_LIST_SPREADSHEET_CHARTS_ACTION`

Tool to retrieve a list of charts with their IDs and metadata from a Google Sheets spreadsheet. Use to identify charts available for embedding into Google Docs.

### Replace All Text in Document

**Slug:** `GOOGLEDOCS_REPLACE_ALL_TEXT`

Tool to replace all occurrences of a specified text string with another text string throughout a Google Document. Use when you need to perform a global find and replace operation within a document.

### Replace Image in Document

**Slug:** `GOOGLEDOCS_REPLACE_IMAGE`

Tool to replace a specific image in a document with a new image from a URI. Use when you need to update an existing image within a Google Doc.

### Search Documents

**Slug:** `GOOGLEDOCS_SEARCH_DOCUMENTS`

Search for Google Documents using various filters including name, content, date ranges, and more.

### Unmerge Table Cells

**Slug:** `GOOGLEDOCS_UNMERGE_TABLE_CELLS`

Tool to unmerge previously merged cells in a table. Use this when you need to revert merged cells in a Google Document table back to their individual cell states.

### Update Document Markdown

**Slug:** `GOOGLEDOCS_UPDATE_DOCUMENT_MARKDOWN`

Replaces the entire content of an existing Google Docs document with new Markdown text; requires edit permissions for the document.

### Update Document Section Markdown

**Slug:** `GOOGLEDOCS_UPDATE_DOCUMENT_SECTION_MARKDOWN`

Tool to insert or replace a section of a Google Docs document with Markdown content. Use when you need to update only a section of a document by specifying start and optional end indices. Supports full Markdown formatting.

### Update Document Style

**Slug:** `GOOGLEDOCS_UPDATE_DOCUMENT_STYLE`

Tool to update the overall document style, such as page size, margins, and default text direction. Use when you need to modify the global style settings of a Google Document.

### Update existing document

**Slug:** `GOOGLEDOCS_UPDATE_EXISTING_DOCUMENT`

Applies programmatic edits, such as text insertion, deletion, or formatting, to a specified Google Doc using the `batchUpdate` API method.

### Update Table Row Style

**Slug:** `GOOGLEDOCS_UPDATE_TABLE_ROW_STYLE`

Tool to update the style of a table row in a Google Document. Use when you need to modify the appearance of specific rows within a table, such as setting minimum row height or marking rows as headers.


## Triggers

### Document Deleted

**Slug:** `GOOGLEDOCS_DOCUMENT_DELETED_TRIGGER`

Triggers when an existing Google Doc is deleted (moved to trash).
    This trigger monitors Google Docs and fires when documents are trashed.

### Document Updated

**Slug:** `GOOGLEDOCS_DOCUMENT_UPDATED_TRIGGER`

Triggers when an existing Google Doc is updated or modified.
    This trigger monitors Google Docs and fires when documents are updated.

### New Folder Created in Root

**Slug:** `GOOGLEDOCS_FOLDER_CREATED_TRIGGER`

Triggers when a new folder is created in the root folder of Google Drive.
    This trigger monitors Google Drive and fires when new folders are detected in the root directory.

### New Document Added

**Slug:** `GOOGLEDOCS_PAGE_ADDED_TRIGGER`

Triggers when a new Google Doc is added/created.
    This trigger monitors Google Docs and fires when new documents are detected.
