The Google Workspaces app provides read/write access to five Google Workspace APIs (Drive, Docs, Sheets, Gmail and Calendar) through their official REST endpoints. It can be consumed two ways: as a remote MCP server that Agent Creator agents call as tools, or as a Builder app whose instructions you call directly from DSUL. The MCP surface groups every operation into five entity tools (drive, docs, sheets, gmail, calendar), each driven by an action argument, and runs in the tenant app-instance context (it resolves the installing workspace’s own credentials). Authentication is per-user and supports several modes:
- Per-user OAuth2 with a central client (
oauthCentral, recommended): one Google OAuth Application is registered once by the platform maintainer; every end user signs in with their own Google account. Nothing to register per tenant: each workspace just installs the app and clicks Connect. - Per-user OAuth2 with a tenant client (
oauth): paste your own Google OAuth client ID/secret in the connector config app. Each user signs in with their own account against your client (PKCE authorization-code flow). - Service account with JWT Bearer (
jwt): a Google service-account key, with optional domain-wide delegation (subject) to impersonate users across a Workspace domain. No interactive sign-in. - Direct access token (
accessToken): a caller-managed Google access token, used as-is with no exchange.
Drive, Docs & Sheets
Gmail & Calendar
Flexible per-user auth
Who is this for?
This connector is used by four different roles. Jump to the section that matches yours; each one is self-contained.Agent builder
Knowledge base owner
Platform admin
Workspace builder
Prerequisites (Google side)
- A Google account (or a Google Workspace domain for service-account / domain-wide delegation).
- The Google APIs you intend to call must be enabled in the Cloud project: Drive, Docs, Sheets, Gmail, Calendar.
- An OAuth client or service-account key, depending on the auth mode (see the Platform admin setup accordion below and the Workspace builder tab).
Platform admin (Governance): one-time platform setup
Platform admin (Governance): one-time platform setup
1. Configure the connector
Register the OAuth Application at Google
https://api.studio.prisme.ai/v2/workspaces/slug:google-workspaces/webhooks/oauthCallback on production). Enable the Drive, Docs, Sheets, Gmail and Calendar APIs in the same project, and add the scopes listed in Prerequisites. Save the Client ID + Client Secret.Enter the credentials through the configuration app
google-workspaces workspace and launch its Configuration app at <studio>/apps/google-workspaces (e.g. https://studio.prisme.ai/apps/google-workspaces), also linked as Configuration app on the installed instance. Opened from the connector’s own workspace, the app shows the maintainer setup screen: copy the Redirect URI to register in Google Cloud (it must match the URI you registered in the previous step), paste the OAuth Client ID and OAuth Client secret, optionally narrow the Scopes (empty means the default scopes listed in Prerequisites), then click Save central OAuth client. Only an owner or editor of the google-workspaces workspace can use this screen; anyone else sees Access restricted. The app stores the client in the core workspace’s secrets for you. Do not edit Studio’s raw Secrets by hand. These credentials stay in the google-workspaces workspace and are never exposed to tenants or end users; token exchange is proxied through the core centralTokenExchange webhook so the client secret never leaves the core workspace.Tell workspaces to use the central client
oauthCentral in the connector configuration app (no client id/secret to enter on their side). Their users then just click Connect.2. Declare the capability in AI Governance
Generic connectors (broad tool surfaces meant to be shared across many agents, like Google Workspaces) are best exposed as a named capability in AI Governance. Agent builders then enable that capability on their agents instead of pasting a raw MCP endpoint.Open AI Governance > Capabilities
Point it at the MCP endpoint
agent_id in the scope is what lets the connector identify and authorize the calling agent. attachment_urls lets Agent Creator pass the files a user uploads in the chat to the tools that consume them.Make it available to agent builders
Smoke-test
oauthCentral, trigger any tool. The user is prompted to connect once (Google sign-in); subsequent calls reuse the stored token transparently and refresh it automatically.- Agent builder (Agent Creator)
- Workspace builder (DSUL)
- Knowledge base (sync)
Agent builder
Goal: let an agent you build in Agent Creator read and act on Google Workspace through MCP tools.agent_id that Agent Creator injects through the capability Scope, and that agent must appear in the connector’s authorized-agents allowlist (managed in the configuration app). The Google access token itself is resolved server-side from the configured auth mode.There are two ways to wire it up. Pick based on how much isolation you need.Option A: Enable the shared capability from the catalog
The fastest path: a Platform admin has already published a Google Workspaces capability (see the Platform admin setup accordion above, §2), so you just pick it from the catalog.Open your agent in Agent Creator
Add the Google Workspaces capability
context_id,agent_id,user_id,attachment_urls) are already wired by the admin; there is nothing to paste, and the shared instance accepts every agent, so there is no allowlist step on your side.Connect a Google account (OAuth modes)
connect_url. Service-account (jwt) and accessToken modes need no per-user sign-in.Option B: Run it from your own workspace (recommended)
For production agents, install the connector in your own workspace and point the agent at that workspace’s MCP endpoint.Install and configure the connector in your workspace
Allowlist your agent
Add the MCP capability to your agent
agent_id is what lets the connector identify and authorize your agent; without it, every call is rejected with an explicit “agent could not be identified” message. This Scope is separate from the Google OAuth scopes.Connect a Google account (OAuth modes)
Brief the agent in its system prompt
Whichever option you pick, wiring the capability is not enough; the agent must know the MCP exists and when to use it. Copy-pasteable starter:agent_id.oauthCentral) you do not create your own Google client; keep oauthCentral and just enter the read-only scopes; your tenant scope overrides the platform default (the central app’s consent screen must declare these read scopes). Write calls are then rejected by Google with 403. Note this is set at the workspace level: a workspace editor can widen it again; a provider-side restriction is the only hard guarantee.Available Tools
Each tool takes anaction argument selecting the concrete operation, plus the per-action parameters.Output Formats
Every tool accepts anoutputFormat argument that controls the MCP response shape:verbose(default): human-readable text optimized for LLM consumptioncompact: concise machine-readable JSON instructuredContent
Tool Details
drive
q, an unknown fields property, an export format the file does not support), the error returned to the agent lists the values that action accepts, so the agent can correct its call instead of guessing again. This applies to list, get, create, update, copy, export and permissionsList.sheets
range that the call sent, the error returned to the agent lists the values that action accepts, so the agent can correct its call instead of guessing again. This applies to valuesGet, valuesUpdate and valuesAppend.gmail
q or labelIds value that the call sent, the error returned to the agent lists the values messagesList accepts, so the agent can correct its call instead of guessing again.attachToChat (on drive and gmail) proposes a file for attachment to the conversation; nothing is attached until the user confirms. Google Docs, Slides and Drawings are attached as PDF, Sheets as XLSX. Files larger than about 4 MB are refused; read their text with drive export (mimeType: text/plain) instead.getProfile call; it returns {emailAddress, messagesTotal}. Never list messages to discover the connected address.calendar
orderBy, timeMin, timeMax or q value that the call sent, the error returned to the agent lists the values eventsList accepts, so the agent can correct its call instead of guessing again.Security
The answers that hold for every connector (agent access, shared knowledge bases, credentials, models, egress) are on Connector security. This section lists what is specific to Google Workspaces.https://www.googleapis.com/auth/<scope>. With the read-only scopes, Google itself refuses every create, update, send and delete call. The jwt mode also requests the write scopes by default when no scope is set. The per-reader check always uses the reader’s own Google connection, even when the instance indexes the knowledge base with a service account.
Error Handling
Error codes
Authentication and permission errors start with a stable code, which is also returned in thecode field where the response has one. Only AUTH_EXPIRED asks the user to reconnect.
Changing the OAuth client
Google refresh tokens belong to the OAuth client that issued them. After you change the client ID, including when you switch between the central client and your own, each user is disconnected the next time their token is renewed, getsAUTH_EXPIRED, and must reconnect. An account with no recorded client (not renewed since this behavior was introduced) keeps its token and reports OAUTH_CLIENT_MISCONFIGURED; it recovers by disconnecting and connecting again.
A mistyped client ID has the same effect on users who were already connected, so check the ID before saving it. The Activity Feed shows an OAuthClientChanged error when this starts.
Connection status
connected: true means the connector holds a credential for this user. It does not prove that Google still accepts it: a revoked sign-in is detected the next time the token is renewed, and is then reported as AUTH_EXPIRED. A status response can also include code and reason when a credential is held but cannot currently be renewed.
Common Issues
“This agent is not authorized to use this connector”: The calling agent is not in the allowlist. Open the configuration app → Authorized agents → tick this agent (or enable Allow all agents) and Save. “The calling agent could not be identified”: The MCP capability Scope does not declareagent_id, so Agent Creator never injects the agent identity. Set the Scope to context_id,agent_id,user_id,attachment_urls on the capability, then allow the agent in the config app.
“Google is not connected for this user”: No per-user OAuth token. Open the configuration app (OAuth mode) and click Connect, or use the agent’s connect flow.
AUTH_EXPIRED: the Google sign-in of this user has expired or was revoked: The stored refresh token was revoked or expired (Google invalidated it). The connection is dropped automatically; the user must reconnect from the config app or the agent’s connect card.
OAUTH_CLIENT_MISCONFIGURED: Google rejected the OAuth client of the connector: Google refuses the OAuth client itself, so every user is affected and reconnecting does not help. Users stay connected. An administrator must check the OAuth client ID and secret: in the config app for oauth mode, or on the maintainer setup screen for oauthCentral.
OAUTH_TOKEN_REJECTED: Google refused to renew the access token: A connector configuration problem, not an expired sign-in. An administrator must check the OAuth client and its scopes; do not ask the user to reconnect.
TEMPORARY: the Google token endpoint is unavailable right now: A transient Google outage or rate limit. Retry in a moment; no reconnection is needed.
“Google is not authenticated. Configure the auth mode and its credentials in the connector config app.”: No auth mode or credentials are saved for this workspace. Open the configuration app, choose a mode, fill in its fields and click Save authentication.
“TEMPORARY: this Google connection was replaced while its token was being renewed. Retry — no reconnection needed.”: The user connected again while a request still held the previous token, and Google refused that previous token. The newer connection is kept, so nothing needs fixing: retry the request, it runs on the new connection.
“Google OAuth is not configured”: Neither a tenant OAuth client nor the central platform client is available. Set the OAuth client ID/secret in the config app, or ask the platform maintainer to provision the central OAuth client.
Gmail send fails or arrives garbled: Pass to, subject, text/html as plain strings in body. The server builds and base64-encodes the MIME message itself; never base64-encode the content yourself.