Skip to main content
Glama

Google Calendar MCP Server

by peadams21

delete_event

Remove specific events from Google Calendar by specifying the event ID and calendar ID, ensuring efficient event management through the Google Calendar MCP Server.

Instructions

Delete an event from Google Calendar

Input Schema

NameRequiredDescriptionDefault
calendarIdNoCalendar ID (default: 'primary')primary
eventIdYesEvent ID to delete

Input Schema (JSON Schema)

{ "properties": { "calendarId": { "default": "primary", "description": "Calendar ID (default: 'primary')", "type": "string" }, "eventId": { "description": "Event ID to delete", "type": "string" } }, "required": [ "eventId" ], "type": "object" }

Implementation Reference

  • The main handler function that executes the delete_event tool logic by calling the Google Calendar API to delete the specified event.
    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 used for input validation of delete_event arguments.
    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, defining the name, description, and JSON input schema for the MCP protocol.
    { 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"], }, },
  • Dispatch case in the main CallToolRequest handler that validates arguments and calls the specific delete_event handler.
    case "delete_event": { const validatedArgs = DeleteEventArgsSchema.parse(args); return await handleDeleteEvent(validatedArgs); }

Other Tools

Related Tools

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