Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

get_calendar_event

Retrieve a specific calendar event from Fastmail using its unique ID to view details or manage scheduling.

Instructions

Get a specific calendar event by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYesID of the event to retrieve

Implementation Reference

  • src/index.ts:316-328 (registration)
    Registration of the 'get_calendar_event' tool including its description and input schema definition.
      name: 'get_calendar_event',
      description: 'Get a specific calendar event by ID',
      inputSchema: {
        type: 'object',
        properties: {
          eventId: {
            type: 'string',
            description: 'ID of the event to retrieve',
          },
        },
        required: ['eventId'],
      },
    },
  • Input schema for the get_calendar_event tool, requiring eventId as string.
    inputSchema: {
      type: 'object',
      properties: {
        eventId: {
          type: 'string',
          description: 'ID of the event to retrieve',
        },
      },
      required: ['eventId'],
    },
  • MCP server request handler for 'get_calendar_event' that validates the eventId parameter, initializes the contacts/calendar client, calls getCalendarEventById, and formats the response as JSON text content.
    case 'get_calendar_event': {
      const { eventId } = args as any;
      if (!eventId) {
        throw new McpError(ErrorCode.InvalidParams, 'eventId is required');
      }
      const contactsClient = initializeContactsCalendarClient();
      const event = await contactsClient.getCalendarEventById(eventId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(event, null, 2),
          },
        ],
      };
    }
  • Core handler implementation in ContactsCalendarClient class: checks calendar permissions, constructs JMAP CalendarEvent/get request with the event ID, executes the request, and returns the event data.
    async getCalendarEventById(id: string): Promise<any> {
      // Check permissions first
      const hasPermission = await this.checkCalendarsPermission();
      if (!hasPermission) {
        throw new Error('Calendar access not available. This account may not have JMAP calendar permissions enabled. Please check your Fastmail account settings or contact support to enable calendar API access.');
      }
    
      const session = await this.getSession();
      
      const request: JmapRequest = {
        using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:calendars'],
        methodCalls: [
          ['CalendarEvent/get', {
            accountId: session.accountId,
            ids: [id]
          }, 'event']
        ]
      };
    
      try {
        const response = await this.makeRequest(request);
        return response.methodResponses[0][1].list[0];
      } catch (error) {
        throw new Error(`Calendar event access not supported: ${error instanceof Error ? error.message : String(error)}. Try checking account permissions or enabling calendar API access in Fastmail settings.`);
      }
    }

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