Skip to main content
Glama

get_mailboxes

Retrieve and list all available mailboxes from your iCloud account to organize and access your email folders.

Instructions

List all available mailboxes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of getMailboxes() that calls IMAP client.getBoxes() to retrieve all mailboxes and returns ImapBoxes.
    async getMailboxes(): Promise<ImapBoxes> { return new Promise((resolve, reject) => { this.imap.getBoxes((err: Error, boxes: ImapBoxes) => { if (err) { reject(err); return; } resolve(boxes); }); }); }
  • MCP server request handler for 'get_mailboxes' tool: validates connection, calls client.getMailboxes(), and formats response as JSON text content.
    case 'get_mailboxes': { if (!mailClient) { throw new McpError( ErrorCode.InvalidRequest, 'iCloud Mail not configured. Please set ICLOUD_EMAIL and ICLOUD_APP_PASSWORD environment variables.' ); } const mailboxes = await mailClient.getMailboxes(); return { content: [ { type: 'text', text: JSON.stringify(mailboxes, null, 2), }, ], }; }
  • src/index.ts:130-137 (registration)
    Registers the 'get_mailboxes' tool in the MCP server's listTools response with name, description, and empty input schema (no parameters required).
    { name: 'get_mailboxes', description: 'List all available mailboxes', inputSchema: { type: 'object', properties: {}, }, },
  • TypeScript interface defining the structure of mailboxes returned by getMailboxes().
    interface ImapBoxes { [boxName: string]: ImapBox; }

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/Racimy/iMail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server