gmail

Search and fetch Gmail messages via the Gmail API with filters and Markdown or JSON output.

3|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/pinion05/skills --skill gmail-pinion05
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gmail
Source: https://github.com/pinion05/skills/tree/main/gmail
Command: npx skills add https://github.com/pinion05/skills --skill gmail-pinion05

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-api-python-client, google-auth-httplib2, google-auth-oauthlib, google-auth, and includes scripts (resource) components.

What problem does it solve?

This skill replaces manual Gmail searching with a programmable workflow to search, fetch, and download emails via the Gmail API.

Core Features & Use Cases

  • Free-text search using Gmail query syntax with support for filters (from, to, subject, label, after/before dates)
  • Retrieve either metadata or full message bodies, including attachments, and output in Markdown or JSON
  • Use cases include auditing inbox activity, locating project-related emails, and downloading relevant attachments for archival

Quick Start

Authenticate with Gmail: python3 scripts/gmail_search.py auth Search emails: python3 scripts/gmail_search.py search "meeting notes" Filter by sender or date: python3 scripts/gmail_search.py search --from "[email protected]" --after 2024/01/01 Download attachments: python3 scripts/gmail_search.py download MESSAGE_ID

Frequently Asked Questions about gmail

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search and fetch Gmail messages using the API with filters?

You can search and fetch Gmail messages by running a Python script that uses the Gmail API with OAuth2, supporting free-text queries and filters like sender, recipient, subject, label, and date ranges.

Can I download email attachments programmatically from Gmail?

Yes, you can download email attachments programmatically by providing the message ID to the script, which retrieves and saves attachments via the Gmail API.

Does this Gmail search tool output results in Markdown or JSON?

The tool outputs retrieved email metadata and message bodies in either Markdown or JSON format, making it suitable for use in automation workflows and reporting.

Do I need OAuth2 authentication to search emails via the Gmail API?

Yes, OAuth2 authentication is required to access the Gmail API, and the script implements token caching and scope management to manage credentials securely.

What's the best way to audit inbox activity and locate project emails?

The best way to audit inbox activity is to use a script that searches emails via the Gmail API with date ranges and sender filters, then outputs the results as Markdown or JSON for archival.

Are there limitations when using Gmail API filters for email search?

Gmail API filters support standard query syntax for from, to, subject, label, and date ranges, but complex nested boolean logic may require multiple free-text queries to parse effectively.