getCalendars
Retrieve Apple Calendar data on macOS via MCP Apple Calendars. Enables AI models to access and manage calendar entries through a standardized interface.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:15-37 (handler)MCP server.tool registration and handler implementation for the 'getCalendars' tool. It calls calendars.getCalendars() and returns the result as JSON text content, handling errors.server.tool( "getCalendars", {}, async () => { try { const calendarList = await calendars.getCalendars(); return { content: [{ type: "text", text: JSON.stringify({ calendars: calendarList }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to get calendars" }) }], isError: true }; } } );
- src/calendars.ts:59-67 (helper)Helper function that performs the actual API call to retrieve calendars from the local Calendar API Bridge server.export async function getCalendars(): Promise<any[]> { try { const response = await axios.get(`${API_BASE_URL}/calendars`); return response.data; } catch (error) { console.error('Failed to get calendars:', error); throw new Error(`Failed to get calendars: ${error}`); } }