update_rule
Update existing Apple Mail rules with patch semantics—replace conditions or actions wholesale, or toggle enabled state. Prompts for confirmation on irreversible 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 only when
the patch touches conditions, actions, or match_logic —
those replacements are irrecoverable. Patches limited to enabled
and/or name (trivially reversible) skip the prompt. 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 | |||