google_calendar_set_default
Set a specific calendar ID as the default for Google Calendar operations using the Google MCP server.
Instructions
Set the default calendar ID for operations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | Yes | The ID of the calendar to set as default |
Implementation Reference
- handlers/calendar.ts:13-26 (handler)Handler function that validates arguments and calls setDefaultCalendarId on the GoogleCalendar instance, returning the result.export async function handleCalendarSetDefault( args: any, googleCalendarInstance: GoogleCalendar ) { if (!isSetDefaultCalendarArgs(args)) { throw new Error("Invalid arguments for google_calendar_set_default"); } const { calendarId } = args; const result = googleCalendarInstance.setDefaultCalendarId(calendarId); return { content: [{ type: "text", text: result }], isError: false, }; }
- tools/calendar/index.ts:3-16 (schema)Tool schema definition including name, description, and input schema requiring calendarId.export const SET_DEFAULT_CALENDAR_TOOL: Tool = { name: "google_calendar_set_default", description: "Set the default calendar ID for operations", inputSchema: { type: "object", properties: { calendarId: { type: "string", description: "The ID of the calendar to set as default", }, }, required: ["calendarId"], }, };
- server-setup.ts:92-96 (registration)Switch case in tool dispatch that routes 'google_calendar_set_default' to the calendar handler.case "google_calendar_set_default": return await calendarHandlers.handleCalendarSetDefault( args, googleCalendarInstance );
- utils/calendar.ts:12-15 (helper)Core method in GoogleCalendar class that sets the default calendar ID and returns confirmation.setDefaultCalendarId(calendarId: string) { this.defaultCalendarId = calendarId; return `Default calendar ID set to: ${calendarId}`; }
- utils/helper.ts:3-7 (helper)Type guard function for validating arguments to google_calendar_set_default.export function isSetDefaultCalendarArgs( args: any ): args is { calendarId: string } { return args && typeof args.calendarId === "string"; }