Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

list_calendars

Retrieve all calendars from your Fastmail account to view and manage event schedules.

Instructions

List all calendars

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:483-490 (registration)
    Registration/schema for the 'list_calendars' tool in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (no params required).
    {
      name: 'list_calendars',
      description: 'List all calendars',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Main handler for 'list_calendars' tool. First tries JMAP via ContactsCalendarClient.getCalendars(), and on failure falls back to CalDAV via CalDAVCalendarClient.getCalendars().
    case 'list_calendars': {
      try {
        const contactsClient = initializeContactsCalendarClient();
        const calendars = await contactsClient.getCalendars();
        return { content: [{ type: 'text', text: JSON.stringify(calendars, null, 2) }] };
      } catch {
        // JMAP calendars not available, try CalDAV
        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 calendars = await davClient.getCalendars();
        return { content: [{ type: 'text', text: JSON.stringify(calendars, null, 2) }] };
      }
    }
  • JMAP implementation of getCalendars() in ContactsCalendarClient (extends JmapClient). Calls Calendar/get via JMAP API to list all calendars.
    async getCalendars(): 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: [
          ['Calendar/get', {
            accountId: session.accountId
          }, 'calendars']
        ]
      };
    
      try {
        const response = await this.makeRequest(request);
        return this.getListResult(response, 0);
      } catch (error) {
        // Calendar access might require special permissions
        throw new Error(`Calendar access not supported or requires additional permissions. This may be due to account settings or JMAP scope limitations: ${error instanceof Error ? error.message : String(error)}. Try checking account permissions or enabling calendar API access in Fastmail settings.`);
      }
    }
  • CalDAV fallback implementation of getCalendars() in CalDAVCalendarClient. Uses tsdav library to fetch calendars via CalDAV protocol, filtering out task calendars.
    async getCalendars(): Promise<CalendarInfo[]> {
      const client = await this.getClient();
      const calendars = await client.fetchCalendars();
      this.calendars = calendars;
    
      return calendars
        .filter(c => c.displayName !== 'DEFAULT_TASK_CALENDAR_NAME')
        .map(c => ({
          id: c.url || '',
          displayName: String(c.displayName || 'Unnamed'),
          url: c.url || '',
          description: c.description || undefined,
          color: (c as any).calendarColor || undefined,
        }));
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states 'List all calendars', with no mention of being read-only, potential pagination, or any side effects. The agent cannot infer safety or resource impact from this text.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (3 words) but sacrifices necessary context, such as what 'calendars' refers to or what the output contains. It is shorter than ideal for a tool that could benefit from brief behavioral notes.

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 parameterless tool with no output schema, the description adequately states the core function. However, it does not mention the return type or any constraints (e.g., all available calendars), leaving the agent to infer completeness from the name alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, and the schema coverage is 100%, so the description need not add parameter details. Baseline 4 is appropriate as the description is not required to compensate for missing parameter info.

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

Purpose4/5

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

The description clearly states the verb 'List' and the resource 'all calendars', making the purpose obvious. However, it does not differentiate this tool from sibling listing tools like 'list_calendar_events' or 'list_contacts', which could cause ambiguity.

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. The description lacks any context about appropriate usage scenarios or exclusions.

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