create_rule
Creates Apple Mail rules that filter incoming messages by conditions and apply actions like move, flag, or trash, with a 90-day preview before user confirmation.
Instructions
Make a rule in Mail for mail as it arrives: conditions (from, to, subject, text, a header…) and actions (move, copy, mark read, flag, trash, stop). It is first tried on the last 90 days (preview: true only tries it). Then a window on the Mac shows the user the rule and what it would have taken: only their click makes it. Presets: mute_thread (a conversation's new mail read and archived), block_sender. Forwarding, replies and scripts stay in Mail's own settings.
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": "create_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The message a preset is about. | |
| all | No | true (default): every condition must hold; false: any one. | |
| name | No | The rule's name, as Mail will show it. | |
| preset | No | A ready-made rule: "mute_thread" (id: new mail in that conversation is marked read and archived) or "block_sender" (id or address: that sender's mail goes to the trash). | |
| actions | No | ||
| address | No | For block_sender: the address to block. | |
| preview | No | true: only try the rule on the last 90 days; nothing is made. | |
| conditions | No | What incoming mail the rule takes (1-10 conditions). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| rule | No | ||
| trial | No | ||
| status | Yes | preview, awaiting_approval, created, cancelled, enabled, disabled or deleted. | |
| undo_token | No |