Skip to main content
Glama
Racimy

iMail-mcp

mark_as_read

Mark email messages as read to manage your inbox and track which messages you have viewed using the iMail-mcp server.

Instructions

Mark email messages as read

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxNoMailbox name (default: INBOX)INBOX
messageIdsYesArray of message IDs to mark as read

Implementation Reference

  • Core handler implementation that marks all messages in the mailbox as read by adding the IMAP \\Seen flag (ignores specific messageIds)
    async markAsRead(
      _messageIds: string[],
      mailbox: string = 'INBOX'
    ): Promise<void> {
      return new Promise((resolve, reject) => {
        this.imap.openBox(mailbox, false, (err: Error) => {
          if (err) {
            reject(err);
            return;
          }
    
          this.imap.search(['ALL'], (err: Error, results: number[]) => {
            if (err) {
              reject(err);
              return;
            }
    
            if (!results || results.length === 0) {
              resolve();
              return;
            }
    
            this.imap.addFlags(results, ['\\Seen'], (err: Error) => {
              if (err) {
                reject(err);
                return;
              }
              resolve();
            });
          });
        });
      });
    }
  • MCP server dispatch handler for the 'mark_as_read' tool call, extracts arguments and invokes the mail client method
    case 'mark_as_read': {
      if (!mailClient) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          'iCloud Mail not configured. Please set ICLOUD_EMAIL and ICLOUD_APP_PASSWORD environment variables.'
        );
      }
    
      const messageIds = args?.messageIds as string[];
      const mailbox = (args?.mailbox as string) || 'INBOX';
    
      await mailClient.markAsRead(messageIds, mailbox);
    
      return {
        content: [
          {
            type: 'text',
            text: `Marked ${messageIds.length} messages as read`,
          },
        ],
      };
    }
  • src/index.ts:110-129 (registration)
    Tool registration including name, description, and input schema definition in the ListTools response
    {
      name: 'mark_as_read',
      description: 'Mark email messages as read',
      inputSchema: {
        type: 'object',
        properties: {
          messageIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of message IDs to mark as read',
          },
          mailbox: {
            type: 'string',
            description: 'Mailbox name (default: INBOX)',
            default: 'INBOX',
          },
        },
        required: ['messageIds'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action but doesn't mention permissions required, whether the operation is reversible, error handling, or what happens if invalid message IDs are provided. This is a mutation tool with significant behavioral gaps.

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 with zero wasted words. It's appropriately sized for a simple tool and immediately communicates the core functionality.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address behavioral aspects like side effects, error conditions, or what the tool returns. The context signals indicate this is a non-trivial operation requiring more disclosure.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning about the parameters beyond what's in the schema, meeting the baseline for high schema coverage.

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 verb ('mark as read') and resource ('email messages'), making the purpose immediately understandable. It doesn't specifically differentiate from sibling tools like 'set_flags' which might also handle read status, but the core action is well-defined.

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?

No guidance is provided on when to use this tool versus alternatives like 'set_flags' or other email management tools. The description only states what it does, not when it's appropriate or what prerequisites might exist.

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