Gmail

Gmail MCP Integration

Read, search, and manage emails and labels via Gmail.

OAuth24 actions

Check my inbox for anything urgent from this week

Weldable's Gmail MCP integration gives your AI agents full access to your inbox, drafts, labels, threads, and account settings. Your agent can read, search, send, organize, and triage email through plain English commands. Connect once via OAuth and your agent gets 24 Gmail actions immediately, covering messages, labels, threads, drafts, and profile settings.

Gmail is one of the most universally used tools in any workflow, and the MCP protocol makes it possible for AI agents to interact with it programmatically without writing API code. Weldable handles token management, parameter mapping, and search query construction so your agent can focus on the task at hand.

Use cases

Daily inbox triage

Your agent runs Search messages with a query like newer_than:1d is:unread to pull everything that arrived overnight. It reads each message with Get message, categorizes them by sender and subject, and uses Modify labels to mark low-priority newsletters as read while flagging urgent items with a star. For anything that needs no response, it archives by removing the INBOX label. A 30-minute morning ritual becomes a 30-second workflow.

Invoice and receipt tracking

Tell your agent to Search messages for subject:invoice has:attachment newer_than:30d and it returns every invoice from the past month. It can then use Get attachment to pull the PDF files, read the amounts from each message body, and compile a summary. Pair this with Google Sheets to log each invoice in a tracking spreadsheet automatically. Useful at month-end when finance needs a complete picture.

Email drafting from context

Your agent reads a thread with Get thread to understand the full conversation history, then composes a contextual reply using Send email. It can also stage responses using draft actions: create a batch of replies, let you review them via List drafts and Get draft, and then fire them off with Send draft when you approve. This works well for customer support queues where tone and accuracy matter but speed is critical.

Vacation responder management

Before you leave for a trip, tell your agent to use Update vacation settings to enable the auto-reply with a custom message, start date, and end date. It can restrict replies to contacts only or limit them to people in your organization. When you return, a single command turns it off. Your agent can also use Get vacation settings to check the current state before making changes. No more digging through Gmail settings menus.

Thread summarization

Your agent uses List threads with a search filter to find active conversations on a specific topic, then calls Get thread for each one to pull the full message history. It reads through the back-and-forth, extracts key decisions and action items, and posts a summary to Slack or saves it to Google Docs. Ideal for catching up after being out of the loop on a long-running discussion.

How it works

Connect your Google account through a one-click OAuth flow. Weldable requests Gmail permissions to read and send messages, manage labels, and access settings. Tokens refresh automatically, so you never deal with expired credentials.

Once connected, talk to your agent naturally. Say "find all unread emails from Sarah this week" and Weldable translates that into the right Gmail search query, calls Search messages with the appropriate q parameter, and returns matching results. Your agent can chain actions together: search for messages, read the important ones, archive the rest, and post a summary to Slack.

Label operations work the same way. "Create a label called Needs Review" triggers Create label, and "move these three emails to Needs Review" uses Batch modify messages to apply the label in a single call. Thread-level actions like Modify thread labels and Trash thread operate on entire conversations at once, keeping your inbox consistent.

Tips

Gmail search operators are your most powerful tool. The q parameter on Search messages, List messages, and List threads accepts the same operators you use in the Gmail search bar: from:, to:, subject:, has:attachment, is:unread, in:sent, and label:. Combine them freely: from:boss@company.com subject:Q2 has:attachment newer_than:7d.

System label IDs are uppercase strings. When working with Modify labels or Batch modify messages, use INBOX, SENT, TRASH, UNREAD, STARRED, IMPORTANT, and SPAM. These are not the display names you see in Gmail's sidebar; they are fixed API identifiers.

Archiving is a label removal, not a separate action. Gmail has no "archive" API call. To archive a message, use Modify labels with removeLabelIds: ["INBOX"]. The message stays in All Mail and any other labels it carries. Your agent handles this automatically when you say "archive," but knowing the mechanism helps when building workflows.

Use newer_than: for relative date filtering. Instead of calculating epoch timestamps, pass newer_than:1d, newer_than:2w, or newer_than:3m in search queries. This keeps your scheduled workflows stable without needing to compute dates dynamically.

Batch modify messages saves round trips. When you need to mark 20 emails as read or archive a set of search results, use Batch modify messages with an array of message IDs instead of calling Modify labels 20 times. It accepts the same addLabelIds and removeLabelIds parameters but applies them to every message in the batch.

Custom labels with spaces require exact casing. If you created a label called "Client Projects" in Gmail, the API expects that exact string when filtering by label:Client Projects. Mismatched capitalization or missing spaces will return zero results. Use List labels to confirm the exact name before filtering.


What you can do with Gmail

24 actions available. Tell your AI agent what you need in plain English.

List messages

Browse recent emails in your inbox or a label.

Get message

Get a single email message by its ID. Returns full content, metadata, or headers.

Search messages

Search across all your email using Gmail's search syntax (e.g., from:boss@company.com, subject:invoice, has:attachment).

Send email

Compose and send an email message.

Modify labels (mark as read, star, archive)

Add or remove labels on an email to mark it as read, star it, archive it, move it to a folder, and more.

Delete email (move to trash)

Delete an email by moving it to the trash.

Restore from trash

Recover a message that was moved to the trash.

Batch modify messages

Add or remove labels on multiple messages at once.

Get attachment

Download the data of a file attached to an email.


Frequently asked questions


Works well with

Connect your agent to Gmail

Connect your Gmail account and start automating with AI agents in minutes. Free to use, no credit card required.