Skip to main content

At a glance

Credentials

Set these per environment. See Connect an integration. With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.
VariableRequiredDescription
GOOGLE_CLIENT_IDYesGoogle OAuth Client ID Docs.
GOOGLE_CLIENT_SECRETYesGoogle OAuth Client Secret Docs.

Setup

  1. Create a Google Cloud project: Go to https://console.cloud.google.com/ and create (or select) a project. Any Google Workspace account can be used for testing; Chat API requires a Workspace account (consumer @gmail.com accounts cannot use Google Chat spaces).
  2. Enable the Google Chat API: Enable the API at https://console.cloud.google.com/apis/library/chat.googleapis.com.
  3. Configure the OAuth consent screen and Chat app: Under APIs & Services → OAuth consent screen, configure the app and add the scopes chat.spaces.readonly and chat.messages. The Chat API also requires a Chat app configuration: visit https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat and set an app name, avatar, and description.
  4. Create OAuth credentials: Under APIs & Services → Credentials, create an OAuth client ID (Web application) with redirect URI <your-app-url>/api/auth/google-chat/callback. Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in your .env.
  5. Verify access: Run the List Spaces tool, then List Messages on one of the returned spaces.
  • Google Chat user authentication requires a Google Workspace account - consumer Gmail accounts will get 403s
  • Space and message IDs are resource-name segments: spaces/{spaceId} and spaces/{spaceId}/messages/{messageId}
  • The chat.messages scope covers listing, reading, and sending messages; chat.spaces.readonly covers space discovery
Provider API reference: https://developers.google.com/workspace/chat/api/reference/rest

Tools

ToolAccessDescription
List SpacesReadList Google Chat spaces (rooms and direct messages) the authenticated user is a member of
Get SpaceReadGet details of a Google Chat space
List MessagesReadList messages in a Google Chat space, including messages in threads
Get MessageReadGet details of a specific Google Chat message
Send MessageWriteSend a text message to a Google Chat space

Example prompts

  • List my Google Chat spaces, then summarize the most recent messages in the most active one.
  • Send a status update message to a Google Chat space of my choice.