What can you do with it?

Google Docs allows you to create and modify documents programmatically. You can create new documents with custom titles, insert text at specific positions, format content with bullets and styles, and structure documents with sections. This integration is perfect for document automation, report generation, and content creation workflows. Note that document sharing requires the Google Drive integration.

How to use it?

Basic Command Structure

/your-Google-Docs-connection [action] [required-parameters] [optional-parameters]

Parameters

Required:

  • action - The operation to perform on documents

Tools

Create Document

Create a new blank Google Docs document

Parameters:

  • title (required) - Title for the new document

Example:

/your-Google-Docs-connection
action: create-document
title: Project Proposal

Response:

{
  "documentId": "1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s",
  "title": "Project Proposal",
  "revisionId": "ALBJ4LuaGac_EPHDouWox6oP8IRLO9YTTQF7P0jJBnwYn8qJ_WCFjSxEPesGBsVTKlmdY7DWehIZ5utzOeiTyg"
}

Insert Text

Insert text at a specific position in the document

Parameters:

  • document-id (required) - The ID of the document to modify
  • text (required) - Text content to insert
  • index (required) - Position where text should be inserted (1 for beginning)

Example:

/your-Google-Docs-connection
action: insert-text
document-id: 1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s
text: Main document title\n\n
index: 1

Response:

{
  "replies": [
    {
      "insertText": {
        "text": "Main document title\n\n"
      }
    }
  ]
}

Create Structured Document

Create a document with multiple sections and formatting

Parameters:

  • document-id (required) - The ID of the document to modify
  • sections (required) - List of sections with their content and positions
  • format-type (optional) - Formatting to apply (e.g., bullets, numbering)

Example:

/your-Google-Docs-connection
action: create-structured-document
document-id: 1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s
sections: Main Title at index 1, Section 1 at index 16, Section 2 at index 28, Section 3 at index 40
format-type: bullets

Response:

{
  "replies": [
    {
      "insertText": {
        "text": "Main Title"
      }
    },
    {
      "createParagraphBullets": {
        "range": {
          "startIndex": 16,
          "endIndex": 28
        }
      }
    }
  ]
}

Add Bullet Points

Format text as bulleted lists

Parameters:

  • document-id (required) - The ID of the document to modify
  • start-index (required) - Starting position of text to format
  • end-index (required) - Ending position of text to format
  • bullet-style (optional) - Bullet style (default: BULLET_DISC_CIRCLE)

Example:

/your-Google-Docs-connection
action: add-bullets
document-id: 1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s
start-index: 16
end-index: 28
bullet-style: BULLET_DISC_CIRCLE

Response:

{
  "replies": [
    {
      "createParagraphBullets": {
        "range": {
          "startIndex": 16,
          "endIndex": 28
        }
      }
    }
  ]
}

Batch Update

Perform multiple document modifications in a single request

Parameters:

  • document-id (required) - The ID of the document to modify
  • requests (required) - List of modification requests to apply

Example:

/your-Google-Docs-connection
action: batch-update
document-id: 1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s
requests: Insert "Title" at index 1, Insert "Content" at index 10, Add bullets from 20 to 30

Response:

{
  "documentId": "1jjk1pwboxpelntexnhDiOYXxbT4LIJR5wtVGsmHqS7s",
  "replies": [
    {
      "insertText": {
        "text": "Title"
      }
    },
    {
      "insertText": {
        "text": "Content"
      }
    },
    {
      "createParagraphBullets": {}
    }
  ]
}

Notes

When modifying documents, the index position must be less than the end index of the referenced segment. Index positions start at 1 for the beginning of the document. Document sharing functionality requires the Google Drive integration - use the Google Drive slash command to share documents by file name. Bullet preset options include BULLET_DISC_CIRCLE for standard bullet formatting.