calendar-delete-event
Remove calendar events from Google Calendar by specifying the event ID. This tool helps manage your schedule by deleting unwanted or outdated appointments.
Instructions
Delete a calendar event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| eventId | Yes | Event ID | |
| calendarId | No | Calendar ID - Available options: 'primary' (Primary Calendar) | primary |
Implementation Reference
- src/index.ts:251-258 (registration)Registration of the 'calendar-delete-event' tool, linking to deleteEvent handler and deleteEventSchema.server.tool( "calendar-delete-event", "Delete a calendar event", deleteEventSchema().shape, async (params) => { return await deleteEvent(params); } );
- src/calendar.ts:226-233 (schema)Zod schema defining input parameters for deleting a calendar event: eventId and optional calendarId.export const deleteEventSchema = () => z.object({ eventId: z.string().describe("Event ID"), calendarId: z .string() .default("primary") .describe(getCalendarDescription()), });
- src/calendar.ts:540-574 (handler)Implementation of the deleteEvent handler: authenticates with Google Calendar API, deletes the specified event, and returns success or error message.// Delete event function export async function deleteEvent( params: z.infer<ReturnType<typeof deleteEventSchema>> ) { try { const auth = createCalendarAuth(); const calendar = google.calendar({ version: "v3", auth }); await calendar.events.delete({ calendarId: params.calendarId, eventId: params.eventId, sendUpdates: "all", }); return { content: [ { type: "text" as const, text: `# Event Deleted Successfully β \n\nEvent \`${params.eventId}\` has been deleted from your calendar.`, }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error deleting event: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }