
Recipe Create Gmail Filter
Automate Gmail inbox triage by creating filters that label, star, or move mail without clicking through the Gmail UI.
Overview
Recipe Create Gmail Filter is an agent skill for the Operate phase that creates Gmail filters via the `gws` CLI to label, star, or reroute incoming messages automatically.
Install
npx skills add https://github.com/googleworkspace/cli --skill recipe-create-gmail-filterWhat is this skill?
- 4-step recipe: list labels, create label, create filter JSON, verify with filters list
- Uses `gws gmail` for users.labels and users.settings.filters APIs
- Supports criteria (e.g. from address) and actions (addLabelIds, removeLabelIds from INBOX)
- Prerequisite skill `gws-gmail` plus `gws` CLI on PATH
- Table-formatted list commands for quick human verification
- metadata version 0.22.5
Adoption & trust: 16.3k installs on skills.sh; 26.9k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know which senders should skip the inbox or get a label, but you keep doing it by hand because setting up filters in Gmail feels fiddly from an agent session.
Who is it for?
Solo builders with `gws` and `gws-gmail` already working who want agent-driven inbox automation with auditable CLI commands.
Skip if: Teams without Google Workspace Gmail API access, or anyone who only needs one-off manual filters in the Gmail web UI.
When should I use this skill?
You want to create a Gmail filter to automatically label, star, or categorize incoming messages using `gws`.
What do I get? / Deliverables
After the four steps, a verified Gmail filter applies your criteria and label or inbox actions on new mail using live API calls.
- New or reused Gmail label
- Created filter with defined criteria and actions
- Verified filter row from filters list
Recommended Skills
Journey fit
Email rules are something you tune after you are live—ongoing personal and business inbox operations, not one-time build work. Filter creation and verification are iterative ops: adjust criteria, labels, and actions as senders and workflows change.
How it compares
A numbered terminal recipe on top of `gws-gmail`, not a standalone MCP server or generic email prompt.
Common Questions / FAQ
Who is recipe-create-gmail-filter for?
Indie builders and small teams who run the Google Workspace CLI and want their coding agent to provision Gmail filters with explicit API steps.
When should I use recipe-create-gmail-filter?
Use it during Operate when you are iterating on inbox rules—after launch when support and billing mail volume grows, or whenever you add a new labeled workflow like Receipts or Client.
Is recipe-create-gmail-filter safe to install?
Treat it like any skill that runs shell commands against your Google account; review the Security Audits panel on this page and confirm OAuth scopes before letting an agent create filters.
Workflow Chain
Requires first: gws gmail
SKILL.md
READMESKILL.md - Recipe Create Gmail Filter
# 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 1. List existing labels: `gws gmail users labels list --params '{"userId": "me"}' --format table` 2. Create a new label: `gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'` 3. Create a filter: `gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'` 4. Verify filter: `gws gmail users settings filters list --params '{"userId": "me"}' --format table`