preview_filter
Check a Gmail filter before creating it to see today's match count, duplicate or overlapping filters, and missing label names; nothing is created or changed.
Instructions
Check a filter BEFORE create_filter makes it: how much mail its criteria match today, which existing filters have exactly the same criteria, which share a from/to/subject/query value with it, and which label names in addLabels do not exist yet. Creates nothing and changes nothing. Takes the same criteria as create_filter and checks them the same way, so a preview cannot accept what the create would refuse. currentMatches counts what Gmail's search returns for the derived query — the same unverified index create_filter's applyToExisting sweep would act on; it is a size, not a promise that the filter engine agrees on every message. A rule with no positive criterion (only negatedQuery or hasAttachment:false) is not counted at all: it would match nearly the whole mailbox. overlapping is literal: two filters overlap here when they carry the same value in the same field. Whether two different searches intersect is the search engine's question, and is not guessed at. USE WHEN: before create_filter, to show the user what the rule would catch and avoid a duplicate. SIDE EFFECTS: none. Requires gmail.settings.basic (it lists the existing filters).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "preview_filter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| size | No | ||
| query | No | ||
| subject | No | ||
| addLabels | No | ||
| maxMessages | No | ||
| excludeChats | No | ||
| negatedQuery | No | ||
| removeLabels | No | ||
| hasAttachment | No | ||
| sizeComparison | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| capped | Yes | ||
| overlapping | Yes | ||
| sameCriteria | Yes | ||
| currentMatches | Yes | ||
| labelsToCreate | Yes | ||
| trashesMatches | Yes | ||
| currentThreadCount | Yes |