Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

bulk_delete_by_sender

Delete all emails from a specific sender in your iCloud Mail inbox. Use this tool to remove unwanted messages and maintain inbox organization through bulk operations.

Instructions

Delete all emails from a specific sender

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
senderYesSender email address
mailboxNoMailbox (default INBOX)

Implementation Reference

  • The bulk_delete_by_sender function retrieves all emails from a specific sender, chunks them, and deletes them from the mailbox.
    export async function bulkDeleteBySender(sender, mailbox = 'INBOX', creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      await client.mailboxOpen(mailbox);
      const uids = (await client.search({ from: sender }, { uid: true })) ?? [];
      if (uids.length === 0) { await client.logout(); return { deleted: 0 }; }
      let deleted = 0;
      for (let i = 0; i < uids.length; i += CHUNK_SIZE) {
        const chunk = uids.slice(i, i + CHUNK_SIZE);
        await client.messageDelete(chunk, { uid: true });
        deleted += chunk.length;
      }
      await client.logout();
      return { deleted, 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