Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

mark_email_read

Mark an email as read or unread by its ID, updating its read status in your inbox to manage notifications and unread counts.

Instructions

Mark an email as read or unread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesID of the email to mark
readNotrue to mark as read, false to mark as unread

Implementation Reference

  • The actual implementation of mark_email_read logic on the JmapClient class. Sends an Email/set JMAP call with keywords/$seen set to true (to mark read) or null (to mark unread).
    async markEmailRead(emailId: string, read: boolean = true): Promise<void> {
      const session = await this.getSession();
    
      const update: Record<string, any> = {};
      update[emailId] = read
        ? { 'keywords/$seen': true }
        : { 'keywords/$seen': null };
    
      const request: JmapRequest = {
        using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:mail'],
        methodCalls: [
          ['Email/set', {
            accountId: session.accountId,
            update
          }, 'updateEmail']
        ]
      };
    
      const response = await this.makeRequest(request);
      const result = this.getMethodResult(response, 0);
      
      if (result.notUpdated && result.notUpdated[emailId]) {
        throw new Error(`Failed to mark email as ${read ? 'read' : 'unread'}.`);
      }
    }
  • src/index.ts:607-625 (registration)
    Tool registration/schema definition for 'mark_email_read' in the MCP ListTools handler. Defines input schema with emailId (required) and read (optional boolean, default true).
    {
      name: 'mark_email_read',
      description: 'Mark an email as read or unread',
      inputSchema: {
        type: 'object',
        properties: {
          emailId: {
            type: 'string',
            description: 'ID of the email to mark',
          },
          read: {
            type: 'boolean',
            description: 'true to mark as read, false to mark as unread',
            default: true,
          },
        },
        required: ['emailId'],
      },
    },
  • MCP CallTool request handler for 'mark_email_read'. Extracts emailId and read args, validates emailId is present, calls client.markEmailRead(), and returns a success message.
    case 'mark_email_read': {
      const { emailId, read = true } = args as any;
      if (!emailId) {
        throw new McpError(ErrorCode.InvalidParams, 'emailId is required');
      }
      const client = initializeClient();
      await client.markEmailRead(emailId, read);
      return {
        content: [
          {
            type: 'text',
            text: `Email ${read ? 'marked as read' : 'marked as unread'} successfully`,
          },
        ],
      };
    }
Behavior2/5

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

The description implies a write operation (changing email state) but lacks details on idempotency, side effects, required permissions, or reversibility. With no annotations, this minimal transparency is insufficient.

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

Conciseness4/5

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

The description is a single, concise sentence that is front-loaded and to the point. While efficient, it could be slightly expanded with context without losing brevity.

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?

Given the simplicity of the tool and lack of output schema, the description is too minimal. It does not explain common email semantics (e.g., what 'read' means or that it's undoable) or provide any contextual completeness.

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 coverage is 100% and both parameters have clear descriptions in the schema. The tool description adds no extra meaning beyond what the schema already provides, so it meets the baseline but does not exceed it.

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 ('Mark') and the resource ('an email') and specifies the possible states ('read or unread'). It is specific and distinct from siblings like 'bulk_mark_read' but could explicitly contrast with that to earn a 5.

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 such as 'bulk_mark_read'. The description does not mention use cases or exclusions, leaving the agent without context for selection.

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/MadLlama25/fastmail-mcp'

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