Skip to main content
Glama
peadams21

Google Calendar MCP Server

by peadams21

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
NameRequiredDescriptionDefault
calendarIdNoCalendar ID (default: 'primary')primary
eventIdYesEvent ID to delete

Implementation Reference

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

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/peadams21/Google-Calendar-MCP-Server'

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