Skip to content

feat: Add create_mailbox tool for folder management #8

@patrickfreyer

Description

@patrickfreyer

Summary

Add a tool to create new mailboxes (folders) in Apple Mail.

Motivation

Users can't organize emails into new folders without this. Currently they must manually create folders in Apple Mail.

Proposed API

@mcp.tool()
def create_mailbox(
    account: str,
    name: str,
    parent_mailbox: Optional[str] = None  # For nested folders
) -> str:
    """Create a new mailbox (folder) in the specified account.
    
    Args:
        account: Account name
        name: Name for the new mailbox
        parent_mailbox: Parent folder for nested mailboxes (e.g., "Projects")
    
    Returns:
        Confirmation with the new mailbox path
    """

AppleScript Reference

tell application "Mail"
    tell account "AccountName"
        make new mailbox with properties {name:"NewFolder"}
        -- or for nested:
        make new mailbox at mailbox "Parent" with properties {name:"Child"}
    end tell
end tell

Use Cases

  • "Create a folder for Project X"
  • "Set up a Newsletters folder"
  • "Create client-specific subfolders"

Priority

MEDIUM - Enables organization workflows

Labels

enhancement, priority-medium, organization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions