Overview
Enable your agents to create, edit, and manage Google Docs documents with text manipulation and formatting. Automate document creation, insert and replace text, manage content ranges, and streamline your document workflows with AI-powered automation.Prerequisites
Before using the Google Docs integration, ensure you have:- A CrewAI AMP account with an active subscription
- A Google account with Google Docs access
- Connected your Google account through the Integrations page
Setting Up Google Docs Integration
1. Connect Your Google Account
- Navigate to CrewAI AMP Integrations
- Find Google Docs in the Authentication Integrations section
- Click Connect and complete the OAuth flow
- Grant the necessary permissions for document access
- Copy your Enterprise Token from Integration Settings
2. Install Required Package
Available Actions
google_docs/create_document
google_docs/create_document
Description: Create a new Google Document.Parameters:
title
(string, optional): The title for the new document.
google_docs/get_document
google_docs/get_document
Description: Get the contents and metadata of a Google Document.Parameters:
documentId
(string, required): The ID of the document to retrieve.includeTabsContent
(boolean, optional): Whether to include tab content. Default isfalse
.suggestionsViewMode
(string, optional): The suggestions view mode to apply to the document. Enum:DEFAULT_FOR_CURRENT_ACCESS
,PREVIEW_SUGGESTIONS_ACCEPTED
,PREVIEW_WITHOUT_SUGGESTIONS
. Default isDEFAULT_FOR_CURRENT_ACCESS
.
google_docs/batch_update
google_docs/batch_update
Description: Apply one or more updates to a Google Document.Parameters:
documentId
(string, required): The ID of the document to update.requests
(array, required): A list of updates to apply to the document. Each item is an object representing a request.writeControl
(object, optional): Provides control over how write requests are executed. ContainsrequiredRevisionId
(string) andtargetRevisionId
(string).
google_docs/insert_text
google_docs/insert_text
Description: Insert text into a Google Document at a specific location.Parameters:
documentId
(string, required): The ID of the document to update.text
(string, required): The text to insert.index
(integer, optional): The zero-based index where to insert the text. Default is1
.
google_docs/replace_text
google_docs/replace_text
Description: Replace all instances of text in a Google Document.Parameters:
documentId
(string, required): The ID of the document to update.containsText
(string, required): The text to find and replace.replaceText
(string, required): The text to replace it with.matchCase
(boolean, optional): Whether the search should respect case. Default isfalse
.
google_docs/delete_content_range
google_docs/delete_content_range
Description: Delete content from a specific range in a Google Document.Parameters:
documentId
(string, required): The ID of the document to update.startIndex
(integer, required): The start index of the range to delete.endIndex
(integer, required): The end index of the range to delete.
google_docs/insert_page_break
google_docs/insert_page_break
Description: Insert a page break at a specific location in a Google Document.Parameters:
documentId
(string, required): The ID of the document to update.index
(integer, optional): The zero-based index where to insert the page break. Default is1
.
google_docs/create_named_range
google_docs/create_named_range
Description: Create a named range in a Google Document.Parameters:
documentId
(string, required): The ID of the document to update.name
(string, required): The name for the named range.startIndex
(integer, required): The start index of the range.endIndex
(integer, required): The end index of the range.
Usage Examples
Basic Google Docs Agent Setup
Text Editing and Content Management
Advanced Document Operations
Troubleshooting
Common Issues
Authentication Errors- Ensure your Google account has the necessary permissions for Google Docs access.
- Verify that the OAuth connection includes all required scopes (
https://www.googleapis.com/auth/documents
).
- Double-check document IDs for correctness.
- Ensure the document exists and is accessible to your account.
- Document IDs can be found in the Google Docs URL.
- When using
insert_text
ordelete_content_range
, ensure index positions are valid. - Remember that Google Docs uses zero-based indexing.
- The document must have content at the specified index positions.
- When using
batch_update
, ensure therequests
array is correctly formatted according to the Google Docs API documentation. - Complex updates require specific JSON structures for each request type.
- For
replace_text
, ensure thecontainsText
parameter exactly matches the text you want to replace. - Use
matchCase
parameter to control case sensitivity.
Getting Help
Need Help?
Contact our support team for assistance with Google Docs integration setup or troubleshooting.