Skip to content
All Skills

Create a Gmail Filter

Create a Gmail filter to automatically label, star, or categorize incoming messages.

Personal Productivity|v1|Updated 5/18/2026|GitHub source
MCP get_skill({ skillId: "create-a-gmail-filter-4abd5fdf" })

Use this skill with your agent

Create a free account and connect via MCP

Get Started Free
# 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`
#work-life#productivity#external#license-apache-2-0#googleworkspace-cli#google-workspace#gmail#calendar#docs#sheets#tasks#googlegoogle-workspacegmail