Skip to main content
Glama
Racimy

iMail-mcp

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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'List all available mailboxes,' which implies a read-only operation, but doesn't specify details like whether this requires authentication, returns paginated results, or includes metadata. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('List all available mailboxes') that is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context on usage, behavior, or output, which could be improved for better agent guidance. It meets the minimum viable threshold but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, meaning there are no parameters to document. The description doesn't need to add parameter semantics, so it meets the baseline of 4 for tools with no parameters, as it doesn't introduce confusion or omissions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all available mailboxes'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_messages' or 'search_messages' that might also involve mailbox operations, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as whether this should be used before other mailbox operations or as a standalone query. This leaves the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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