Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

bulk_mark_read

Mark multiple emails as read or unread in Fastmail. Provide a list of email IDs and specify true to mark as read, false to mark as unread.

Instructions

Mark multiple emails as read/unread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdsYesArray of email IDs to mark
readNotrue to mark as read, false as unread

Implementation Reference

  • src/index.ts:844-863 (registration)
    Tool 'bulk_mark_read' is registered in the ListTools handler with inputSchema accepting emailIds (array) and read (boolean, default true).
    {
      name: 'bulk_mark_read',
      description: 'Mark multiple emails as read/unread',
      inputSchema: {
        type: 'object',
        properties: {
          emailIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of email IDs to mark',
          },
          read: {
            type: 'boolean',
            description: 'true to mark as read, false as unread',
            default: true,
          },
        },
        required: ['emailIds'],
      },
    },
  • The CallTool handler for 'bulk_mark_read' validates the emailIds array argument, then delegates to client.bulkMarkRead(emailIds, read).
    case 'bulk_mark_read': {
      const { emailIds, read = true } = args as any;
      if (!emailIds || !Array.isArray(emailIds) || emailIds.length === 0) {
        throw new McpError(ErrorCode.InvalidParams, 'emailIds array is required and must not be empty');
      }
      const client = initializeClient();
      await client.bulkMarkRead(emailIds, read);
      return {
        content: [
          {
            type: 'text',
            text: `${emailIds.length} emails ${read ? 'marked as read' : 'marked as unread'} successfully`,
          },
        ],
      };
    }
  • The actual JMAP logic: builds an Email/set update with keywords/$seen for each email ID, sends the request, and throws on any notUpdated errors.
    async bulkMarkRead(emailIds: string[], read: boolean = true): Promise<void> {
      const session = await this.getSession();
    
      const updates: Record<string, any> = {};
      emailIds.forEach(id => {
        updates[id] = 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: updates
          }, 'bulkUpdate']
        ]
      };
    
      const response = await this.makeRequest(request);
      const result = this.getMethodResult(response, 0);
      
      if (result.notUpdated && Object.keys(result.notUpdated).length > 0) {
        throw new Error('Failed to update some emails.');
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden. It only states the basic operation but fails to disclose potential failure modes, atomicity, or any side effects such as error handling for invalid email IDs.

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 sentence of 5 words, highly concise with no unnecessary information. It front-loads the core function.

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 absence of an output schema and annotations, the description fails to specify return values, error states, or any additional context needed for a bulk operation, making it incomplete.

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?

The input schema provides 100% coverage with descriptions for both parameters. The description adds no extra meaning beyond restating the read/unread functionality, so baseline of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action (mark), resource (emails), and scope (multiple, read/unread). It effectively distinguishes itself from the sibling 'mark_email_read' tool by specifying 'multiple' emails.

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 explicit guidance is provided on when to use this tool versus alternatives. While the name implies bulk operations, the description does not mention when to prefer this over 'mark_email_read' or other bulk tools.

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