app icon
Gmail
0.2.2

Dify's integration with Gmail that can help you read, send, list, draft, and manage Gmail emails with OAuth2.0 authentication.

langgenius/dify-gmail3055 インストール

Dify Gmail Plugin

A comprehensive Gmail integration plugin for Dify that provides essential mail-related actions using OAuth2.0 authentication. This plugin extends beyond basic email reading to offer a complete Gmail management solution.

Features

Email Management

  • Get Message Details: Retrieve detailed information about specific emails including headers, body, and attachments
  • Search Messages: Advanced Gmail search using Gmail's powerful search syntax and operators

Email Composition & Sending

  • Send Message: Send emails directly with recipients, subject, body, CC, BCC, and reply-to
  • Create Drafts: Create draft emails that can be edited and sent later
  • List Drafts: View and manage draft emails
  • Send Drafts: Send previously created draft emails

Attachment Support

  • Download Attachments: Download attachment content from emails
  • Add Attachments: Attach files to existing draft emails

Email Organization

  • Flag Messages: Mark emails for follow-up using Gmail's starring system (adds/removes 'STARRED' label)

Gmail Search Operators

The plugin supports Gmail's powerful search syntax:

  • Sender/Recipient: ,
  • Subject: ,
  • Date Ranges: ,
  • Status: , , ,
  • Attachments: ,
  • Size: ,
  • Labels: ,
  • Combined:

Setup Instructions

For detailed setup instructions, see GUIDE.md

Quick Setup Overview

  1. Install the plugin from Dify Marketplace
  2. Get the OAuth callback URL from the plugin's OAuth Client Settings
  3. Create Google OAuth credentials with Gmail API enabled, using the Dify callback URL
  4. Configure the plugin with your Client ID and Client Secret

Required OAuth Scopes

The plugin requests the following Gmail API scopes:

  • - Read emails
  • - Send emails
  • - Create drafts
  • - Modify emails (labels, flags)
  • - Manage labels

Usage Examples

List Recent Inbox Messages

Search for Important Emails

Send an Email

Create a Draft

Flag a Message for Follow-up

Download an Attachment

Tool Reference

Core Tools

ToolDescriptionKey Parameters
Advanced Gmail search, ,
Get detailed message information, ,

Email Composition

ToolDescriptionKey Parameters
Send email immediately, , , , ,
Create draft email, , , , ,
List draft emails,
Send draft email

Advanced Features

ToolDescriptionKey Parameters
Download attachment content,
Add file to draft,
Flag/unflag for follow-up,

Error Handling

The plugin provides comprehensive error handling:

  • Authentication Errors: Clear messages when OAuth tokens expire
  • API Errors: Detailed error messages from Gmail API
  • Validation Errors: Parameter validation with helpful suggestions
  • File Errors: Clear messages for file access and size issues

Limitations

  • File Attachments: Subject to Gmail API file size limitations
  • Rate Limits: Subject to Gmail API rate limits
  • Authentication: Requires OAuth2.0 setup and periodic token refresh
  • Search Queries: Limited to Gmail's search syntax and operators

Troubleshooting

Common Issues

  1. "Access token expired": Re-authorize the plugin in Dify
  2. "File not found": Ensure the file path is accessible from the plugin environment
  3. "Draft not found": Verify the draft ID is valid and hasn't been deleted
  4. "Permission denied": Check that all required Gmail scopes are granted

Getting Help

  • Check the Gmail API documentation for detailed error codes
  • Verify your OAuth2.0 credentials are correct
  • Ensure the Gmail API is enabled in your Google Cloud project

Development

This plugin is built using the Dify plugin framework and follows best practices:

  • Modular Design: Each tool is implemented as a separate class with clear separation of concerns
  • Error Handling: Comprehensive error handling with user-friendly error messages
  • Progress Updates: Real-time progress updates for operations involving multiple emails
  • OAuth2.0 Integration: Secure authentication with automatic token refresh
  • Gmail API Integration: Direct integration with Gmail API for optimal performance

License

This plugin is provided as-is for use with Dify. Please refer to Dify's licensing terms for usage rights.

カテゴリー
ツール
バージョン
0.2.2
langgenius·02/12/2026 01:49 AM
要件
最大メモリ
256MB