google_calendar_list_calendars
Retrieve a comprehensive list of all available calendars to manage schedules and events efficiently. Ideal for integrating with AI clients for streamlined calendar access.
Instructions
List all available calendars
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- handlers/calendar.ts:28-47 (handler)Main handler function for the tool: validates input, fetches calendars from GoogleCalendar instance, formats them into a readable list, and returns as text content.
export async function handleCalendarListCalendars( args: any, googleCalendarInstance: GoogleCalendar ) { if (!isListCalendarsArgs(args)) { throw new Error("Invalid arguments for google_calendar_list_calendars"); } const calendars = await googleCalendarInstance.listCalendars(); const formattedResult = calendars .map( (cal: any) => `${cal.summary}${cal.primary ? " (Primary)" : ""} - ID: ${cal.id}` ) .join("\n"); return { content: [{ type: "text", text: formattedResult }], isError: false, }; } - tools/calendar/index.ts:18-25 (schema)Tool definition including name, description, and input schema (no required parameters).
export const LIST_CALENDARS_TOOL: Tool = { name: "google_calendar_list_calendars", description: "List all available calendars", inputSchema: { type: "object", properties: {}, }, }; - server-setup.ts:97-101 (registration)Switch case registration that routes calls to this tool to the appropriate handler function.
case "google_calendar_list_calendars": return await calendarHandlers.handleCalendarListCalendars( args, googleCalendarInstance );