Skip to content
All Skills

Label and Archive Gmail Threads

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

Personal Productivity|v1|Updated 5/18/2026|GitHub source
MCP get_skill({ skillId: "label-and-archive-gmail-threads-b26f9cd6" })

Use this skill with your agent

Create a free account and connect via MCP

Get Started Free
# Label and Archive Gmail Threads

> **PREREQUISITE:** Load the following skills to execute this recipe: `gws-gmail`

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

## Steps

1. Search for matching emails: `gws gmail users messages list --params '{"userId": "me", "q": "from:notifications@service.com"}' --format table`
2. Apply a label: `gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"addLabelIds": ["LABEL_ID"]}'`
3. Archive (remove from inbox): `gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"removeLabelIds": ["INBOX"]}'`
#work-life#productivity#external#license-apache-2-0#googleworkspace-cli#google-workspace#gmail#calendar#docs#sheets#tasks#googlegoogle-workspacegmail