Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_mark_unread

Mark multiple emails as unread in iCloud Mail, with optional filtering by sender to manage email notifications and organization.

Instructions

Mark all emails as unread, optionally filtered by sender

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxNoMailbox (default INBOX)
senderNoOptional: only mark emails from this sender as unread

Implementation Reference

  • Implementation of the 'bulk_mark_unread' tool handler.
    export async function bulkMarkUnread(mailbox = 'INBOX', sender = null, creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const query = sender ? { from: sender, seen: true } : { seen: true };
      const uids = (await client.search(query, { uid: true })) ?? [];
      if (uids.length === 0) { await client.logout(); return { marked: 0 }; }
      await client.messageFlagsRemove(uids, ['\\Seen'], { uid: true });
      await client.logout();
      return { marked: uids.length, sender: sender || 'all' };
    }

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/adamzaidi/icloud-mcp'

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