getCalendars
Retrieve and list available Apple Calendar calendars on macOS through the MCP server interface for accessing calendar data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:15-37 (handler)MCP tool handler for 'getCalendars': calls the calendars.getCalendars() helper, formats response as MCP content with error handling.
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:57-67 (helper)Core helper function that performs the HTTP GET request to the Calendar API Bridge endpoint `/calendars` to retrieve all calendars.
* Get all calendars */ 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}`); } } - src/index.ts:17-17 (schema)Empty Zod schema indicating 'getCalendars' tool takes no input parameters.
{}, - src/index.ts:15-15 (registration)Registration of the 'getCalendars' tool using McpServer.tool() method.
server.tool(