Skip to main content
Glama

mark_email_read

Mark emails as read or unread to manage your inbox by updating email status using the Fastmail MCP Server.

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

  • MCP CallToolRequest handler case for 'mark_email_read': validates input, initializes JmapClient, calls client.markEmailRead(), and returns success response.
    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`, }, ], }; }
  • Tool schema definition in ListTools response, including name, description, and inputSchema with emailId (required) and read (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'], }, },
  • JmapClient method that implements marking email read/unread via JMAP Email/set with $seen keyword, called by the MCP handler.
    async markEmailRead(emailId: string, read: boolean = true): Promise<void> { const session = await this.getSession(); const keywords = read ? { $seen: true } : {}; const request: JmapRequest = { using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:mail'], methodCalls: [ ['Email/set', { accountId: session.accountId, update: { [emailId]: { keywords } } }, 'updateEmail'] ] }; const response = await this.makeRequest(request); const result = response.methodResponses[0][1]; if (result.notUpdated && result.notUpdated[emailId]) { throw new Error(`Failed to mark email as ${read ? 'read' : 'unread'}.`); } }
  • src/index.ts:1140-1143 (registration)
    Tool listed in check_function_availability response under email functions.
    'get_recent_emails', 'mark_email_read', 'delete_email', 'move_email', 'get_email_attachments', 'download_attachment', 'advanced_search', 'get_thread', 'get_mailbox_stats', 'get_account_summary', 'bulk_mark_read', 'bulk_move', 'bulk_delete' ]

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