recipe-create-gmail-filter
Lets the agent set up Gmail filters to automatically organize emails. Helps keep your inbox clean and organized.
What it does
This tool helps you organize your Gmail inbox. It can create automatic rules to mark, categorize, or even move important emails to specific folders without you having to do it manually.
When to use it
- ✓When you want emails from a specific sender (like stores) to be automatically marked as 'Receipts'.
- ✓When you want emails from a project to be separated into a different category.
- ✓When you want promotional emails to be automatically archived so they don't clutter your main inbox.
Example of what to ask your AI
“Create a filter so that all emails from 'newsletter@example.com' are labeled 'Newsletters' and removed from the inbox.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool first checks the labels you already have. Then, if necessary, it creates a new label. Finally, it sets up a rule in Gmail to apply the desired actions to incoming emails, based on who sent them or other characteristics.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add googleworkspace/cli --skill recipe-create-gmail-filterOr download just the file:
curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/recipe-create-gmail-filter/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Create a Gmail Filter
PREREQUISITE: Load the following skills to execute this recipe:
gws-gmail
Create a Gmail filter to automatically label, star, or categorize incoming messages.
Steps
- List existing labels:
gws gmail users labels list --params '{"userId": "me"}' --format table - Create a new label:
gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}' - Create a filter:
gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}' - Verify filter:
gws gmail users settings filters list --params '{"userId": "me"}' --format table
FAQ
Do I need to have anything installed?
Yes, you need to have the 'gws-gmail' skill loaded for this function to work.
Can I create a new label?
Yes, the tool allows you to create new labels, such as 'Receipts' or 'Work', to organize your emails.
What happens to emails after the filter is created?
It depends on the rule you create. Emails can be labeled, starred, or even moved out of your main inbox.
Details
Original description by the author
Create a Gmail filter to automatically label, star, or categorize incoming messages.
repo: googleworkspace/cli
Popularity
- GitHub stars
- 32k
- Ranking position
- #6316
- License
- Apache-2.0
- Updated
- 10/6/2026
Comments
- …
More skills from this repository
gws-admin-reports
Helps your agent get activity reports from Google Workspace. It collects audit and usage data.
googleworkspace/cli
gws-calendar-agenda
Helps your agent see upcoming events across all calendars. It's useful for organizing your schedule and knowing what's coming up.
googleworkspace/cli
gws-calendar-insert
Lets your agent create new events in Google Calendar. It's useful for scheduling appointments and meetings.
googleworkspace/cli
gws-calendar
Allows your agent to manage calendars and events. It's useful for organizing your life and work.
googleworkspace/cli
Similar skills
benchmark
Helps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.
affaan-m/ECC
content-hash-cache-pattern
Lets your agent use content hashes to cache file processing results. This avoids repeated processing and auto-invalidates the cache when content changes. Useful for speeding up slow tasks.
affaan-m/ECC
parallel-execution-optimizer
Makes your agent speed up complex tasks by breaking them into smaller parts and running them in parallel. It ensures everything is verified at the end.
affaan-m/ECC