Google Docs MCP Server for Cloudflare Workers
Test Google Docs tools directly in your browser. Select a tool and provide inputs to see the results.
Create a free account to test Google Docs tools interactively. No credit card required.
googledocs_createCreate a new Google Docs document. Args: - title: The title for the new document Returns: The created document with its ID and metadata.
googledocs_getGet a Google Docs document by ID. Args: - documentId: The document ID Returns: The full document with all content, styles, and metadata.
googledocs_insert_textInsert text at a specific position in the document. Document indices are 1-based. The content starts at index 1. Args: - documentId: The document ID - text: The text to insert - index: The position to insert at (1-based) Returns: Confirmation of the insert operation.
googledocs_delete_contentDelete content within a range in the document. Args: - documentId: The document ID - startIndex: Start position of the range to delete (inclusive) - endIndex: End position of the range to delete (exclusive) Returns: Confirmation of the delete operation.
googledocs_replace_textReplace all occurrences of text in the document. Args: - documentId: The document ID - findText: The text to find - replaceText: The replacement text - matchCase: Whether to match case (default: false) Returns: Number of occurrences replaced.
googledocs_append_textAppend text to the end of the document. Args: - documentId: The document ID - text: The text to append Returns: Confirmation of the append operation.
googledocs_insert_page_breakInsert a page break at a specific position. Args: - documentId: The document ID - index: Position to insert the page break Returns: Confirmation of the page break insertion.
googledocs_insert_section_breakInsert a section break at a specific position. Args: - documentId: The document ID - index: Position to insert the section break - sectionType: Type of section break (CONTINUOUS or NEXT_PAGE) Returns: Confirmation of the section break insertion.
googledocs_batch_updateApply multiple updates to a document in a single request. This is the most flexible tool for complex document modifications. It accepts an array of request objects that can include any combination of operations. Args: - documentId: The document ID - requests: Array of request objects (insertText, deleteContentRange, updateTextStyle, etc.) Request Types: - insertText: { text, location: { index } } - deleteContentRange: { range: { startIndex, endIndex } } - replaceAllText: { containsText: { text, matchCase }, replaceText } - updateTextStyle: { range, textStyle, fields } - updateParagraphStyle: { range, paragraphStyle, fields } - createParagraphBullets: { range, bulletPreset } - deleteParagraphBullets: { range } - insertTable: { rows, columns, location: { index } } - insertTableRow: { tableCellLocation, insertBelow } - insertTableColumn: { tableCellLocation, insertRight } - deleteTableRow: { tableCellLocation } - deleteTableColumn: { tableCellLocation } - insertInlineImage: { uri, location, objectSize } - createHeader: { type, sectionBreakLocation } - createFooter: { type, sectionBreakLocation } - createFootnote: { location } - createNamedRange: { name, range } - deleteNamedRange: { namedRangeId or name } - insertPageBreak: { location } - insertSectionBreak: { location, sectionType } - updateDocumentStyle: { documentStyle, fields } - And more... Returns: Batch update response with document ID and any replies from operations.
googledocs_format_textApply basic formatting to a text range. This is a simplified formatting tool for common text styles like bold, italic, underline. For more advanced styling, use googledocs_update_text_style. Args: - documentId: The document ID - startIndex: Start of the text range - endIndex: End of the text range - bold: Whether to make text bold - italic: Whether to make text italic - underline: Whether to underline text - strikethrough: Whether to strikethrough text - fontSize: Font size in points (e.g., 12) - fontFamily: Font family name (e.g., "Arial", "Times New Roman") Returns: Confirmation of the formatting operation.
googledocs_update_text_styleApply advanced text styling to a range. This tool provides full control over text styling including colors, links, and baseline offset. Args: - documentId: The document ID - startIndex: Start of the text range - endIndex: End of the text range - textStyle: TextStyle object with styling properties - fields: Comma-separated list of fields to update (e.g., "bold,italic,foregroundColor") TextStyle Properties: - bold, italic, underline, strikethrough, smallCaps (boolean) - fontSize: { magnitude: number, unit: "PT" } - weightedFontFamily: { fontFamily: string, weight?: number } - foregroundColor: { color: { rgbColor: { red, green, blue } } } (0-1 values) - backgroundColor: { color: { rgbColor: { red, green, blue } } } - baselineOffset: "NONE" | "SUPERSCRIPT" | "SUBSCRIPT" - link: { url: string } or { bookmarkId: string } or { headingId: string } Returns: Confirmation of the styling operation.
googledocs_format_paragraphApply basic paragraph formatting to a range. This is a simplified tool for common paragraph styles. For advanced styling, use googledocs_update_paragraph_style. Args: - documentId: The document ID - startIndex: Start of the paragraph range - endIndex: End of the paragraph range - alignment: Text alignment (START, CENTER, END, JUSTIFIED) - headingType: Heading style (NORMAL_TEXT, TITLE, SUBTITLE, HEADING_1 through HEADING_6) - lineSpacing: Line spacing (100 = single, 200 = double) - spaceAbove: Space above paragraph in points - spaceBelow: Space below paragraph in points Returns: Confirmation of the paragraph formatting.
googledocs_insert_imageInsert an inline image at a specific position in the document. The image must be accessible via a public URL. For images from Google Drive, you'll need to ensure the image is shared publicly or use a direct download link. Args: - documentId: The document ID - uri: Public URL of the image - index: Position to insert the image - width: Optional width in points (72 points = 1 inch) - height: Optional height in points Returns: Object ID of the inserted image.
googledocs_update_paragraph_styleApply advanced paragraph styling to a range. This tool provides full control over paragraph styling including borders, indentation, and tab stops. Args: - documentId: The document ID - startIndex: Start of the paragraph range - endIndex: End of the paragraph range - paragraphStyle: ParagraphStyle object with styling properties - fields: Comma-separated list of fields to update ParagraphStyle Properties: - namedStyleType: "NORMAL_TEXT" | "TITLE" | "SUBTITLE" | "HEADING_1" through "HEADING_6" - alignment: "START" | "CENTER" | "END" | "JUSTIFIED" - lineSpacing: number (100 = single spacing) - direction: "LEFT_TO_RIGHT" | "RIGHT_TO_LEFT" - spacingMode: "NEVER_COLLAPSE" | "COLLAPSE_LISTS" - spaceAbove/spaceBelow: { magnitude: number, unit: "PT" } - indentFirstLine/indentStart/indentEnd: { magnitude: number, unit: "PT" } - borderTop/borderBottom/borderLeft/borderRight/borderBetween: border objects - shading: { backgroundColor: { color: { rgbColor: {...} } } } - keepLinesTogether, keepWithNext, avoidWidowAndOrphan, pageBreakBefore: boolean Returns: Confirmation of the paragraph styling.
googledocs_update_document_styleUpdate document-wide styling properties. Args: - documentId: The document ID - documentStyle: DocumentStyle object - fields: Comma-separated list of fields to update DocumentStyle Properties: - background: { color: { rgbColor: {...} } } - pageSize: { width: { magnitude, unit }, height: { magnitude, unit } } - marginTop/marginBottom/marginLeft/marginRight: { magnitude: number, unit: "PT" } - marginHeader/marginFooter: { magnitude: number, unit: "PT" } - pageNumberStart: number - useFirstPageHeaderFooter, useEvenPageHeaderFooter: boolean - flipPageOrientation: boolean Returns: Confirmation of the document style update.
googledocs_update_section_styleUpdate section styling properties for a range. Args: - documentId: The document ID - startIndex: Start of the section range - endIndex: End of the section range - sectionStyle: SectionStyle object - fields: Comma-separated list of fields to update SectionStyle Properties: - columnProperties: array of { width, paddingEnd } - columnSeparatorStyle: "NONE" | "BETWEEN_EACH_COLUMN" - contentDirection: "LEFT_TO_RIGHT" | "RIGHT_TO_LEFT" - marginTop/marginBottom/marginLeft/marginRight: dimension objects - sectionType: "CONTINUOUS" | "NEXT_PAGE" - defaultHeaderId, defaultFooterId, firstPageHeaderId, etc. - useFirstPageHeaderFooter: boolean - pageNumberStart: number Returns: Confirmation of the section style update.
googledocs_create_headerCreate a header for the document or a specific section. Args: - documentId: The document ID - type: Header type (DEFAULT for most cases) - sectionBreakIndex: Optional section break location to create header for specific section Returns: The ID of the created header. Use this ID to add content to the header.
googledocs_create_footerCreate a footer for the document or a specific section. Args: - documentId: The document ID - type: Footer type (DEFAULT for most cases) - sectionBreakIndex: Optional section break location to create footer for specific section Returns: The ID of the created footer. Use this ID to add content to the footer.
googledocs_delete_headerDelete a header from the document. Args: - documentId: The document ID - headerId: The ID of the header to delete Returns: Confirmation of the deletion.
googledocs_delete_footerDelete a footer from the document. Args: - documentId: The document ID - footerId: The ID of the footer to delete Returns: Confirmation of the deletion.
googledocs_create_footnoteCreate a footnote at a specific position in the document. This inserts a footnote reference at the specified index and creates a footnote at the bottom of the page. You can then add content to the footnote. Args: - documentId: The document ID - index: Position to insert the footnote reference Returns: The ID of the created footnote.
googledocs_replace_imageReplace an existing image with a new one. The replacement image must be accessible via a public URL. Args: - documentId: The document ID - imageObjectId: The object ID of the image to replace - uri: Public URL of the new image Returns: Confirmation of the image replacement.
googledocs_delete_positioned_objectDelete a positioned object (floating image or drawing) from the document. Args: - documentId: The document ID - objectId: The object ID of the positioned object to delete Returns: Confirmation of the deletion.
googledocs_create_bulletsConvert paragraphs to a bulleted or numbered list. Args: - documentId: The document ID - startIndex: Start of the paragraph range - endIndex: End of the paragraph range - bulletPreset: Optional preset for bullet/numbering style Bullet Presets: Bullet styles: - BULLET_DISC_CIRCLE_SQUARE (default disc/circle/square) - BULLET_DIAMONDX_ARROW3D_SQUARE - BULLET_CHECKBOX (checkbox bullets) - BULLET_ARROW_DIAMOND_DISC - BULLET_STAR_CIRCLE_SQUARE - BULLET_ARROW3D_CIRCLE_SQUARE - BULLET_LEFTTRIANGLE_DIAMOND_DISC Numbered styles: - NUMBERED_DECIMAL_ALPHA_ROMAN (1, a, i) - NUMBERED_DECIMAL_ALPHA_ROMAN_PARENS (1), a), i)) - NUMBERED_DECIMAL_NESTED (1, 1.1, 1.1.1) - NUMBERED_UPPERALPHA_ALPHA_ROMAN (A, a, i) - NUMBERED_UPPERROMAN_UPPERALPHA_DECIMAL (I, A, 1) - NUMBERED_ZERODECIMAL_ALPHA_ROMAN (01, a, i) Returns: Confirmation of the bullet creation.
googledocs_delete_bulletsRemove bullets/numbering from paragraphs. Args: - documentId: The document ID - startIndex: Start of the paragraph range - endIndex: End of the paragraph range Returns: Confirmation of the bullet removal.
googledocs_create_named_rangeCreate a named range to mark a section of the document for later reference. Named ranges allow you to label specific content so it can be easily found and manipulated later using its name rather than indices. Args: - documentId: The document ID - name: Name for the range (must be unique in the document) - startIndex: Start of the range - endIndex: End of the range Returns: The ID of the created named range.
googledocs_delete_named_rangeDelete a named range from the document. You can delete by either the range ID or the range name. If both are provided, the ID takes precedence. Args: - documentId: The document ID - namedRangeId: The ID of the named range (preferred) - name: The name of the named range (alternative to ID) Returns: Confirmation of the deletion.
googledocs_replace_named_range_contentReplace the content of a named range with new text. This is useful for template documents where you want to replace placeholder content marked with named ranges. Args: - documentId: The document ID - text: The replacement text - namedRangeId: The ID of the named range (preferred) - namedRangeName: The name of the named range (alternative to ID) Returns: Confirmation of the replacement.
googledocs_insert_tableInsert a table at a specific position in the document. Args: - documentId: The document ID - rows: Number of rows - columns: Number of columns - index: Position to insert the table Returns: Confirmation of the table insertion.
googledocs_insert_table_rowInsert a row into an existing table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: The row to reference for insertion - columnIndex: The column to reference for the cell location - insertBelow: If true, insert below the referenced row; if false, insert above Returns: Confirmation of the row insertion.
googledocs_insert_table_columnInsert a column into an existing table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: The row to reference for the cell location - columnIndex: The column to reference for insertion - insertRight: If true, insert to the right; if false, insert to the left Returns: Confirmation of the column insertion.
googledocs_delete_table_rowDelete a row from a table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: The row to delete (0-based) - columnIndex: The column to reference for the cell location Returns: Confirmation of the row deletion.
googledocs_delete_table_columnDelete a column from a table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: The row to reference for the cell location - columnIndex: The column to delete (0-based) Returns: Confirmation of the column deletion.
googledocs_merge_table_cellsMerge cells in a table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: Starting row index (0-based) - columnIndex: Starting column index (0-based) - rowSpan: Number of rows to merge - columnSpan: Number of columns to merge Returns: Confirmation of the cell merge.
googledocs_unmerge_table_cellsUnmerge previously merged cells in a table. Args: - documentId: The document ID - tableStartIndex: The start index of the table in the document - rowIndex: Starting row index of the merged cell (0-based) - columnIndex: Starting column index of the merged cell (0-based) - rowSpan: Number of rows in the merged cell - columnSpan: Number of columns in the merged cell Returns: Confirmation of the cell unmerge.
googledocs_update_table_cell_styleUpdate the style of table cells. Args: - documentId: The document ID - tableStartIndex: The start index of the table - rowIndex: Starting row index (0-based) - columnIndex: Starting column index (0-based) - rowSpan: Number of rows to style - columnSpan: Number of columns to style - tableCellStyle: TableCellStyle object - fields: Comma-separated list of fields to update TableCellStyle Properties: - backgroundColor: { color: { rgbColor: { red, green, blue } } } - borderLeft/borderRight/borderTop/borderBottom: { color, width, dashStyle } - paddingLeft/paddingRight/paddingTop/paddingBottom: { magnitude, unit } - contentAlignment: "TOP" | "MIDDLE" | "BOTTOM" Returns: Confirmation of the style update.
googledocs_update_table_row_styleUpdate the style of table rows. Args: - documentId: The document ID - tableStartIndex: The start index of the table - rowIndices: Array of row indices to update (0-based) - tableRowStyle: TableRowStyle object - fields: Comma-separated list of fields to update TableRowStyle Properties: - minRowHeight: { magnitude, unit } - tableHeader: boolean (marks row as header, repeats on page breaks) - preventOverflow: boolean Returns: Confirmation of the style update.
googledocs_update_table_column_propertiesUpdate properties of table columns. Args: - documentId: The document ID - tableStartIndex: The start index of the table - columnIndices: Array of column indices to update (0-based) - tableColumnProperties: TableColumnProperties object - fields: Comma-separated list of fields to update TableColumnProperties: - widthType: "EVENLY_DISTRIBUTED" | "FIXED_WIDTH" - width: { magnitude, unit } Returns: Confirmation of the properties update.
googledocs_pin_table_header_rowsPin rows at the top of a table to repeat on each page. Args: - documentId: The document ID - tableStartIndex: The start index of the table - pinnedHeaderRowsCount: Number of rows to pin (0 to unpin all) Returns: Confirmation of the pin operation.
googledocs_create{
"title": "example_title"
}googledocs_get{
"documentId": "example_documentId"
}googledocs_insert_text{
"text": "example_text",
"index": true,
"documentId": "example_documentId"
}