GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Apps
  • Docs
  • Pricing
  • Contact us
  • Log in
  • Sign up
  • Visit Gmail ↗
  • View as Markdown

This view

  • Original page
  • New address

GeezerVison is showing pipedream.com — Build with Gmail and Pipedream Connect

MCP

Give your agent Gmail tools #

Every Gmail action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Gmail account for each tool call — you store no tokens.

Pipedream Connect
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": "{project_id}",
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "gmail",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Add Label to Email:
const result = await mcp.callTool({
  name: "gmail-add-label-to-email",
  arguments: {
    message: "Message",
    addLabelIds: ["Labels"],
  },
})
# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
    "Authorization": f"Bearer {access_token}",
    "x-pd-project-id": "{project_id}",
    "x-pd-environment": "production",
    "x-pd-external-user-id": "{external_user_id}",  # any stable ID for this user in your system
    "x-pd-app-slug": "gmail",
}

async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
    async with ClientSession(read, write) as session:
        await session.initialize()
        tools = await session.list_tools()

        # e.g. run Add Label to Email:
        result = await session.call_tool("gmail-add-label-to-email", {
            "message": "Message",
            "addLabelIds": ["Labels"],
        })
MCP guide →

API PROXY

Call the Gmail API directly #

For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Gmail API with the connected user's credentials attached. You store no tokens and write no refresh logic.

Pipedream Connect
const resp = await pd.proxy.get({
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  accountId: "apn_xxxxxxx",
  url: "https://www.googleapis.com/oauth2/v1/userinfo",
})

// Any allowed Gmail endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.
# The path segment is the target URL, URL-safe base64 encoded:
# https://www.googleapis.com/oauth2/v1/userinfo

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3YxL3VzZXJpbmZv?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
API proxy guide →

SDK

Run Gmail actions from your backend #

Connect a user's Gmail account once, then run Add Label to Email on their behalf from your own code — TypeScript, Python, or plain HTTP.

Pipedream Connect
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "gmail-add-label-to-email",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    gmail: { authProvisionId: "apn_xxxxxxx" },
    message: "Message",
    addLabelIds: ["Labels"],
  },
})
from pipedream import Pipedream

pd = Pipedream(
    client_id="{oauth_client_id}",
    client_secret="{oauth_client_secret}",
    project_id="{project_id}",
    project_environment="production",
)

result = pd.actions.run(
    id="gmail-add-label-to-email",
    external_user_id="{external_user_id}",  # any stable ID for this user in your system
    configured_props={
        "gmail": {"authProvisionId": "apn_xxxxxxx"},
        "message": "Message",
        "addLabelIds": ["Labels"],
    },
)
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "gmail-add-label-to-email",
    "configured_props": {
      "gmail": { "authProvisionId": "apn_xxxxxxx" },
      "message": "Message",
      "addLabelIds": ["Labels"]
    }
  }'
Managed auth guide → Tools guide →

TOOLS

Gmail actions #

