Skip to main content
Glama

getCalendarEvents

Fetch events from a specified Apple Calendar using the calendar ID. Enables structured access to calendar data via the MCP Apple Calendars server for macOS.

Input Schema

NameRequiredDescriptionDefault
calendarIdYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "calendarId": { "type": "string" } }, "required": [ "calendarId" ], "type": "object" }

Implementation Reference

  • src/index.ts:40-62 (registration)
    MCP server tool registration for 'getCalendarEvents', including input schema { calendarId: z.string() } and handler function that delegates to calendars.getCalendarEvents and formats MCP response.
    server.tool( "getCalendarEvents", { calendarId: z.string() }, async ({ calendarId }) => { try { const events = await calendars.getCalendarEvents(calendarId); return { content: [{ type: "text", text: JSON.stringify({ events }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: `Failed to get events from calendar: ${calendarId}` }) }], isError: true }; } } );
  • Core handler function that executes the logic to fetch calendar events via HTTP request to the local Calendar API Bridge.
    export async function getCalendarEvents(calendarId: string): Promise<any[]> { try { const response = await axios.get(`${API_BASE_URL}/calendars/${calendarId}/events`); return response.data; } catch (error) { console.error(`Failed to get events from calendar "${calendarId}":`, error); throw new Error(`Failed to get calendar events: ${error}`); } }
  • Input schema validation using Zod for the calendarId parameter.
    { calendarId: z.string() },

Other Tools

Related 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/shadowfax92/apple-calendar-mcp'

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