Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

delete_mailbox

Remove an empty mailbox or folder from iCloud Mail to organize email storage and manage folder structure.

Instructions

Delete a mailbox/folder. The folder must be empty first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesMailbox path to delete

Implementation Reference

  • Implementation of the delete_mailbox tool. It connects to the IMAP server and uses client.mailboxDelete to delete the specified folder.
    export async function deleteMailbox(name, creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      try {
        await Promise.race([
          client.mailboxDelete(name),
          new Promise((_, reject) =>
            setTimeout(() => reject(new Error('delete timed out after 15s — Apple IMAP may not support deleting this folder')), 15000)
          )
        ]);
      } finally {
        try { await client.logout(); } catch { client.close(); }
      }
      return { deleted: name };
    }

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