Skip to main content
Glama

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
NameRequiredDescriptionDefault
calendarIdNoCalendar ID - Available options: 'primary' (Primary Calendar)primary
eventIdYesEvent ID

Implementation Reference

  • 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) }`, }, ], }; } }
  • 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); } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaptainCrouton89/maps-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server