Propose a mail filter
propose_filterProposes a new Proton Mail filter or a full replacement for an existing one as a Sieve script, pending user confirmation in the browser extension before it takes effect.
Instructions
Proposes a new Proton Mail filter, or a new version of an existing one, as a complete Sieve script. By default the user confirms it in a window of the browser extension, which shows the whole script and, for a change, the difference to the current version. This call returns before they decide; list_filters shows the outcome. The script has to start with Proton's spam guard, exactly as existing filters from get_filters carry it, and may file into folders and labels and set or clear the read and star flags. Anything more only where the user allowed it, one action at a time: moving to Trash or Spam, discard, expire, reject, vacation and stop. list_filters says what is allowed now, and a refusal names what is not. redirect is not run by Proton's filters at all. To change a filter, pass its id as replaces and send the whole new script: it replaces the old one entirely, nothing is merged. A folder has to exist already; a name that matches none does nothing. Set applyToExisting to suggest that it also runs over the mail already there; in the window that is a box the user can untick. A new filter comes last in the order.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"sieve": "<sieve>"
},
"name": "propose_filter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name Proton shows for the filter. For a change, the current name unless the user asked for a new one. | |
| sieve | Yes | The complete Sieve script, starting with Proton's spam guard. | |
| replaces | No | The id of the filter this one replaces, from list_filters. Left out for a new filter. | |
| applyToExisting | No | Suggest applying it to the mail already there once it is saved. The user can untick it. |