Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Google Chat

Scalekit connector
Open markdown

The Google Chat connector lets your AI agent act in each user's Google Chat account. Each user signs in to Google Chat once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 54 tools.

Tools
54
What they doRead · write · destructive
24 · 23 · 724 read23 write7 destructive
Users sign in with
OAuth app
Your own Google app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Google Chat connection

    In AgentKit > Connections, create a Google Chat connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register a Google OAuth app

    Google Chat connections use your own OAuth app. Register one with Google and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Google Chat connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'googlechat'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Google Chat:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'googlechat_find_group_chats',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • googlechat_download_mediaDownload the raw binary content of Google Chat media, such as a message attachment, using its opaque media resource name.Read-only

    Download Media

    Download the raw binary content of Google Chat media, such as a message attachment, using its opaque media resource name. Returns the raw file bytes as the response body (not JSON) — Content-Type varies with the underlying file (e.g. image/png, application/pdf). Known limitation: whether the Scalekit REST executor surfaces raw binary bytes usably to the caller should be verified during testing. Use download_media after googlechat_get_attachment has given you an attachmentDataRef.resourceName to fetch, to retrieve the actual file content rather than just its metadata. Requires a valid Google Chat OAuth2 connection with the appropriate messages scope.

    Inputs

    resource_namestringrequired
    The opaque media resource name to download, exactly as returned in an attachment's attachmentDataRef.resourceName field (e.g. from googlechat_get_attachment). Pass it through verbatim — do not attempt to construct or decompose this value; its format is internal to Google Chat's media API and varies.
  • googlechat_find_direct_message_spaceFind the existing direct message space between the caller and a specified user.Read-only

    Find Direct Message Space

    Find the existing direct message space between the caller and a specified user. With app authentication, finds the DM between that user and the calling Chat app; with user authentication, finds the DM between that user and the authenticated user. Returns the matching space resource, or a 404 error if no direct message exists yet. Use setup_space instead to create a new direct message when one doesn't already exist. Requires a valid Google Chat OAuth2 connection.

    Inputs

    userstringrequired
    Required. Resource name of the user to find a direct message with. Format: users/{user}, where {user} is either the People API person ID or the Directory API user ID. When using user authentication, you can also use the person's email address as an alias, e.g. users/example@gmail.com.
  • googlechat_find_group_chatsFind group chat spaces whose human membership contains exactly the calling user plus the specified set of other users.Read-only

    Find Group Chats

    Find group chat spaces whose human membership contains exactly the calling user plus the specified set of other users. Returns matching space resources (or just resource names, depending on space_view) plus a nextPageToken for pagination. Use list_spaces or search_spaces instead to browse spaces more broadly. Requires a valid Google Chat OAuth2 connection with a memberships scope.

    Inputs

    page_sizeinteger
    The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 10 spaces are returned. The maximum value is 30; larger values are coerced down to 30.default 10
    page_tokenstring
    A page token received from a previous find_group_chats call, used to retrieve the next page. When paginating, keep all other parameters the same as the call that returned this token.
    space_viewstring
    Requested space view. SPACE_VIEW_RESOURCE_NAME_ONLY (default) populates only the space's resource name. SPACE_VIEW_EXPANDED populates full space fields (except permissionSettings) but requires a scope that allows reading space data, e.g. chat.spaces or chat.spaces.readonly.one of SPACE_VIEW_UNSPECIFIEDSPACE_VIEW_RESOURCE_NAME_ONLYSPACE_VIEW_EXPANDEDdefault SPACE_VIEW_RESOURCE_NAME_ONLY
    usersarray
    Resource names of the other human users (besides the caller) who must be exactly the group chat's human membership. Chat apps can't be included. Up to 49 users. Format: users/{user}, where {user} is the People API person ID, Directory API user ID, or (with user authentication) the person's email address as an alias, e.g. users/example@gmail.com.
  • googlechat_get_attachmentGet the metadata of a message attachment in Google Chat, such as its content type, source, and download/thumbnail URLs.Read-only

    Get Attachment

    Get the metadata of a message attachment in Google Chat, such as its content type, source, and download/thumbnail URLs. Returns an Attachment object with name, contentType, contentName, source, downloadUri, and thumbnailUri fields — not the file bytes themselves. Known limitation: Google's API documents exactly one supported authentication method for this endpoint — app/bot authentication with the chat.bot scope — and offers no user-authentication alternative (unlike most other Chat API methods). This connector only implements standard 3-legged user OAuth, which this endpoint does not accept, so calls through this connector are expected to fail with a permission/authentication error until app authentication is supported here. Kept for API-surface completeness. Use this to inspect an attachment referenced on a message before deciding whether to fetch it. Use googlechat_download_media with the attachment's attachmentDataRef.resourceName to retrieve the actual binary content.

    Inputs

    attachment_idstringrequired
    The unique ID of the attachment (the segment after 'attachments/' in the attachment resource name).
    message_idstringrequired
    The unique ID of the message (the segment after 'messages/' in the message resource name) that has this attachment.
    space_idstringrequired
    The unique ID of the space (the segment after 'spaces/' in the space resource name) that contains the message with this attachment.
  • googlechat_get_custom_emojiGet the details of a single custom emoji in Google Chat by its ID or emoji name.Read-only

    Get Custom Emoji

    Get the details of a single custom emoji in Google Chat by its ID or emoji name. Returns a CustomEmoji object with name, emojiName, uid, and a temporaryImageUri (valid for at least 10 minutes) for previewing the image. Use get_custom_emoji when you already know the specific emoji to fetch. Use list_custom_emojis to browse or search for one first. Custom emojis must be enabled for the organization and require a Google Chat OAuth2 connection. Known limitation: this endpoint has no fallback scope -- it strictly requires chat.customemojis or chat.customemojis.readonly, which is not currently offered in the standard Google Cloud Console OAuth consent screen scope picker (observed directly; likely a Developer-Preview-gated scope on Google's side). Calls will fail with an insufficient-scope/permission error until Google exposes it for this project.

    Inputs

    custom_emoji_idstringrequired
    The unique ID of the custom emoji (the segment after 'customEmojis/' in its resource name), OR the emoji's name used as an alias, including the surrounding colons (e.g. ':example-emoji:').
  • googlechat_get_memberGet details about a single membership in a Google Chat space, including the member's role, state, and whether they are a human user, Chat app, or Google Group.Read-only

    Get Member

    Get details about a single membership in a Google Chat space, including the member's role, state, and whether they are a human user, Chat app, or Google Group. Returns one membership object. Use get_member when you already know the member_id; use list_members to browse or search all members of a space.

    Inputs

    member_idstringrequired
    The unique ID of the membership to retrieve (the segment after 'members/' in the membership resource name, e.g. a numeric user ID, 'app', or the member's email address).
    space_idstringrequired
    The unique ID of the space (the segment after 'spaces/' in the space resource name)
    use_admin_accessboolean
    Run this request using the caller's Google Workspace administrator privilegesdefault false
  • googlechat_get_messageGet the full details of a single Google Chat message by its space and message ID.Read-only

    Get Message

    Get the full details of a single Google Chat message by its space and message ID. Returns the message's text, sender, thread, cards, and reaction summary. Use get_message when you already know the message ID; use list_messages or search_messages to find messages when you don't. Requires a valid Google Chat OAuth2 connection.

    Inputs

    message_idstringrequired
    The unique ID of the message (the segment after 'messages/' in the message resource name). If a custom ID was set when the message was created, use that custom ID here.
    space_idstringrequired
    The unique ID of the space the message belongs to (the segment after 'spaces/' in the space resource name)
    markup_syntaxstring
    Specifies the desired output syntax for the message's formatted_text field: Chat markup or Markdown (CommonMark-based).one of MARKUP_SYNTAX_UNSPECIFIEDMARKUP_SYNTAX_CHATMARKUP_SYNTAX_MARKDOWNdefault MARKUP_SYNTAX_UNSPECIFIED
  • googlechat_get_spaceGet details about a Google Chat space, including its display name, type, and access settings.Read-only

    Get Space

    Get details about a Google Chat space, including its display name, type, and access settings. Requires a valid Google Chat OAuth2 connection.

    Inputs

    space_idstringrequired
    The unique ID of the space (the segment after 'spaces/' in the space resource name)
    use_admin_accessboolean
    Run this request using the caller's Google Workspace administrator privilegesdefault false