Skip to main content
Glama
owen-nash

Fastmail MCP Server

by owen-nash

bulk_mark_read

Mark multiple emails as read or unread in bulk by providing an array of email IDs and a read status.

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:848-866 (registration)
    Tool registration for 'bulk_mark_read' in the ListToolsRequestSchema handler. Defines the tool name, description, and inputSchema (emailIds array and optional read boolean).
      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'],
      },
    },
  • Handler case for 'bulk_mark_read' in the CallToolRequestSchema handler. Extracts emailIds and read from args, validates the array, and delegates to client.bulkMarkRead().
    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`,
          },
        ],
      };
    }
  • Actual JMAP API implementation of bulkMarkRead in JmapClient. Builds a batch update patch for all emailIds setting keywords/$seen to true or null, sends a single Email/set request, and checks for 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 must disclose behavioral traits, but it only states the basic action. No mention of failure handling, limits, or side effects.

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, clear sentence with no wasted words. It could be slightly longer to include usage context.

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?

For a simple bulk operation, the description is adequate but lacks guidance on when to use and behavioral details. The presence of a similar sibling tool makes it slightly 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?

Schema coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema descriptions for 'emailIds' and 'read'.

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 tool marks multiple emails as read/unread, with a specific verb and resource. The bulk nature is explicit, distinguishing it from the singular 'mark_email_read' sibling.

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 'mark_email_read' or other bulk operations. The context for choosing this tool is absent.

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

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