Gmail connector

Send, search, read, and reply to Gmail messages, and send approval emails, from AgentRuntime workflows.

On this page

The gmail connector lets workflows use a Google account's Gmail through the Gmail API. Send notifications and reports, search the inbox, read messages and threads, draft or send replies, and email people an Approve or Disapprove button.

Prerequisites

  • A Google account that can use Gmail.
  • A Google account connection in AgentRuntime with the Gmail service ticked. See Google Workspace.
  • The project_contributor role or higher in your workspace, which lets you manage connections and MCP instances. See Roles and permissions.

Connect in AgentRuntime

  1. Sign in with Google

    Go to Connections. In the Accounts section, click Sign in with Google. Enter a display name, tick Gmail (and any other Google services you plan to use), click Continue to Google, and approve the permissions. If you already connected a Google account with this service ticked, skip this step. If Sign in with Google is missing or Continue to Google is disabled, Google sign-in is not set up for your workspace: contact support. See Connections.

  2. Add the connector to your workspace

    Click MCP in the sidebar, then Add connectors. Find Gmail in the App catalog, select it, and click Add to workspace. The instance now appears on the MCP connectors page. See MCP instances.

  3. Attach your Google account to a profile

    Open the new instance to reach Instance config. Under Profiles for this connector, click New profile, enter a Display name, and on the Use a saved connection tab choose your Google account under Which connection?. Set Status to Active — can be used in workflows, click Save, then click Use this profile for workflows. You do not enter tokens yourself.

  4. Test it

    In Workflow Studio, add the gmail_get_profile tool from your Gmail instance (use Browse platform MCP if it is not listed), fill in its arguments, and run the workflow. A successful step means the connection works. It returns the signed-in Gmail address.

What you can build

  • Run notifications. After a workflow finishes or fails, gmail_send_email tells the team with the run details.
  • Inbox triage. gmail_search_emails finds unread support mail, an LLM step drafts a reply, a Human step approves it, and gmail_reply_to_email sends it.
  • Approvals by email. gmail_request_approval_in_email sends a message with Approve and Disapprove buttons that open the URLs you provide.
  • Digest reports. Data from a database or a sheet is summarized by an LLM and sent on a schedule.

Tools

The Required arguments column lists the fields the tool's input schema marks as required. Some of them are optional in practice; if you have nothing to set, pass an empty value such as "", [], {}, or false.

These are the Gmail tools published to workspaces today. Other Gmail actions, such as managing labels, are not available yet.

ToolAccessWhat it doesRequired arguments
gmail_create_draft_replyWriteCreate a draft reply to an existing Gmail message without sending it.message_id
gmail_get_attachmentReadDownload a Gmail message attachment by ID.message_id, attachment_id, file_name
gmail_get_emailReadGet a Gmail message by message ID and return its metadata.message_id
gmail_get_email_fullReadGet a Gmail message with full body text or HTML and attachment metadata.message_id
gmail_get_profileReadGet Gmail profile information for the authenticated user.—
gmail_get_threadReadGet a Gmail thread by thread ID and return metadata for its messages.thread_id
gmail_list_historyReadList Gmail mailbox change history since a start history ID for polling-based sync.start_history_id
gmail_list_threadsReadList Gmail threads with optional search query.—
gmail_reply_to_emailWriteReply to an existing Gmail message, optionally replying to all recipients.message_id, body
gmail_request_approval_in_emailWriteSend an HTML approval-request email with Approve and Disapprove buttons.to, subject, body, approve_url, disapprove_url
gmail_search_emailsReadSearch Gmail messages using Gmail search syntax.query
gmail_send_emailWriteSend an email through a Gmail account.to, subject, body

Example

Send a notification after a workflow completes. to is a list of addresses. body_type is plain (default) or html.

{
  "id": "notify-team",
  "type": "mcp",
  "name": "Send summary email",
  "tool_name": "gmail_send_email",
  "tool_args": {
    "to": [
      "team@example.com"
    ],
    "subject": "Workflow complete: {{input.workflow_name}}",
    "body": "Run {{input.run_id}} finished successfully."
  },
  "depends_on": [
    "generate-summary"
  ],
  "timeout_s": 30
}

Configuration

Google connectors take no keys from you: the permissions come from your Google account connection.

Google permissions (scopes) requested when you tick this service:

  • https://www.googleapis.com/auth/gmail.modify

Signing in also requests openid and https://www.googleapis.com/auth/userinfo.email so AgentRuntime can tell which Google account signed in.

Optional settings on the profile:

KeyDescription
gmail_user_idGmail user ID for API paths. me means the signed-in account.
gmail_sender_emailVerified sender address used in the From header on send and reply tools.

Troubleshooting

ProblemWhat to do
Empty search resultsTest the same query in Gmail. query uses Gmail search syntax, for example from:user@example.com is:unread subject:hello. max_results defaults to 10 and is at most 100.
The From address is not what you expectThe From address comes from the optional gmail_sender_email setting, not from tool arguments. Set it to a verified sender address if you need a specific one.
403 from GmailThe account connection may not include Gmail. Open the account, click Update permissions, and tick Gmail.
Google access stopped workingOpen Connections, open the Google account, and click Reconnect. If you removed a permission, click Update permissions and tick the service again.
Edit this pageagentruntime-io/agentruntime-docs