Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

list_mailboxes

Retrieve all email folders and mailboxes from iCloud Mail to organize and manage your email structure effectively.

Instructions

List all mailboxes/folders in iCloud Mail

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of list_mailboxes tool which connects to the IMAP server, retrieves the folder tree, and flattens it into a list of mailbox objects containing name and path.
    export async function listMailboxes(creds = null) {
      const client = createRateLimitedClient(creds);
      await client.connect();
      const tree = await client.listTree();
      const mailboxes = [];
      function walk(items) {
        for (const item of items) {
          mailboxes.push({ name: item.name, path: item.path });
          if (item.folders && item.folders.length > 0) walk(item.folders);
        }
      }
      walk(tree.folders);
      await client.logout();
      return mailboxes;
    }

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