Skip to main content
Glama
owen-nash

Fastmail MCP Server

by owen-nash

get_calendar_event

Retrieve a specific calendar event by providing its unique event ID.

Instructions

Get a specific calendar event by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYesID of the event to retrieve

Implementation Reference

  • The CallToolRequestSchema handler for 'get_calendar_event'. Extracts eventId from args, validates it, then tries JMAP ContactsCalendarClient.getCalendarEventById() first, falling back to CalDAVClient.getCalendarEventById() if JMAP fails.
    case 'get_calendar_event': {
      const { eventId } = args as any;
      if (!eventId) {
        throw new McpError(ErrorCode.InvalidParams, 'eventId is required');
      }
      try {
        const contactsClient = initializeContactsCalendarClient();
        const event = await contactsClient.getCalendarEventById(eventId);
        return { content: [{ type: 'text', text: JSON.stringify(event, null, 2) }] };
      } catch {
        const davClient = initializeCalDAVClient();
        if (!davClient) {
          throw new McpError(ErrorCode.InvalidRequest, 'JMAP calendars not available and CalDAV not configured. Set FASTMAIL_CALDAV_USERNAME and FASTMAIL_CALDAV_PASSWORD to use CalDAV.');
        }
        const event = await davClient.getCalendarEventById(eventId);
        return { content: [{ type: 'text', text: JSON.stringify(event, null, 2) }] };
      }
    }
  • JMAP implementation of getCalendarEventById. Checks calendar permissions, builds a JMAP CalendarEvent/get request for the given event ID, 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 this.getListResult(response, 0)[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.`);
      }
    }
  • CalDAV fallback implementation of getCalendarEventById. Fetches all calendar objects across calendars, searches by UID or URL matching the eventId, and returns the parsed event or null.
    async getCalendarEventById(eventId: string): Promise<CalendarEvent | null> {
      const client = await this.getClient();
    
      if (!this.calendars) {
        this.calendars = await client.fetchCalendars();
      }
    
      for (const cal of this.calendars) {
        const objects = await client.fetchCalendarObjects({ calendar: cal });
        for (const obj of objects) {
          const vevent = extractVEvent(obj.data || '');
          const uid = parseICalValue(vevent, 'UID');
          if (uid === eventId || obj.url === eventId) {
            return parseCalendarObject(obj);
          }
        }
      }
    
      return null;
    }
  • Schema registration for the 'get_calendar_event' tool in ListToolsRequestSchema. Defines input with required 'eventId' string field.
    {
      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'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Get' implying read-only, but does not disclose any behavioral traits such as authentication requirements, rate limits, or what happens if the event is not found.

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?

Single sentence, no unnecessary words. Perfectly concise and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple get tool with one parameter and no output schema, the description is largely sufficient. Could mention return format or error handling, but not critical.

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 description coverage is 100% (eventId has a description). The description adds no additional meaning beyond what the schema already provides, so baseline score of 3 applies.

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 'Get a specific calendar event by ID' clearly states the verb (Get), resource (calendar event), and method (by ID). It distinguishes itself from siblings like create_calendar_event and list_calendar_events.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have an event ID, but does not explicitly state when to use it versus alternatives like list_calendar_events. No exclusions or prerequisites mentioned.

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