Agent Connector

Connect your agents to Gmail

Production-ready access to your Gmail data with managed auth, parametric control, and the reliability your agents need to actually work.

Installation & Usage

Get start with the Gmail connector in minutes.

[01]

Install Package

Using uv or pip

BASH

Copy
uv pip install airbyte-agent-gmail

[02]

Import

Initialize and use

PYTHON

Copy
from airbyte_agent_gmail import GmailConnector
from airbyte_agent_gmail.models import GmailAuthConfig

connector = GmailConnector(
    auth_config=GmailAuthConfig(
        access_token="<Your Google OAuth2 Access Token (optional, will be obtained via refresh)>",
        refresh_token="<Your Google OAuth2 Refresh Token>",
        client_id="<Your Google OAuth2 Client ID>",
        client_secret="<Your Google OAuth2 Client Secret>"
    )
)

[03]

Tool

Add tools to your agent

python

Copy
@agent.tool_plain # assumes you're using Pydantic AI
@GmailConnector.tool_utils
async def gmail_execute(entity: str, action: str, params: dict | None = None):
    return await connector.execute(entity, action, params or {})

Supported Entities & Actions

Access all your Gmail data through a unified API

Lorem ipsum

Lorem ipsum

| Entity | Actions |\n|--------|---------|\n| Profile | [Get](./REFERENCE.md#profile-get) |\n| Messages | [List](./REFERENCE.md#messages-list), [Get](./REFERENCE.md#messages-get), [Create](./REFERENCE.md#messages-create), [Update](./REFERENCE.md#messages-update) |\n| Labels | [List](./REFERENCE.md#labels-list), [Create](./REFERENCE.md#labels-create), [Get](./REFERENCE.md#labels-get), [Update](./REFERENCE.md#labels-update), [Delete](./REFERENCE.md#labels-delete) |\n| Drafts | [List](./REFERENCE.md#drafts-list), [Create](./REFERENCE.md#drafts-create), [Get](./REFERENCE.md#drafts-get), [Update](./REFERENCE.md#drafts-update), [Delete](./REFERENCE.md#drafts-delete) |\n| Drafts Send | [Create](./REFERENCE.md#drafts-send-create) |\n| Threads | [List](./REFERENCE.md#threads-list), [Get](./REFERENCE.md#threads-get) |\n| Messages Trash | [Create](./REFERENCE.md#messages-trash-create) |\n| Messages Untrash | [Create](./REFERENCE.md#messages-untrash-create) |

Example Prompts

The Gmail connector is optimized to handle prompts like these

Lorem ipsum

List my recent emails - Show me unread messages in my inbox - Get the details of a specific email - List all my Gmail labels - Show me details for a specific label - List my email drafts - Get the content of a specific draft - List my email threads - Show me the full thread for a conversation - Get my Gmail profile information - Send an email to someone - Create a new email draft - Archive a message by removing the INBOX label - Mark a message as read - Mark a message as unread - Move a message to trash - Create a new label - Update a label name or settings - Delete a label - Search for messages matching a query - Find emails from a specific sender - Show me emails with attachments

Why Airbyte for AI Agents?

Built for production AI workloads with enterprise-grade reliability

Secure Authentication

Built-in OAuth 2.0 handling with automatic token refresh. No hard-coded credentials.

Agent-Native Design
Heading

Structured, LLM-friendly schemas optimized for AI agent consumption with natural language query support.

Production Ready

Battle-tested connectors with comprehensive error handling, logging, and retry logic.

Open Source

Fully open source under the MIT license. Contribute, customize, and extend freely.

Works with your favorite frameworks

Use the Salesforce connector with any AI agent framework.

LangChain

CrewAI

LlamaIndex

AutoGen

OpenAI Agents SDK

Claude Agents SDK

Frequently Asked Questions

Didn't find your answer? Please don't hesitate to reach out.

How do I authenticate with Gmail?

The Gmail connector supports Google OAuth2 authentication. You provide an access token (optional, obtained via refresh), a refresh token, a client ID, and a client secret. Alternatively, in hosted mode, credentials are stored securely in Airbyte Cloud and you authenticate using your Airbyte client credentials.

Can I use this connector with any AI agent framework?

The connector is compatible with any Python-based AI agent framework including LangChain, LlamaIndex, CrewAI, Pydantic AI, and custom implementations.

Does this connector support write operations?

Yes, the Gmail connector supports write operations. It can send messages, create and update drafts, modify message labels (e.g., mark as read/unread, archive), move messages to/from trash, and create, update, or delete labels.

How is this different from the Airbyte data connector?

Agent connectors are specifically designed for AI agents and LLM applications. They provide natural language interfaces, optimized response formats, and seamless integration with agent frameworks, unlike traditional ETL-focused connectors.

Ready to connect your AI agents to Gmail?

Get started in minutes with our open-source connector.