Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    apple mail jxa

    1

    Programmatic control of macOS Apple Mail via JXA and direct SQLite search for fast, reliable email automation.

    $5

    /mo

    Subscription · cancel anytime

    Secure checkout via Stripe

    • Always the latest version
    • Delivered live to your agent via MCP
    • Cancel anytime, access ends at period end
    Security scanned
    apple mail jxa

    apple mail jxa

    Example session with this skill installed

    Search my Inbox for emails from "GitHub" received in the last 24 hours and summarize the subjects.

    • Read your context and instructions
    • Compiled the apple mail jxa

    I searched your Inbox using the Envelope Index and found 3 messages from GitHub. I resolved these references through Mail.app to verify their current status.

    GitHub Notification Summary

    Date ReceivedSenderSubjectStatus
    2023-10-24T14:20:01ZGitHub noreply@github.com[GitHub] Security alert for agensi-skill-repoUnread
    2023-10-24T09:15:44ZGitHub noreply@github.comSuccessful deployment to productionRead
    2023-10-23T22:10:12ZGitHub noreply@github.com@octocat mentioned you in agensi/discussionsRead

    Next steps

    1. Would you like me to read the full content of the Security alert email?
    2. I can move the deployment notifications to your "Archive" folder.
    3. If you want to reply to the discussion mention, I can prepare a draft for you.
    $5/mo

    Subscription · always the latest version

    • Secure checkout via Stripe
    • Cancel anytime
    • Delivered live via MCP (optional)

    About this skill

    Managing emails on macOS often requires manual intervention or clunky UI scripting. This skill provides a high-performance interface for Apple Mail using native JXA and direct SQLite indexing. It allows for fast, programmatic access to accounts, mailboxes, and messages without the overhead of external wrappers.

    What it does

    • Account discovery retrieves all enabled macOS Mail accounts and their unique identifiers.
    • Deep mailbox mapping traverses nested mailbox structures to locate specific folders by path.
    • High-speed search uses a hybrid approach with direct SQLite queries to the local Envelope Index for instant metadata retrieval.
    • Message management handles reading bodies, drafting, replying, and forwarding with strict privacy bounds.
    • State mutation updates read status, flags, and moves or deletes messages with explicit confirmation workflows.

    How it works

    1. Discovery: The agent identifies the active Mail accounts and mailbox hierarchies to establish valid references.
    2. Search: For broad queries, it queries the local Envelope Index via sqlite3 in read-only mode to find message IDs.
    3. Hydration: It resolves SQLite results back into Mail.app objects to ensure data freshness before any operations.
    4. Action: It executes JXA commands for drafting or state changes, always creating a visible draft for outgoing mail to ensure user oversight.

    Frameworks & tools

    This skill utilizes macOS native JavaScript for Automation (JXA), the Foundation framework via bridge, and the system SQLite3 binary.

    Why this beats prompting it yourself

    Writing reliable JXA for Mail is notoriously difficult due to weird AppleEvent behaviors and slow collection filtering. This skill implements a sophisticated hybrid backend that bypasses slow AppleScript loops by querying the local database directly while maintaining the safety of the official API for writes.

    Use cases

    • Automating the sorting of high-volume mailboxes based on sender or subject patterns.
    • Summarizing recent unread threads from specific clients or projects.
    • Drafting standardized replies for confirmation or follow-up workflows.
    • Searching years of archives instantly using direct database indexing.

    Known limitations

    Requires macOS Automation permissions for Mail.app and Full Disk Access for the terminal to read the SQLite index. It does not support modifying account settings or credentials.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 6 days ago

    Requires

    macOS

    Listed6 days ago

    What's inside

    Frequently Asked Questions