Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt

Use this file to discover all available pages before exploring further.

Google Docs The Google Docs app provides read/write access to a user’s Google Docs documents through the Docs API v1. It can be used either as a Builder app (automations call Docs instructions directly) or as a remote MCP server consumed by an AI agent. Each tenant configures its own Google OAuth Application; end-users sign in with their own Google account and tokens are stored per (user × tenant). The connector exposes 2 base Docs operations plus ~30 atomic editing operations — each wraps a single batchUpdate request — grouped into 9 entity tools covering documents, text, paragraphs, tables, document style, headers/footers, media, named ranges and raw batch.

Documents & Text

Create, retrieve, insert, delete, replace and style text across a Google Doc

Structure & Tables

Manage paragraphs, bullets, tables, columns/rows, headers, footers, footnotes and document style

Media & Named Ranges

Insert and replace inline images, manage positioned objects, page breaks and named ranges

Prerequisites

  • A Google account with access to the documents you want to expose. For Google Workspace, the workspace admin may need to allow third-party OAuth apps.
  • A Google Cloud project with the Google Docs API enabled at console.cloud.google.com/apis/library/docs.googleapis.com. Enable the Drive API too if you plan to locate documents via the Google Drive connector.
  • A Google OAuth 2.0 Client of type Web application, created at console.cloud.google.com/apis/credentials. The Authorized redirect URIs must contain the value shown in the OAuth Callback URL field of the installed app instance (auto-populated on install — copy it back into the Google Cloud Console after installation).
  • An OAuth consent screen configured in the Google Cloud project. While the app is in Testing state, add the end-user’s email to Test users. The default scopes documents + drive.file go through Google’s verification process when the consent screen moves to Production.
  • Base URL (default: https://docs.googleapis.com/v1)
The Google Docs API cannot list or search documents. To find documents or obtain a documentId, use the Google Drive connector — filter mimeType = application/vnd.google-apps.document — then call documents.get here.

Installation

  1. Go to Apps in your workspace
  2. Search for Google Docs and install it
  3. Open the app instance configuration and fill in the required fields

Configuration

FieldDescription
Google Docs API Base URLBase URL of the Docs API (default https://docs.googleapis.com/v1)
Google OAuth Access Token (fallback)Optional static OAuth access token used as a shared fallback for all users of this tenant. Stored as a workspace secret. Most deployments leave this empty and rely on per-user OAuth instead.
Google OAuth2 Client IDGoogle OAuth Application Client ID. Create an OAuth client of type Web application in the Google Cloud Console
Google OAuth2 Client SecretGoogle OAuth Client Secret, stored as a workspace secret
OAuth Callback URLAuto-populated on install — paste this value into the Authorized redirect URIs list of your Google OAuth client
OAuth Authorize URLDefault https://accounts.google.com/o/oauth2/v2/auth
OAuth Token URLDefault https://oauth2.googleapis.com/token
OAuth Revoke URLDefault https://oauth2.googleapis.com/revoke
OAuth ScopesSpace-separated Google API scopes. Default https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/drive.file
Access Token TTL (seconds)Default 3600 (Google access tokens expire in 1h; refresh is automatic)
MCP EndpointAuto-populated on install — URL of the MCP endpoint for this instance
MCP API KeyAuto-populated on install — signed key used in the mcp-api-key header. Do not modify
MCP Endpoint, MCP API Key and OAuth Callback URL are generated automatically by the onInstall flow. The OAuth credentials (Google OAuth2 Client ID, Google OAuth2 Client Secret) must be filled in manually after creating the OAuth client in the Google Cloud Console.

Authorize end-users

Once the app instance is configured, each end-user authorizes their own Google account through a browser-based consent screen:
1

Trigger the connect flow

From an MCP client (Agent Creator capability or any tool client), call any data tool. If no OAuth session exists for the current user × tenant, the MCP server returns a connector_auth_required payload with a connect_url. Alternatively, call the connect tool explicitly to receive the same payload.
2

Open the connect URL

Open the returned URL in a browser tab where the user is already authenticated to Prisme.ai. The platform redirects to the Google OAuth consent screen.
3

Grant access

The user reviews the requested scopes (default documents + drive.file) and clicks Allow. Google redirects back to the platform’s oauthCallback webhook.
4

Confirmation

The user sees a Connection complete page and can close the tab. The platform has stored an access token plus refresh token as user-scoped secrets — both are tenant-prefixed so they do not leak across app instances.
Each user’s OAuth tokens are scoped per (user × tenant). A user who has authorized in tenant A does not gain access in tenant B — they must run the connect flow again per app instance. Access tokens are refreshed automatically from the stored refresh token.

Available Instructions

Every instruction resolves credentials from the workspace configuration. All editing operations target a single documentId (obtained either from createDocument or via the Google Drive connector). Editing instructions internally wrap a single batchUpdate request; use batchUpdate directly to compose multiple changes in one atomic call.

Documents

InstructionArguments
createDocumenttitle*
getDocumentdocumentId*, suggestionsViewMode, includeTabsContent

Text

InstructionArguments
insertTextdocumentId, text, location, endOfSegmentLocation
deleteContentRangedocumentId, range
replaceAllTextdocumentId, containsText, replaceText*, tabsCriteria
updateTextStyledocumentId, textStyle, fields, range

Paragraphs

InstructionArguments
createParagraphBulletsdocumentId, range, bulletPreset*
deleteParagraphBulletsdocumentId, range
updateParagraphStyledocumentId, paragraphStyle, fields, range

Tables

InstructionArguments
insertTabledocumentId, rows, columns*, location, endOfSegmentLocation
insertTableRowdocumentId, tableCellLocation, insertBelow
insertTableColumndocumentId, tableCellLocation, insertRight
deleteTableRowdocumentId, tableCellLocation
deleteTableColumndocumentId, tableCellLocation
mergeTableCellsdocumentId, tableRange
unmergeTableCellsdocumentId, tableRange
pinTableHeaderRowsdocumentId, tableStartLocation, pinnedHeaderRowsCount*
updateTableCellStyledocumentId, tableCellStyle, fields*, tableRange, tableStartLocation
updateTableColumnPropertiesdocumentId, tableStartLocation, columnIndices, tableColumnProperties, fields*
updateTableRowStyledocumentId, tableStartLocation, rowIndices, tableRowStyle, fields*

Document Style

InstructionArguments
updateDocumentStyledocumentId, documentStyle, fields*
updateSectionStyledocumentId, range, sectionStyle, fields

Headers, Footers & Footnotes

InstructionArguments
createHeaderdocumentId, type, sectionBreakLocation
createFooterdocumentId, type, sectionBreakLocation
createFootnotedocumentId*, location, endOfSegmentLocation
deleteHeaderdocumentId, headerId
deleteFooterdocumentId, footerId

Media

InstructionArguments
insertInlineImagedocumentId, uri, objectSize, location, endOfSegmentLocation
replaceImagedocumentId, imageObjectId, uri*, imageReplaceMethod
insertPageBreakdocumentId*, location, endOfSegmentLocation
deletePositionedObjectdocumentId, objectId
updateEmbeddedObjectPositiondocumentId, objectId, newPosition, fields

Named Ranges

InstructionArguments
createNamedRangedocumentId, name, range*
deleteNamedRangedocumentId*, namedRangeId, name, tabsCriteria
replaceNamedRangeContentdocumentId, text, namedRangeId, namedRangeName, tabsCriteria

Batch

InstructionArguments
batchUpdatedocumentId, requests, writeControl
Arguments flagged with * are required.

DSUL Examples

Create a Doc and populate it with a title + intro

- Google Docs.documents:
    action: create
    title: '{{report.name}} — {{run.date}}'
    output: created
- Google Docs.text:
    action: insert
    documentId: '{{created.documentId}}'
    text: 'Executive summary'
    location:
      index: 1
- Google Docs.paragraphs:
    action: updateStyle
    documentId: '{{created.documentId}}'
    paragraphStyle:
      namedStyleType: HEADING_1
    fields: namedStyleType
    range:
      startIndex: 1
      endIndex: 18

Replace placeholders across an existing template

- Google Docs.text:
    action: replaceAll
    documentId: '{{templateDocId}}'
    containsText:
      text: '{{{{customer_name}}}}'
      matchCase: false
    replaceText: '{{customer.name}}'
- Google Docs.text:
    action: replaceAll
    documentId: '{{templateDocId}}'
    containsText:
      text: '{{{{order_total}}}}'
    replaceText: '{{order.total}} €'

Insert a 3×4 table and merge the header row

- Google Docs.tables:
    action: insert
    documentId: '{{docId}}'
    rows: 4
    columns: 3
    endOfSegmentLocation: {}
- Google Docs.tables:
    action: merge
    documentId: '{{docId}}'
    tableRange:
      tableCellLocation:
        tableStartLocation:
          index: 200
        rowIndex: 0
        columnIndex: 0
      rowSpan: 1
      columnSpan: 3

Build a multi-step report atomically with batchUpdate

- Google Docs.batch:
    action: update
    documentId: '{{docId}}'
    requests:
      - insertText:
          text: 'Q2 Results\n'
          location:
            index: 1
      - updateParagraphStyle:
          paragraphStyle:
            namedStyleType: HEADING_1
          fields: namedStyleType
          range:
            startIndex: 1
            endIndex: 11
      - insertPageBreak:
          endOfSegmentLocation: {}

Error Handling

HTTP StatusMeaningTypical Cause
400Bad RequestMalformed request, invalid Range/Location, conflicting requests in a batch
401UnauthorizedMissing / expired OAuth token, revoked refresh token, user has not connected yet
403ForbiddenDocs API disabled in the Google Cloud project, scope insufficient, user lost access to the document
404Not FoundDocument does not exist or the user has no access (most often the latter)
409ConflictOptimistic concurrency failure via writeControl.requiredRevisionId
429Rate LimitedPer-user or per-project quota exhausted. Back off and retry
500 / 503Server ErrorTransient Google Docs API error. Retry with exponential backoff

Common Issues

“Not configured” — The app instance has no OAuth Client ID/Secret. Create an OAuth client in the Google Cloud Console and paste the credentials into the app configuration. “Invalid API key” (MCP) — The mcp-api-key header does not match the central app secret. Reinstall the app instance to regenerate a signed key. “Credentials lookup failed” — The MCP endpoint could not reach the getConfig webhook of the installed app. Verify that the app instance is still installed in the expected workspace. connector_auth_required — The calling user has no Google OAuth session yet for this tenant. The response payload includes a connect_url; relay it to the user so they can authorize their Google account. redirect_uri_mismatch during the OAuth dance — The value of OAuth Callback URL in the app config has not been added to the Authorized redirect URIs of the Google OAuth client. Copy it back into the Google Cloud Console and retry. The user does not have sufficient permissions for file … (403) — The default scope drive.file only grants access to files the user created with the app or opened with the app. To work with arbitrary user documents, broaden the scope to https://www.googleapis.com/auth/documents.readonly + drive.readonly (read-only) or documents + drive (full Drive). Broader scopes require Google verification before going to production. “No documentId” / cannot list documents — The Google Docs API does not expose a list/search endpoint. Pair this connector with the Google Drive connector to enumerate documents (mimeType = application/vnd.google-apps.document), then call documents.get with the returned IDs.

External Resources

Google Docs API v1

Official Google Docs REST API reference

Tool Agents

Build AI agents that call MCP tools dynamically