Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

rename_mailbox

Rename an existing iCloud Mail mailbox or folder by specifying the current and new mailbox paths to reorganize your email structure.

Instructions

Rename an existing mailbox/folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
oldNameYesCurrent mailbox path
newNameYesNew mailbox path

Implementation Reference

  • Implementation of rename_mailbox tool. Uses imapflow's mailboxRename method with a timeout wrapper.
    export async function renameMailbox(oldName, newName, creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      try {
        await Promise.race([
          client.mailboxRename(oldName, newName),
          new Promise((_, reject) =>
            setTimeout(() => reject(new Error('rename timed out after 15s — Apple IMAP may not support renaming this folder')), 15000)
          )
        ]);
      } finally {
        try { await client.logout(); } catch { client.close(); }
      }
      return { renamed: { from: oldName, to: newName } };
    }

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