Skip to main content
Glama

getCalendarEvents

Retrieve events from Apple Calendar using a calendar ID to access and manage scheduled appointments and meetings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendarIdYes

Implementation Reference

  • The MCP server.tool call registers the 'getCalendarEvents' tool, defines its input schema, and provides the handler function that executes the tool logic by calling the calendars helper and formatting the 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 }; } } );
  • Zod input schema for the getCalendarEvents tool, requiring a 'calendarId' string parameter.
    { calendarId: z.string() },
  • Supporting helper function that makes the HTTP GET request to the Calendar API Bridge to retrieve events for the specified calendar ID.
    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}`); } }

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