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

# Google Docs

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

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

`googledocs` · **43 tools** · **10 triggers**

## Connect it

```bash theme={"theme":"github-dark"}
run auth googledocs
run auth googledocs --scope team    # shared with the organization
```

Or from the [Integrations page](https://app.boxd.sh/integrations) in the console. See [Connections](/guides/integrations/connections) for personal versus shared, and who may remove one.

## Use it

```bash theme={"theme":"github-dark"}
run googledocs          # common commands
run googledocs --all    # every command
```

```ts theme={"theme":"github-dark"}
import { googledocs } from "@boxd/run";
```

## Common tools

| Tool                         | What it does                                                                                                                                                           |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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.                    |
| `create-and-populate-table`  | Creates a new table in a Google Document and populates its cells with provided text data in a single operation.                                                        |
| `create-document2`           | DEPRECATED: Use GOOGLEDOCS\_CREATE\_DOCUMENT instead. Tool to create a blank Google Docs document with a specified title.                                              |
| `create-document-markdown`   | Creates a new Google Docs document, optionally initializing it with a title and content provided as Markdown text.                                                     |
| `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`            | 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`              | Tool to create a new header in a Google Document, optionally with text content.                                                                                        |
| `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`   | Tool to add bullets to paragraphs within a specified range in a Google Document.                                                                                       |
| `create-tab`                 | Creates a new tab in a Google Docs document. Tabs allow you to organize document content into separate sections within a single document.                              |
| `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.       |
| `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`              | Deletes the header from the specified section or the default header if no section is specified.                                                                        |
| `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`   | Tool to remove bullets from paragraphs within a specified range in a Google Document.                                                                                  |
| `delete-tab`                 | Deletes a tab from a Google Document. This action is irreversible - the tab cannot be recovered once removed.                                                          |
| `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`           | 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-document-as-pdf`     | Tool to export a Google Docs file as PDF using the Google Drive API.                                                                                                   |
| `get-document-plaintext`     | Retrieve a Google Doc by ID and return a best-effort plain-text rendering.                                                                                             |
| `insert-image-in-table-cell` | Inserts an image from a given URI into a specific table cell in a Google Document.                                                                                     |
| `insert-inline-image`        | Tool to insert an image from a given URI at a specified location in a Google Document as an inline image.                                                              |
| `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-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...                |
| `insert-table-column`        | Tool to insert a new column into a table in a Google Document.                                                                                                         |

<Accordion title="All 43 tools" icon="list">
  | Tool                               | What it does                                                                                                                                                           |
  | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `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.                    |
  | `create-and-populate-table`        | Creates a new table in a Google Document and populates its cells with provided text data in a single operation.                                                        |
  | `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...                   |
  | `create-document2`                 | DEPRECATED: Use GOOGLEDOCS\_CREATE\_DOCUMENT instead. Tool to create a blank Google Docs document with a specified title.                                              |
  | `create-document-markdown`         | Creates a new Google Docs document, optionally initializing it with a title and content provided as Markdown text.                                                     |
  | `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`                  | 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`                    | Tool to create a new header in a Google Document, optionally with text content.                                                                                        |
  | `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`         | Tool to add bullets to paragraphs within a specified range in a Google Document.                                                                                       |
  | `create-tab`                       | Creates a new tab in a Google Docs document. Tabs allow you to organize document content into separate sections within a single document.                              |
  | `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.       |
  | `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`                    | Deletes the header from the specified section or the default header if no section is specified.                                                                        |
  | `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`         | Tool to remove bullets from paragraphs within a specified range in a Google Document.                                                                                  |
  | `delete-tab`                       | Deletes a tab from a Google Document. This action is irreversible - the tab cannot be recovered once removed.                                                          |
  | `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`                 | 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-document-as-pdf`           | Tool to export a Google Docs file as PDF using the Google Drive API.                                                                                                   |
  | `get-document-by-id`               | Retrieves an existing Google Document by its ID; will error if the document is not found.                                                                              |
  | `get-document-end-index`           | Retrieves the end index and paragraph structure of a Google Document or specific segment.                                                                              |
  | `get-document-plaintext`           | Retrieve a Google Doc by ID and return a best-effort plain-text rendering.                                                                                             |
  | `insert-image-in-table-cell`       | Inserts an image from a given URI into a specific table cell in a Google Document.                                                                                     |
  | `insert-inline-image`              | Tool to insert an image from a given URI at a specified location in a Google Document as an inline image.                                                              |
  | `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-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...                |
  | `insert-table-column`              | Tool to insert a new column into a table in a Google Document.                                                                                                         |
  | `insert-table-row`                 | Inserts a new row into a table in a Google Document at a specified location.                                                                                           |
  | `insert-text-action`               | Tool to insert a string of text at a specified location within a Google Document.                                                                                      |
  | `insert-text-in-table-cell`        | Inserts text into a specific cell of a table in a Google Document by row and column position.                                                                          |
  | `list-spreadsheet-charts`          | Tool to retrieve a list of all charts from a specified Google Sheets spreadsheet.                                                                                      |
  | `replace-all-text`                 | Tool to replace all occurrences of a specified text string with another text string throughout a Google Document.                                                      |
  | `replace-image`                    | Tool to replace a specific image in a document with a new image from a URI.                                                                                            |
  | `search-documents`                 | Search for Google Documents using various filters including name, content, date ranges, and more.                                                                      |
  | `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-batch`            | DEPRECATED: Use UpdateExistingDocument instead. Tool to apply one or more updates to a Google Document.                                                                |
  | `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` | Tool to insert or replace a section of a Google Docs document with Markdown content.                                                                                   |
  | `update-document-style`            | Tool to update the overall document style, such as page size, margins, and default text direction.                                                                     |
  | `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`           | Tool to update the style of a table row in a Google Document.                                                                                                          |
  | `update-tab-properties`            | Updates properties of a document tab such as title, parent tab, index, and icon emoji.                                                                                 |
</Accordion>

## Triggers (10)

Subscribe with `.on(...)` in a script. A trigger with required configuration takes it as the second argument.

| Trigger                       | Needs                                | What fires it                                                                                                    |
| ----------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| New Document Created          | nothing                              | Triggers when a new Google Doc is created.                                                                       |
| Document Deleted              | nothing                              | Triggers when an existing Google Doc is deleted (moved to trash).                                                |
| Document Placeholder Filled   | `document_id`, `placeholder_pattern` | Triggers when a Google Doc's plain text changes such that a configured placeholder                               |
| Document Search Update        | `query`                              | Triggers when a Google Doc matching a user-defined search query is newly created or updated since the last poll. |
| Document Structure Changed    | `document_id`                        | Triggers when a Google Doc's structure changes (headers/footers added/removed, tables/images count changes).     |
| Document Updated              | nothing                              | Triggers when an existing Google Doc is updated or modified.                                                     |
| Document Word Count Threshold | `document_id`                        | Triggers when a Google Doc's word/character count crosses a user-defined threshold.                              |
| New Folder Created in Root    | nothing                              | Triggers when a new folder is created in the root folder of Google Drive.                                        |
| Keyword Detected in Document  | `document_id`, `keyword`             | Triggers when a specific keyword or phrase first appears in a Google Doc.                                        |
| New Document Added            | nothing                              | Triggers when a new Google Doc is added/created.                                                                 |

[Open Google Docs in the console →](https://app.boxd.sh/integrations/detail/googledocs)
