melso
AutomationUse casesChangelog
Start your business
Hermes and Gmail

Connect Hermes to Gmail

Give your Hermes agent access to Gmail in Melso — 61 tools it can call while it works through a task.

Set it up in Melso

  1. 1In Melso, open Settings → Agent Apps and hit Connect on Gmail.
  2. 2Finish the OAUTH2 sign-in in the window that opens. Melso stores the connection, not your credentials.
  3. 3Open your Hermes agent, go to its Agent Apps tab, and allow Gmail.
  4. 4Give the agent a task. It calls Gmail itself when the work needs it.
Get Melso
What you get

What Gmail gives your agent

The tools, permissions, and events Gmail exposes — the same ones your agent can use once the app is authorized.

What you sign in with

Gmail connects with OAUTH2.

  • Client id
  • Client secret

Permissions

https://www.googleapis.com/auth/userinfo.profilehttps://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/contacts.readonlyhttps://www.googleapis.com/auth/contacts.other.readonlyhttps://www.googleapis.com/auth/profile.language.readhttps://www.googleapis.com/auth/user.addresses.readhttps://www.googleapis.com/auth/user.birthday.readhttps://www.googleapis.com/auth/user.emails.readhttps://www.googleapis.com/auth/user.phonenumbers.readhttps://www.googleapis.com/auth/profile.emails.read

Tools Gmail exposes

GMAIL_ADD_LABEL_TO_EMAIL

Modify email labels

Adds and/or removes specified Gmail labels for a message; ensure `message_id` and all `label_ids` are valid (use 'listLabels' for custom label IDs).

GMAIL_BATCH_DELETE_MESSAGES

Batch delete Gmail messages

Tool to permanently delete multiple Gmail messages in bulk, bypassing Trash with no recovery possible. Use when you need to efficiently remove large numbers of emails (e.g., retention enforcement, mailbox hygiene). Use GMAIL_MOVE_TO_TRASH instead when reversibility may be needed. Always obtain explicit user confirmation and verify a sample of message IDs before executing. High-volume calls may trigger 429 rateLimitExceeded or 403 userRateLimitExceeded errors; apply exponential backoff.

GMAIL_BATCH_MODIFY_MESSAGES

Batch modify Gmail messages

Modify labels on multiple Gmail messages in one efficient API call. Supports up to 1,000 messages per request for bulk operations like archiving, marking as read/unread, or applying custom labels. High-volume calls may return 429 rateLimitExceeded or 403 userRateLimitExceeded; apply exponential backoff.

GMAIL_CREATE_EMAIL_DRAFT

Create email draft

Creates a Gmail email draft. While all fields are optional per the Gmail API, practical validation requires at least one of recipient_email, cc, or bcc and at least one of subject or body. Supports To/Cc/Bcc recipients, subject, plain/HTML body (ensure `is_html=True` for HTML), attachments, and threading. Returns a draft_id that must be used as-is with GMAIL_SEND_DRAFT — synthetic or stale IDs will fail. When creating a draft reply to an existing thread (thread_id provided), leave subject empty to stay in the same thread; setting a subject will create a NEW thread instead. HTTP 429 may occur on rapid creation/send sequences; apply exponential backoff.

GMAIL_CREATE_FILTER

Create Gmail filter

Tool to create a new Gmail filter with specified criteria and actions. Use when the user wants to automatically organize incoming messages based on sender, subject, size, or other criteria. Note: you can only create a maximum of 1,000 filters per account.

GMAIL_CREATE_LABEL

Create label

Creates a new label with a unique name in the specified user's Gmail account. Returns a labelId (e.g., 'Label_123') required for downstream tools like GMAIL_ADD_LABEL_TO_EMAIL, GMAIL_BATCH_MODIFY_MESSAGES, and GMAIL_MODIFY_THREAD_LABELS — those tools do not accept display names.

GMAIL_CREATE_PROMPT_POST

Create Prompt Post

Send a one-shot prompt to the Sanity Content Agent. Stateless one-shot prompt endpoint. No thread management or message persistence. Ideal for simple, single-turn interactions. Use when you need to send a single prompt and receive a response without maintaining conversation context.

GMAIL_DELETE_DRAFT

Delete Draft

Permanently deletes a specific Gmail draft using its ID with no recovery possible; verify the correct `draft_id` and obtain explicit user confirmation before calling. Ensure the draft exists and the user has necessary permissions for the given `user_id`.

Events your agent can react to

GMAIL_EMAIL_SENT_TRIGGER

Email Sent

Triggers when a Gmail message is sent by the authenticated user. It polls the 'SENT' label and emits metadata including sender, recipients, subject, timestamp, and thread ID.

GMAIL_NEW_GMAIL_MESSAGE

New Gmail Message Received Trigger

Triggers when a new message is received in Gmail.

Example prompts

  • Use Gmail to check recent changes and summarize them in the issue.
  • When a customer writes in, pull their data from Gmail before replying.
  • Audit our open items in Gmail and notify the channel of anything stale.

Useful links

  • Gmail website
  • Melso Agent Apps docs

More in Email

  • Gmail
  • Outlook
  • Yandex
  • Zoho Mail
  • Agent Mail
melso

Run your company with AI agents.

Start your business

Product

  • Home
  • Automation
  • Melso vs Polsia
  • Use cases
  • Changelog
  • Download

Resources

    Company

    • About
    • Contact Sales

    © 2026 Melso. All rights reserved.