google_calendar_delete_event
Remove an event from Google Calendar by specifying its event ID. Optionally, define the calendar ID or use the primary calendar by default.
Instructions
Delete an event from Google Calendar
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | No | Optional: ID of calendar to use (defaults to primary if not specified) | |
| eventId | Yes | ID of the event to delete |
Implementation Reference
- handlers/calendar.ts:169-183 (handler)The handler function that executes the tool: validates input using isDeleteEventArgs, extracts eventId and calendarId, calls deleteEvent on GoogleCalendar instance, and returns success response.export async function handleCalendarDeleteEvent( args: any, googleCalendarInstance: GoogleCalendar ) { if (!isDeleteEventArgs(args)) { throw new Error("Invalid arguments for google_calendar_delete_event"); } const { eventId, calendarId } = args; const result = await googleCalendarInstance.deleteEvent(eventId, calendarId); return { content: [{ type: "text", text: result }], isError: false, }; }
- tools/calendar/index.ts:188-206 (schema)Tool schema definition: name, description, and inputSchema for google_calendar_delete_event.export const DELETE_EVENT_TOOL: Tool = { name: "google_calendar_delete_event", description: "Delete an event from Google Calendar", inputSchema: { type: "object", properties: { eventId: { type: "string", description: "ID of the event to delete", }, calendarId: { type: "string", description: "Optional: ID of calendar to use (defaults to primary if not specified)", }, }, required: ["eventId"], }, };
- server-setup.ts:122-126 (registration)Registration in the server request handler switch statement: routes CallToolRequest for this tool to the handler.case "google_calendar_delete_event": return await calendarHandlers.handleCalendarDeleteEvent( args, googleCalendarInstance );
- utils/helper.ts:95-104 (helper)Helper validation function (type guard) used in the handler to validate arguments match the schema.export function isDeleteEventArgs(args: any): args is { eventId: string; calendarId?: string; } { return ( args && typeof args.eventId === "string" && (args.calendarId === undefined || typeof args.calendarId === "string") ); }