create_filter
Create Gmail filters to automatically archive, mark read, delete, star, or label new incoming messages based on sender, subject, query, or attachments—reducing recurring email noise.
Instructions
Create a Gmail filter that auto-acts on matching incoming mail (the durable fix for recurring newsletter/promo noise — unlike modify_labels, which only touches existing messages). Supply at least one match criterion (from_address/to_address/subject/query/has_attachment) and at least one action. Actions: convenience flags archive/mark_read/delete/star, plus add_labels/remove_labels for any other label (names or ids, must already exist). Filters cannot forward mail off-account by design. Note: a filter only affects mail that ARRIVES after it's created; clear existing backlog with search + modify_labels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| star | No | Star it (adds STARRED label). | |
| query | No | Raw Gmail search expression for arbitrary criteria, e.g. 'list:promotions.example.com'. | |
| delete | No | Send to Trash (adds TRASH label). | |
| account | Yes | Email address of the authorized Gmail account to act on. | |
| archive | No | Skip the Inbox (removes INBOX label). | |
| subject | No | Match words in the subject. | |
| mark_read | No | Mark as read (removes UNREAD label). | |
| add_labels | No | Labels to apply (names or ids; must exist). | |
| to_address | No | Match recipient (criteria 'to'). | |
| from_address | No | Match sender (criteria 'from'). Accepts a Gmail from-expression, e.g. 'a@b.com OR c@d.com'. | |
| remove_labels | No | Labels to remove (names or ids; must exist). | |
| has_attachment | No | Only match messages with an attachment. |