// connections

Google Docs

Create Google Docs, read a document's full content and structure, and edit it with batched requests. Connect a Google account with OAuth.

2 mcp tools3 operations
rest
https://api.superagnt.com/v1/connections/google-docs plus the vendor's own path, with your superagnt_ API key as Authorization: Bearer.
mcp
Tools named connection_google_docs_* on https://mcp.superagnt.com/mcp, served once the account is connected.
billing
Google Docs bills your own account. Calls cost no superagnt_ data credits.
rate limit
60 requests a second, 300 a minute: the vendor's ceiling as the registry records it, for sizing bursts. Your plan's own limit is on Connections.

The Google Docs connection lets an agent write and read documents in a connected Google account. It creates a document, reads a document's full content and structure (body, lists, tables, styles, footnotes, headers and footers), and edits it by applying Google Docs batchUpdate requests: insert, replace or delete text, add tables, change styles.

01

Setup

  1. Start the install. In the superagnt app open Integrations, pick Google Docs and press Connect with Google.
  2. Approve access. Pick the Google account and approve. superagnt_ asks for your Google Docs (documents), per-file Drive access (drive.file), and your email address and profile, which label the connection.

Each Google app connects on its own: connecting Google Docs gives no access to Google Sheets, Google Calendar or Google Search Console. When one of those is already connected, the Google Docs dialog offers Connect Google Docs, which asks that same Google account for the Docs permission only. superagnt_ refreshes Google's access tokens for you.

02

Things to know

  • A document's id is in its URL: https://docs.google.com/document/d/<documentId>/edit. The documents scope reaches every document the Google account can open, not only the ones an agent created.
  • connection_google_docs_write action create makes an empty document with only a title. Add its content with batch_update.
  • batch_update applies its requests atomically: if one fails, none is applied. A position in the body is an index, and the body starts at index 1, so read the document first to find where to edit.
  • To fill a template, a replaceAllText request swaps every match of a placeholder without any index math.
  • writeControl is an optional revision guard: with requiredRevisionId set, the edit fails if the document changed since you read that revision.
  • get takes suggestionsViewMode, for example PREVIEW_SUGGESTIONS_ACCEPTED to read the text as if every suggestion were accepted.
  • Creating and editing run without asking by default (Permissions).
  • The connection does not cover Google Drive: it cannot list, search, share, move or delete documents.

03

Examples

Create a document

create an empty documentbash
curl -X POST "https://api.superagnt.com/v1/connections/google-docs/v1/documents" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Weekly pipeline report"}'

Insert text at the start

insert textbash
curl -X POST "https://api.superagnt.com/v1/connections/google-docs/v1/documents/<documentId>:batchUpdate" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [
      {"insertText": {"location": {"index": 1}, "text": "Pipeline grew 12% this week.\n"}}
    ]
  }'

Read a document

read content and structurebash
curl "https://api.superagnt.com/v1/connections/google-docs/v1/documents/<documentId>" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY"
04// mcp tools

2 tools, one per resource and risk

MCP servers and agents on the grouped surface list Google Docs as these tools. Each takes an action, and the ones that work across record types an object. Every operation also keeps its own per-operation name, in the next table, which works on every server. How grouping works: Grouped tools.

ToolRiskActions
connection_google_docs_read

Read Google Docs

Get a document's full content and structure by documentId (from the URL /document/d/<documentId>/edit).

read
get
connection_google_docs_write

Create and edit Google Docs

Create an empty document with a title, or edit one by applying Google Docs batchUpdate requests (insert, replace or delete text, tables, styles) atomically.

write
createbatch_update
05// operations

All 3 operations

Each operation is a REST path under https://api.superagnt.com/v1/connections/google-docs and an MCP tool. The per-operation tool name is the one permissions, approvals and usage records use.

OperationMCP tool
POST/v1/documents

Create a new document

connection_google_docs_documents_creategrouped: connection_google_docs_write, action create
GET/v1/documents/{documentId}

Get document

connection_google_docs_documents_getgrouped: connection_google_docs_read, action get
POST/v1/documents/{documentId}:batchUpdate

Apply batched edits

connection_google_docs_documents_batch_updategrouped: connection_google_docs_write, action batch_update