update_rule
Modify an existing Mail rule by specifying only the fields to change. Conditions and actions are replaced entirely when provided, with user confirmation for matching or dangerous changes.
Instructions
Update an existing Mail.app rule (patch semantics).
Patch semantics: only fields you provide are changed. conditions and
actions, when provided, REPLACE their respective structures wholesale
(not merged).
Conditional confirmation: prompts the user via MCP elicitation when the
patch touches conditions or match_logic (which alter matching
scope), or replaces actions with a set that includes a dangerous
action (move / forward / delete / copy). An actions patch limited to
organizational flags (mark_read / mark_flagged / flag_color)
skips the prompt, as do patches limited to enabled and/or name
(trivially reversible). The enable/disable path replaces the removed
set_rule_enabled tool: call update_rule(rule_index, enabled=True|False).
Refuses to update any rule whose existing actions include something outside the supported schema (run-AppleScript, redirect, reply text, play sound, custom highlight color); raises MailUnsupportedRuleActionError. Edit such rules in Mail.app's UI.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | New name (only set if not None). | |
| actions | No | If provided, REPLACES all action flags wholesale. | |
| enabled | No | New enabled state (only set if not None). | |
| conditions | No | If provided, REPLACES all existing conditions. | |
| rule_index | Yes | 1-based positional index from list_rules. | |
| match_logic | No | 'all' or 'any', only set if not None. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||