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
3. Environment Variable Setup
Agent(apps=[]), you must set the
CREWAI_PLATFORM_INTEGRATION_TOKEN environment variable with your Enterprise
Token..env file:
Available Actions
google_docs/create_document
google_docs/create_document
title(string, optional): The title for the new document.
google_docs/get_document
google_docs/get_document
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
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
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
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
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
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
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.
google_docs/create_document_with_content
google_docs/create_document_with_content
title(string, required): The title for the new document. Appears at the top of the document and in Google Drive.content(string, optional): The text content to insert into the document. Use\nfor new paragraphs.
google_docs/append_text
google_docs/append_text
documentId(string, required): The document ID from create_document response or URL.text(string, required): Text to append at the end of the document. Use\nfor new paragraphs.
google_docs/set_text_bold
google_docs/set_text_bold
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).bold(boolean, required): Settrueto make bold,falseto remove bold.
google_docs/set_text_italic
google_docs/set_text_italic
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).italic(boolean, required): Settrueto make italic,falseto remove italic.
google_docs/set_text_underline
google_docs/set_text_underline
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).underline(boolean, required): Settrueto underline,falseto remove underline.
google_docs/set_text_strikethrough
google_docs/set_text_strikethrough
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).strikethrough(boolean, required): Settrueto add strikethrough,falseto remove.
google_docs/set_font_size
google_docs/set_font_size
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).fontSize(number, required): Font size in points. Common sizes: 10, 11, 12, 14, 16, 18, 24, 36.
google_docs/set_text_color
google_docs/set_text_color
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to format.endIndex(integer, required): End position of text to format (exclusive).red(number, required): Red component (0-1). Example:1for full red.green(number, required): Green component (0-1). Example:0.5for half green.blue(number, required): Blue component (0-1). Example:0for no blue.
google_docs/create_hyperlink
google_docs/create_hyperlink
documentId(string, required): The document ID.startIndex(integer, required): Start position of text to make into a link.endIndex(integer, required): End position of text to make into a link (exclusive).url(string, required): The URL the link should point to. Example:"https://example.com".
google_docs/apply_heading_style
google_docs/apply_heading_style
documentId(string, required): The document ID.startIndex(integer, required): Start position of paragraph(s) to style.endIndex(integer, required): End position of paragraph(s) to style.style(string, required): The style to apply. Enum:NORMAL_TEXT,TITLE,SUBTITLE,HEADING_1,HEADING_2,HEADING_3,HEADING_4,HEADING_5,HEADING_6.
google_docs/set_paragraph_alignment
google_docs/set_paragraph_alignment
documentId(string, required): The document ID.startIndex(integer, required): Start position of paragraph(s) to align.endIndex(integer, required): End position of paragraph(s) to align.alignment(string, required): Text alignment. Enum:START(left),CENTER,END(right),JUSTIFIED.
google_docs/set_line_spacing
google_docs/set_line_spacing
documentId(string, required): The document ID.startIndex(integer, required): Start position of paragraph(s).endIndex(integer, required): End position of paragraph(s).lineSpacing(number, required): Line spacing as percentage.100= single,115= 1.15x,150= 1.5x,200= double.
google_docs/create_paragraph_bullets
google_docs/create_paragraph_bullets
documentId(string, required): The document ID.startIndex(integer, required): Start position of paragraphs to convert to list.endIndex(integer, required): End position of paragraphs to convert to list.bulletPreset(string, required): Bullet/numbering style. Enum:BULLET_DISC_CIRCLE_SQUARE,BULLET_DIAMONDX_ARROW3D_SQUARE,BULLET_CHECKBOX,BULLET_ARROW_DIAMOND_DISC,BULLET_STAR_CIRCLE_SQUARE,NUMBERED_DECIMAL_ALPHA_ROMAN,NUMBERED_DECIMAL_ALPHA_ROMAN_PARENS,NUMBERED_DECIMAL_NESTED,NUMBERED_UPPERALPHA_ALPHA_ROMAN,NUMBERED_UPPERROMAN_UPPERALPHA_DECIMAL.
google_docs/delete_paragraph_bullets
google_docs/delete_paragraph_bullets
documentId(string, required): The document ID.startIndex(integer, required): Start position of list paragraphs.endIndex(integer, required): End position of list paragraphs.
google_docs/insert_table_with_content
google_docs/insert_table_with_content
documentId(string, required): The document ID.rows(integer, required): Number of rows in the table.columns(integer, required): Number of columns in the table.index(integer, optional): Position to insert the table. If not provided, the table is inserted at the end of the document.content(array, required): Table content as a 2D array. Each inner array is a row. Example:[["Year", "Revenue"], ["2023", "$43B"], ["2024", "$45B"]].
google_docs/insert_table_row
google_docs/insert_table_row
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table. Get from get_document.rowIndex(integer, required): Row index (0-based) of reference cell.columnIndex(integer, optional): Column index (0-based) of reference cell. Default is0.insertBelow(boolean, optional): Iftrue, insert below the reference row. Iffalse, insert above. Default istrue.
google_docs/insert_table_column
google_docs/insert_table_column
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table.rowIndex(integer, optional): Row index (0-based) of reference cell. Default is0.columnIndex(integer, required): Column index (0-based) of reference cell.insertRight(boolean, optional): Iftrue, insert to the right. Iffalse, insert to the left. Default istrue.
google_docs/delete_table_row
google_docs/delete_table_row
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table.rowIndex(integer, required): Row index (0-based) to delete.columnIndex(integer, optional): Column index (0-based) of any cell in the row. Default is0.
google_docs/delete_table_column
google_docs/delete_table_column
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table.rowIndex(integer, optional): Row index (0-based) of any cell in the column. Default is0.columnIndex(integer, required): Column index (0-based) to delete.
google_docs/merge_table_cells
google_docs/merge_table_cells
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table.rowIndex(integer, required): Starting row index (0-based) for the merge.columnIndex(integer, required): Starting column index (0-based) for the merge.rowSpan(integer, required): Number of rows to merge.columnSpan(integer, required): Number of columns to merge.
google_docs/unmerge_table_cells
google_docs/unmerge_table_cells
documentId(string, required): The document ID.tableStartIndex(integer, required): The start index of the table.rowIndex(integer, required): Row index (0-based) of the merged cell.columnIndex(integer, required): Column index (0-based) of the merged cell.rowSpan(integer, required): Number of rows the merged cell spans.columnSpan(integer, required): Number of columns the merged cell spans.
google_docs/insert_inline_image
google_docs/insert_inline_image
documentId(string, required): The document ID.uri(string, required): Public URL of the image. Must be accessible without authentication.index(integer, optional): Position to insert the image. If not provided, the image is inserted at the end of the document. Default is1.
google_docs/insert_section_break
google_docs/insert_section_break
documentId(string, required): The document ID.index(integer, required): Position to insert the section break.sectionType(string, required): The type of section break. Enum:CONTINUOUS(stays on same page),NEXT_PAGE(starts a new page).
google_docs/create_header
google_docs/create_header
documentId(string, required): The document ID.type(string, optional): Header type. Enum:DEFAULT. Default isDEFAULT.
google_docs/create_footer
google_docs/create_footer
google_docs/delete_header
google_docs/delete_header
documentId(string, required): The document ID.headerId(string, required): The header ID to delete. Get from get_document response.
google_docs/delete_footer
google_docs/delete_footer
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_textordelete_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 therequestsarray is correctly formatted according to the Google Docs API documentation. - Complex updates require specific JSON structures for each request type.
- For
replace_text, ensure thecontainsTextparameter exactly matches the text you want to replace. - Use
matchCaseparameter to control case sensitivity.
