Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_move_by_sender

Move all emails from a specific sender to a designated folder in iCloud Mail. Use this tool to organize your inbox by relocating messages from particular senders in bulk operations.

Instructions

Move all emails from a specific sender to a folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
senderYesSender email address
targetMailboxYesDestination folder
sourceMailboxNoSource mailbox (default INBOX)
dryRunNoPreview only — return count without moving

Implementation Reference

  • The bulk_move_by_sender tool logic, which connects to IMAP, searches for emails by sender, and calls safeMoveEmails.
    export async function bulkMoveBySender(sender, targetMailbox, sourceMailbox = 'INBOX', dryRun = false, creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(sourceMailbox);
      const uids = (await client.search({ from: sender }, { uid: true })) ?? [];
      await client.logout();
      if (dryRun) return { dryRun: true, wouldMove: uids.length, sender, sourceMailbox, targetMailbox };
      if (uids.length === 0) return { moved: 0 };
      await ensureMailbox(targetMailbox, creds);
      const result = await safeMoveEmails(uids, sourceMailbox, targetMailbox, creds);
      return { ...result, sender, targetMailbox };
    }

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