Google Workspace

Connect Google Workspace

google_connect · Changes data · Markdown

Connects the company's Google Workspace through its own service account, for the mailboxes the agent may act as.

Free

This tool costs nothing to call.

An example

Connect our Google Workspace for support@ only.

Your agent callsgoogle_connectFree

The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.

With these arguments
{
  "mailboxes": [
    "support@halversoncycle.example"
  ]
}
What comes back
{
  "link": "https://conecto.chat/api/bots/connect/8cVkGiA8BjhsAtz4TP8RjAKJx8ZVuRWMfT3LfWXC5aw",
  "expires_in_minutes": 60,
  "tell_the_owner": "Open this link within the hour, sign in to Conecto and type the Google service account's JSON key there. It goes to Conecto only; I never see it.",
  "from_a_terminal": "npx @conecto-chat/cli@latest run google_connect -i '{\"mailboxes\": [\"support@halversoncycle.example\"]}' -s secret < key.json",
  "from_a_terminal_with_curl": "curl -sS -H \"Authorization: Bearer $CONECTO_KEY\" --data-urlencode secret@key.json https://conecto.chat/api/bots/connect/8cVkGiA8BjhsAtz4TP8RjAKJx8ZVuRWMfT3LfWXC5aw",
  "next": "When the owner types it on the link, account.credential_added (account_events) says so, with what google_connect answered."
}

Use it when

The company uses Gmail and Drive and wants the agent to work in them there.

What it does

Connect the company's own Google Workspace so the agent works in its Gmail, Google Calendar and Drive, which stay the source of truth. The company makes a service account in Google Cloud, and its Workspace admin gives the account's client ID domain-wide delegation for gmail.modify, calendar and drive. Give the mailboxes the agent may act as (it never acts as anyone else). Called without secret, it answers with a link for the owner, who pastes the account's JSON key on a Conecto page, so it never passes through the chat (from_a_terminal sends the key file from a terminal); account.credential_added says when it is connected. Each mailbox is checked before anything is kept. On accounts with an owner, cancelling events and replacing files wait for the owner's approval by default. Free.

What comes back

Without secret: link, a page where the owner or an admin, signed in, pastes the service account's JSON key, with expires_in_minutes, tell_the_owner, from_a_terminal (the CLI), from_a_terminal_with_curl and next. With secret: google_workspace, service_account, mailboxes and connected_at; need_approval, the tools that now wait for the owner. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
secretstringThe service account's JSON key. Never shown again. Leave it out to get the link instead. 50 to 10,000 characters.
mailboxesRequiredarray of stringsThe addresses the agent may act as, like support@ and sales@. 1 to 20 items.

The call

Over MCP, call google_connect on https://api.conecto.chat/mcp/googleworkspace. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/google_connect \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mailboxes":["support@halversoncycle.example"]}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
invalid_input400The key is not a service account key, or a mailbox is not an email address.Send the JSON key as Google Cloud downloads it, and 1 to 20 mailboxes.
vendor_rejected502Google refused the key's delegation for a mailbox.Give the key's client ID domain-wide delegation in the Admin console.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md