Read and write Google Sheets values, ranges and formatting from Prisme.ai workflows and AI agents
The Google Sheets app provides read/write access to a user’s Google Sheets through the Sheets API v4. It can be used either as a Builder app (automations call Sheets 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 ~45 operations grouped into 12 entity tools covering spreadsheets metadata, full values read/write (single, batch and data-filter variants), sheet management, dimensions, cells formatting, find/replace and sorting, named & protected ranges, conditional formats, charts, banding and developer metadata.
Read & Write Values
Get, update, append and clear cell values across single ranges, multiple ranges or via data filters
Structure & Formatting
Add/delete sheets, insert/delete/resize rows and columns, merge cells, set borders, conditional formats, banding and charts
Data Operations
Find/replace, sort ranges, set the basic filter, manage named & protected ranges and developer metadata
A Google account with access to the spreadsheets you want to expose. For Google Workspace, the workspace admin may need to allow third-party OAuth apps.
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 spreadsheets + drive.file go through Google’s verification process when the consent screen moves to Production.
Base URL (default: https://sheets.googleapis.com/v4)
The Google Sheets API cannot list or search spreadsheets. To find spreadsheets or obtain a spreadsheetId, use the Google Drive connector — filter mimeType = application/vnd.google-apps.spreadsheet — then call spreadsheets.get here.
Base URL of the Sheets API (default https://sheets.googleapis.com/v4)
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 ID
Google OAuth Application Client ID. Create an OAuth client of type Web application in the Google Cloud Console
Google OAuth2 Client Secret
Google OAuth Client Secret, stored as a workspace secret
OAuth Callback URL
Auto-populated on install — paste this value into the Authorized redirect URIs list of your Google OAuth client
Space-separated Google API scopes. Default https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/drive.file
Access Token TTL (seconds)
Default 3600 (Google access tokens expire in 1h; refresh is automatic)
MCP Endpoint
Auto-populated on install — URL of the MCP endpoint for this instance
MCP API Key
Auto-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.
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 spreadsheets + 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.
Every instruction resolves credentials from the workspace configuration. Most operations target a single spreadsheetId. Value operations use A1 notation ranges (e.g. Sheet1!A1:C10); structural operations target a sheet by its numeric sheetId (gid). Use batchUpdate directly to compose multiple structural changes in one atomic call.
The Google Sheets app ships with a built-in MCP server. Each app instance gets its own signed mcp-api-key that encodes the workspace ID and a credentials lookup URL — the Google Sheets API token itself is never passed through headers and is resolved server-side from the app configuration plus the per-user OAuth session.
Agents consume MCP servers directly through Agent Creator capabilities. This is the preferred way to expose Google Sheets to an agent.
1
Create or open a workspace
From the Prisme.ai console, create a new workspace (or open the one that will host the connector).
2
Install the Google Sheets app
Open the workspace Imports panel, search for Google Sheets and install it.
3
Configure the credentials
Open the freshly installed app instance settings and fill in the OAuth Client ID and Client Secret (see the Usage as App tab for the field-by-field reference).
4
Copy the MCP endpoint and API key
Still on the app instance configuration page, copy the values of MCP Endpoint and MCP API Key — both are generated automatically on install.
5
Open Agent Creator
Switch to Agent Creator and open the agent you want to extend.
6
Add a capability
Add a new capability to the agent:
If a dedicated Google Sheets capability exists — select it and paste the MCP API Key into the mcp-api-key field. The server URL is already wired.
Otherwise — select the generic custom_mcp capability, paste the MCP Endpoint into the Server URL field, then open the Headers field and add an mcp-api-key entry whose value is the MCP API Key copied earlier:
{ "mcp-api-key": "your-mcp-api-key"}
7
Save
The agent now has access to every Google Sheets tool exposed by the MCP server.
8
Brief the agent in its system prompt
Wiring the capability is not enough — the agent also needs to know the MCP exists and when to reach for it. Add a short paragraph to the agent’s system prompt. Copy-pasteable starter:
You have access to the Google Sheets MCP server. Use it whenever the user asks about a spreadsheet — reading or writing cells, appending rows, creating sheets, formatting, sorting, find/replace, charts. Prefer the `values` tool (get/update/append/batchGet) for data, and `spreadsheets.batchUpdate` for atomic structural/format changes. The first call may return a connect_url asking the user to authorize their Google account; relay it as-is. The Sheets API cannot list spreadsheets — if the user references "their sheets" without an ID, pair this with the Google Drive MCP. Always confirm with the user before destructive changes (clear, delete sheet, findReplace allSheets).
Refine the trigger keywords (resource names, business domains, typical user phrasings) so the agent reliably picks up the right intent in your context.
Use this flow to plug the Google Sheets MCP into an AI Knowledge agent that does not yet support the native MCP picker.
1
Install the Google Sheets app
Install and configure the app in the same workspace as your agent (see the Usage as App tab). Once configured, mcpEndpoint and mcpApiKey are auto-populated.
2
Copy the MCP credentials
Open the app instance config and copy the values of MCP Endpoint and MCP API Key.
3
Open your AI Knowledge project
Navigate to Advanced > Tools.
4
Add an MCP tool
Click Add and select the MCP tab.
5
Fill in the endpoint
Paste the MCP Endpoint URL copied from the app instance.
6
Add the auth header
In the Headers field, add the signed API key:
{ "mcp-api-key": "your-mcp-api-key"}
7
Save
The agent can now list and call Google Sheets tools through the MCP endpoint.
The signed mcp-api-key encodes the workspace ID and the getConfig webhook URL. The MCP server validates the signature using the central app secret and transparently fetches the OAuth client credentials and base URL from the installed app, then resolves the calling user’s stored Google access token. Credentials are cached per tenant for 10 minutes; user OAuth tokens are refreshed on demand.
Initiate an OAuth connection to Google Sheets. Returns a connect_url for the user to click. Prefer calling data tools directly — they auto-handle authentication.
disconnect
Disconnect the current Google Sheets OAuth session and revoke the access token (RFC 7009)
“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.Unable to parse range — The range argument is not valid A1 notation. The sheet name must be quoted with single quotes if it contains spaces (e.g. 'Q2 results'!A1:C10).Missing valueInputOption (400) — Write operations (update, append, batchUpdate*) require valueInputOption: RAW or USER_ENTERED. The latter interprets formulas, dates and numbers like the Sheets UI.“No spreadsheetId” / cannot list spreadsheets — The Google Sheets API does not expose a list/search endpoint. Pair this connector with the Google Drive connector to enumerate spreadsheets (mimeType = application/vnd.google-apps.spreadsheet), then call spreadsheets.get.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 spreadsheets, broaden the scope to https://www.googleapis.com/auth/spreadsheets.readonly + drive.readonly (read-only) or spreadsheets + drive (full Drive). Broader scopes require Google verification before going to production.