Skip to main content
Glama
wylieswanson

apple-mail-mcp-server

by wylieswanson

create_rule

Automate email handling by creating a Mail.app rule with conditions on sender, subject, or body, and actions like move, delete, forward, or mark read. User confirmation required for destructive actions.

Instructions

Create a new Mail.app rule.

Rules with actions that can move, forward, or delete mail (delete / forward_to / move_to / copy_to) require user confirmation — a single create can install automation that auto-forwards or deletes all future mail (#222). Organizational-only rules (mark_read, mark_flagged, flag_color) are created without a prompt. Mail.app appends new rules to the end of the rule list, so the returned rule_index equals the new total rule count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesRule display name. Need not be unique.
actionsYesDict with at least one truthy entry from: - move_to: {"account": str, "mailbox": str} - copy_to: {"account": str, "mailbox": str} - mark_read: bool - mark_flagged: bool (with optional flag_color enum) - flag_color: 'none' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'gray' - delete: bool - forward_to: list[str] of email addresses
enabledNoWhether the rule is enabled on creation. Default True.
conditionsYesList of condition dicts (at least one required). Each: - field: 'from' | 'to' | 'subject' | 'body' | 'any_recipient' | 'header_name' - operator: 'contains' | 'does_not_contain' | 'begins_with' | 'ends_with' | 'equals' - value: substring or value to match - header_name: required iff field == 'header_name'
match_logicNo'all' (AND across conditions) or 'any' (OR). Default 'all'.all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are basic (no read-only, idempotent, or destructive hints). The description adds crucial behavioral traits: confirmation prompts for certain actions, no prompt for others, rule appending behavior, and the meaning of rule_index. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (5 sentences), front-loaded with purpose, and structured logically. Every sentence adds necessary context without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 params, nested objects, output schema), the description covers all key behavioral aspects: confirmation, rule ordering, output index meaning. No gaps for safe and correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so schema already documents parameters well. The description adds value by explaining which actions trigger user confirmation, a behavioral aspect not in the schema. This helps the agent understand the real-world effect of the 'actions' parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it creates a new Mail.app rule, with specific verb and resource. It distinguishes from siblings like update_rule, delete_rule, list_rules by detailing creation behavior and rule types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when user confirmation is needed (actions that move/forward/delete) and when not (organizational-only). Also explains rule ordering and output semantics (rule_index equals new total count). This helps the agent decide when to use create vs update.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wylieswanson/apple-mail-pz-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server