delete_event
Remove events from Google Calendar to manage schedules and keep calendars organized. Specify the calendar and event ID to delete specific appointments or meetings.
Instructions
Delete an event from Google Calendar
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | No | Calendar ID (default: 'primary') | primary |
| eventId | Yes | Event ID to delete |
Implementation Reference
- src/index.ts:467-499 (handler)The handler function that performs the actual deletion of the event using the Google Calendar API's events.delete method, with success/error response formatting.async function handleDeleteEvent(args: z.infer<typeof DeleteEventArgsSchema>) { try { await calendar.events.delete({ calendarId: args.calendarId, eventId: args.eventId, }); return { content: [ { type: "text", text: JSON.stringify({ success: true, message: `Event "${args.eventId}" deleted successfully`, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : "Unknown error", }, null, 2), }, ], isError: true, }; } }
- src/index.ts:87-90 (schema)Zod schema for input validation of delete_event tool arguments: optional calendarId and required eventId.const DeleteEventArgsSchema = z.object({ calendarId: z.string().optional().default("primary"), eventId: z.string(), });
- src/index.ts:292-310 (registration)Tool registration in the tools array, including name, description, and JSON input schema for the MCP server's list_tools response.{ name: "delete_event", description: "Delete an event from Google Calendar", inputSchema: { type: "object", properties: { calendarId: { type: "string", description: "Calendar ID (default: 'primary')", default: "primary", }, eventId: { type: "string", description: "Event ID to delete", }, }, required: ["eventId"], }, },
- src/index.ts:559-562 (registration)Dispatch logic in the CallToolRequestSchema handler that validates arguments and invokes the delete_event handler.case "delete_event": { const validatedArgs = DeleteEventArgsSchema.parse(args); return await handleDeleteEvent(validatedArgs); }