On-demand operations your product or agent can configure and run on behalf of a connected user.

  • Add Label to Email

    action
    Add label(s) to an email message. See the docs
    Writev0.0.16 →
  • Archive Email

    action
    Archive an email message. See the documentation
    Writev0.0.11 →
  • Bulk Archive Emails

    action
    Archive multiple emails at once. See the documentation
    Writev0.0.1 →
  • Create Draft

    action
    Create an unsent draft in the authenticated Gmail account. Same parameter shape as Send Email — the difference is the message is saved to Drafts instead of being sent. For a reply-draft, pass inReplyToMessageId (from Find Emails / Get Thread); the subject, References, In-Reply-To, and threadId are derived from the referenced message. bodyType controls whether body is treated as plain text (default) or HTML. To draft to yourself, pass "me" in to — the action resolves it to the authenticated user's email address. No pre-call to Get Current User required. Attachments use file-ref inputs and require matching attachmentFilenames[] entries. See the documentation.
    Writev0.2.4 →
  • Create Filter

    action
    Create a Gmail filter that automatically acts on incoming mail matching the given criteria. Provide at least one criterion and at least one action. Criteria are combined with AND: a message must match every criterion you set. Actions apply only to mail that arrives after the filter is created; existing messages are not touched. Example — skip the inbox for cancelled-event notices that were not on the user's calendar: from = [email protected], query = "This event has been canceled", negatedQuery = "removed from your calendar", removeLabelIds = ["INBOX"]. Label IDs must be IDs, not names — use List Labels to resolve a label name to its ID (system labels like INBOX, STARRED, UNREAD, TRASH can be used directly). Use List Filters first to avoid creating duplicates. See the documentation.
    Writev0.0.1 →
  • Create Label

    action
    Create a new user label in the authenticated Gmail mailbox and return its ID. Call this before Modify Labels whenever the label the user wants to apply doesn't yet exist — List Labels will tell you what's already there. Idempotent: if a label with the same name already exists, the action swallows the 409, looks it up by name, and returns the existing label with alreadyExisted: true so the caller can proceed. Nested labels are expressed with / — e.g. Clients/Acme creates or targets a sub-label under Clients. color is optional; when provided, both textColor and backgroundColor must be supplied together and must come from Gmail's fixed palette. See the documentation.
    Writev0.1.4 →
  • Delete Email

    action
    Moves the specified message to the trash. See the documentation
    Writev0.0.5 →
  • Delete Filter

    action
    Permanently delete a Gmail filter from the authenticated user's settings. Mail already processed by the filter is not changed; the filter simply stops applying to future incoming mail. The Gmail API deletes by filter ID — call List Filters first to find the id of the filter to remove. See the documentation.
    Writev0.0.1 →
  • Delete Label

    action
    Immediately and permanently delete a user-created label from the authenticated Gmail mailbox, removing it from every message and thread it was applied to. Only user-created labels can be deleted — Gmail's built-in system labels (INBOX, SENT, SPAM, TRASH, etc.) cannot. This deletes the label definition itself; to merely detach a label from specific messages without removing it, use Modify Labels with removeLabels instead. See the documentation.
    Writev0.0.4 →
  • Download Attachment

    action
    Download a Gmail message attachment to /tmp and return its path + metadata. File Stash syncs the file and exposes a presigned download URL so the caller can retrieve it. Call Find Emails with fields: ["subject", "attachments"], or Get Thread, first: each returned message lists its attachments as attachments: [{ partId, filename, mimeType, size }]. Pass the message's id as messageId and the attachment's partId as partId. This works for any message size, including large HTML emails whose payload is too big to return. Alternatively pass attachmentId from a message's payload.parts[].body.attachmentId. Provide partId or attachmentId; when both are given, partId is used. When only attachmentId is given, Gmail issues a new one for the same part on every read, so the filename and MIME type are resolved separately: by partId, then by a unique filename-and-size match, then by a unique size match. If none resolve, the file is saved as attachment-<id> with an extension detected from its contents. If filename is omitted, the action uses the attachment's own filename from the message. Set convertToPdf: true to convert image / HTML / plain-text / DOCX attachments to PDF during download; other MIME types are rejected. See the documentation.
    Read-onlyv0.3.0 →
  • Find Emails

    action
    Search the user's Gmail mailbox with Gmail's native query syntax and return matching messages (headers + snippet by default; full bodies when requested). Use this tool for every "find", "search", "list my", or "show me" email intent. The q parameter accepts the full Gmail search operator set — combine operators freely: from:[email protected] is:unread newer_than:7d has:attachment subject:"DNA sequences". Common operators: from:, to:, subject:, has:attachment, filename:pdf, is:unread, is:starred, label:INBOX, newer_than:7d, older_than:1m, after:2025/01/01, before:2025/12/31, category:primary. labelIds accepts either raw label IDs (INBOX, STARRED) or user-visible names (Clients/Acme) — names are resolved server-side via List Labels. Each returned message carries id, threadId, labelIds, the decoded subject/sender/recipient/date, and a snippet. With format: "full" the decoded payload and an attachments list are also included, or feed threadId into Get Thread for the whole conversation. To download an attachment, request ["subject", "attachments"]: attachments is a derived field listing every attachment as { partId, filename, mimeType, size } (nested parts included), and requesting it fetches full messages for you. Pass the message id as messageId and the partId to Download Attachment. Prefer it over payload, which on a large HTML email can exceed the response cap and get the whole message dropped. Set fields on every call to name just what you need — message records are large, and a wide search returns tens of thousands of characters that crowd out the rest of the task. id and threadId are always returned. To BROWSE or COUNT, use ["subject", "sender", "date"]. To READ or SUMMARISE — "catch me up", "what did X say about Y", "is there anything I need to reply to" — use ["subject", "sender", "date", "bodyText"]. bodyText is the decoded plain-text body (HTML converted, MIME scaffolding and attachments stripped), about half the size of the raw payload, and requesting it fetches full messages for you. Notification and marketing mail is mostly tracking links: pass includeLinks: false to read it, and keep the default only when you need a URL from the email. Never answer a question about what an email SAYS from snippet — it is a fixed ~200-character prefix, so the sentence you need is usually past its end, and nothing in a snippet indicates that it was cut. Where the snippet is all you asked for and content was likely cut, the message carries snippetTruncated: true. format stays metadata unless you need the raw MIME tree, in which case pass format: "full" and request payload. Responses are capped. Over the cap: if you named fields, whole messages are dropped rather than your chosen fields being removed, and the note says how many of how many are shown — narrow q and retry. If you named none, messages are compacted instead so counts stay accurate. bodyText shrinks toward a floor before anything is dropped, flagging each cut message with bodyTruncated: true. For the search syntax, see Gmail search operators. See the documentation.
    Read-onlyv0.5.0 →
  • Get Current User

    action
    Returns the authenticated Gmail user's name, email address, and mailbox stats (total messages and threads). Call this first when the user says 'my emails', 'my inbox', or needs identity context. Use the returned emailAddress to identify the user's own messages in Find Emails results. See the documentation.
    Read-onlyv0.0.6 →
  • Get Send As Alias

    action
    Get a send as alias for the authenticated user. See the documentation
    Read-onlyv0.0.9 →
  • Get Thread

    action
    Fetch an entire Gmail thread (conversation) by thread ID — returns every message in order with headers, decoded body text, and attachment metadata. Use this after Find Emails when the user wants the full conversation rather than a single message. Each result from Find Emails includes a threadId you can pass here. With format: full (default) each message includes decoded text/html bodies and an attachments list of { partId, filename, mimeType, size } (nested parts included). To download one, pass the message id as messageId and the partId to Download Attachment. Use format: metadata to skip bodies and get only headers + labelIds — useful for large threads. Responses are capped. An oversized thread is served as text: each message keeps subject, sender, recipient, date, attachments, and a decoded plain-text bodyText in place of payload, shortened toward a floor if needed (cut messages carry bodyTruncated: true and bodyTotalChars). Only if that still does not fit does it fall back to metadata (headers, labelIds, and attachments), then drop messages from the tail. Every fallback sets truncated, servedFormat, and a note. Pass includeLinks: false to drop link URLs and images from the decoded text, which keeps notification and newsletter threads far smaller. See the documentation.
    Read-onlyv0.4.0 →
  • List Filters

    action
    List every filter configured in the authenticated user's Gmail settings, including each filter's id, criteria (what it matches) and action (what it does to matching mail). Call this before Delete Filter to find the id of the filter to remove, or before Create Filter to check whether an equivalent filter already exists. Returns an empty filter list (or no filter key) when the user has no filters. See the documentation.
    Read-onlyv0.0.1 →
  • List Labels

    action
    List every label in the authenticated user's mailbox (system labels like INBOX, SENT, TRASH, STARRED, UNREAD and user-created labels). Call this before Modify Labels or Find Emails when you need to target a label that the user named rather than an obvious system label — it resolves a name like Clients/Acme to its opaque label ID. User labels are returned first, then system labels. See the documentation.
    Read-onlyv0.1.4 →
  • List Send as a Delegate Options

    action
    Retrieves available options for the Send as a Delegate field.
    Read-onlyv0.0.5 →
  • List Send As Aliases

    action
    List all send as aliases for the authenticated user. See the documentation
    Read-onlyv0.0.9 →
  • List Signature Options

    action
    Retrieves available options for the Signature field.
    Read-onlyv0.0.5 →
  • Modify Labels

    action

    Add and/or remove labels on one or more Gmail messages in a single call. In Gmail, most inbox-state operations are label mutations under the hood, so this one tool covers archive / trash / untrash / star / unstar / mark-read / mark-unread / apply-label / remove-label.

    Use this whenever the user asks you to star, unstar, flag, archive, file, sort, label, tag, categorise, move, trash, delete, restore, or mark mail as read or unread — there is no separate tool for any of those. Pair it with Find Emails to turn a description of the mail ("the invoice from billing", "everything from last week") into the messageIds this tool needs. Apply it even when some messages already carry the target state: the operation is idempotent, and the user asked for an outcome, not a diff.

    Do NOT use this to set up filters, rules, or any automation that applies to mail that has not arrived yet. This tool labels messages that already exist, one batch at a time. Gmail filters, auto-forwarding, and the vacation responder are settings-level features with no action in this set — if the user asks to "automatically label incoming mail", "skip the inbox from now on", or "set up a rule", say so outright rather than gathering criteria you cannot act on, and point them at Gmail's own settings.

    ⚠️ Trashing is destructive — confirm before you do it. Adding TRASH removes mail from the mailbox, and nothing in this tool set can permanently delete or restore in bulk beyond untrashing. When the request would trash mail the user did not enumerate individually ("trash everything from X", "clear out this label", "delete the old ones"), first say how many messages match and what they are, and get explicit confirmation. Every other operation here is safely reversible and needs no confirmation.

    Common recipes (pass these in addLabels / removeLabels):

    • Archive → removeLabels: ["INBOX"]
    • Move to trash → addLabels: ["TRASH"]
    • Untrash (restore) → removeLabels: ["TRASH"], addLabels: ["INBOX"]
    • Star → addLabels: ["STARRED"]
    • Unstar → removeLabels: ["STARRED"]
    • Mark read → removeLabels: ["UNREAD"]
    • Mark unread → addLabels: ["UNREAD"]
    • Apply a user label → addLabels: ["Clients/Acme"] (pass the name or the label ID)
    • Apply user label AND archive → addLabels: ["Clients/Acme"], removeLabels: ["INBOX"]

    addLabels and removeLabels accept either raw label IDs (system labels like INBOX, STARRED, UNREAD, TRASH) or user-visible label names — names are resolved via List Labels before the API call. Use Create Label first if you need to apply a brand-new label that doesn't yet exist. See the documentation.

    Writev0.0.5 →
  • Remove Label from Email

    action
    Remove label(s) from an email message. See the docs
    Writev0.0.14 →
  • Send Email

    action
    Send a new email OR reply to an existing thread from the authenticated Gmail account. For a fresh message, set to/subject/body; leave inReplyToMessageId blank. To reply to a thread, pass the id of any message in that thread as inReplyToMessageId — the tool preserves threading (References, In-Reply-To, threadId) and auto-prefixes Re: on the subject. Use Find Emails or Get Thread to locate the message ID. Set replyAll: true to fan-out to the original From/To/Cc (minus the user's own address); otherwise only the original sender is addressed. bodyType controls whether body is treated as plain text (default) or HTML. To send to yourself, pass "me" in to — the action resolves it to the authenticated user's email address. No pre-call to Get Current User required. Attachments: for small inline content (the common case in MCP / cloud runs), set attachmentContent to the file's text contents and attachmentFilename to its name. For files already on disk (Pipedream workflows, File Stash), use attachments[] + attachmentFilenames[] instead. See the documentation.
    Writev0.3.4 →
  • Update Signature for Email in Organization

    action
    Update the signature for a specific email address in an organization. A Google Cloud service account with delegated domain-wide authority is required for this action. See the documentation
    Writev0.0.20 →
  • Update Signature for Primary Email Address

    action
    Update the signature for the primary email address. See the documentation
    Writev0.0.19 →

EVENTS

Gmail triggers #

Event sources your backend can deploy for users and receive through a webhook.

  • New Attachment Received

    trigger
    Emit new event for each attachment in a message received. This source is capped at 100 max new messages per run.
    v0.2.10 →
  • New Email Matching Search

    trigger
    Emit new event when an email matching the search criteria is received. This source is capped at 100 max new messages per run.
    v0.1.10 →
  • New Email Received

    trigger
    Emit new event when a new email is received.
    v0.3.10 →
  • New Labeled Email

    trigger
    Emit new event when a new email is labeled.
    v0.1.10 →
  • New Sent Email

    trigger
    Emit new event for each new email sent. (Maximum of 100 events emited per execution)
    v0.1.10 →

MULTI-APP

Use Gmail with other popular apps #

Most products don't stop at one integration. Pair Gmail with the other apps your users rely on, and ship use cases that span both.

Google Calendar icon Google Calendar With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next. Google Drive icon Google Drive Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere. Google Sheets icon Google Sheets Use Google Sheets to create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device. Notion icon Notion Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team. Google Docs icon Google Docs Use Google Docs to create, edit and collaborate on online documents. GitHub icon GitHub Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world. HubSpot icon HubSpot HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business. Linear icon Linear Linear helps streamline software projects, sprints, tasks, and bug tracking. It's built for high-performance teams. YouTube Data icon YouTube Data With the YouTube Data API, you can add a variety of YouTube features to your application. Use the API to upload videos, manage playlists and subscriptions, update channel settings, and more. Stripe icon Stripe Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes. Airtable icon Airtable Airtable is a low-code platform to build next-gen apps. Move beyond rigid tools, operationalize your critical data, and reimagine workflows with AI. Google Ads icon Google Ads Reach customers wherever they are. Show up at the right time and place across the vast Google Ads ecosystem.

REFERENCE

App details #

Reference metadata for the Gmail connector in the Pipedream registry.

App slug
gmail
Authentication
OAuth
Categories
Communication
Actions
24
Triggers
5
API proxy
Available

OAuth scopes

These are the scopes Pipedream's managed Gmail OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.

  • https://www.googleapis.com/auth/gmail.labels
  • https://www.googleapis.com/auth/gmail.send
  • https://www.googleapis.com/auth/gmail.modify
  • https://www.googleapis.com/auth/gmail.compose
  • https://www.googleapis.com/auth/gmail.settings.basic
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.