calendar-delete-event
Delete a specific calendar event by providing the event ID. Use the calendar ID to specify the target calendar, with 'primary' as the default option. Simplifies event management in MCP Server Boilerplate integrations.
Instructions
Delete a calendar event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | No | Calendar ID - Available options: 'primary' (Primary Calendar) | primary |
| eventId | Yes | Event ID |
Implementation Reference
- src/calendar.ts:541-574 (handler)The deleteEvent async function contains the core handler logic for deleting a specified calendar event using the Google Calendar API's events.delete method. It handles authentication, API call, success response, and error handling.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) }`, }, ], }; } }
- src/calendar.ts:226-233 (schema)The deleteEventSchema defines the Zod input schema validation for the tool's parameters: eventId (required string) and calendarId (string with default 'primary'). It uses dynamic description from getCalendarDescription().export const deleteEventSchema = () => z.object({ eventId: z.string().describe("Event ID"), calendarId: z .string() .default("primary") .describe(getCalendarDescription()), });
- src/index.ts:251-258 (registration)The server.tool call registers the 'calendar-delete-event' tool on the MCP server, providing name, description, schema from deleteEventSchema, and handler wrapper that delegates to deleteEvent.server.tool( "calendar-delete-event", "Delete a calendar event", deleteEventSchema().shape, async (params) => { return await deleteEvent(params); } );