Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_mark_read

Mark all emails as read in iCloud Mail, with optional filtering by sender to manage inbox notifications efficiently.

Instructions

Mark all emails as read, optionally filtered by sender

Input Schema

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

Implementation Reference

  • The function bulkMarkRead marks emails as read based on optional sender filter.
    export async function bulkMarkRead(mailbox = 'INBOX', sender = null, creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const query = sender ? { from: sender, seen: false } : { seen: false };
      const uids = (await client.search(query, { uid: true })) ?? [];
      if (uids.length === 0) { await client.logout(); return { marked: 0 }; }
      await client.messageFlagsAdd(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