Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_flag_by_sender

Flag or unflag all emails from a specific sender in iCloud Mail to organize messages and manage email priorities.

Instructions

Flag or unflag all emails from a specific sender

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
senderYesSender email address
flaggedYesTrue to flag, false to unflag
mailboxNoMailbox (default INBOX)

Implementation Reference

  • Implementation of bulk_flag_by_sender tool, which flags or unflags all emails from a given sender in a specific mailbox.
    export async function bulkFlagBySender(sender, flagged, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const raw = await client.search({ from: sender }, { uid: true });
      const uids = Array.isArray(raw) ? raw : [];
      if (uids.length === 0) { await client.logout(); return { [flagged ? 'flagged' : 'unflagged']: 0, sender }; }
      if (flagged) {
        await client.messageFlagsAdd(uids, ['\\Flagged'], { uid: true });
      } else {
        await client.messageFlagsRemove(uids, ['\\Flagged'], { uid: true });
      }
      await client.logout();
      return { [flagged ? 'flagged' : 'unflagged']: uids.length, sender };
    }

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