Skip to main content
Glama

Google Calendar MCP Server

by peadams21

update_event

Modify an existing Google Calendar event by updating its title, description, time, location, or attendees using the specified event ID.

Instructions

Update an existing event in Google Calendar

Input Schema

NameRequiredDescriptionDefault
attendeesNoList of attendees
calendarIdNoCalendar ID (default: 'primary')primary
descriptionNoEvent description
endNo
eventIdYesEvent ID to update
locationNoEvent location
startNo
summaryNoEvent title/summary

Input Schema (JSON Schema)

{ "properties": { "attendees": { "description": "List of attendees", "items": { "properties": { "displayName": { "type": "string" }, "email": { "type": "string" } }, "required": [ "email" ], "type": "object" }, "type": "array" }, "calendarId": { "default": "primary", "description": "Calendar ID (default: 'primary')", "type": "string" }, "description": { "description": "Event description", "type": "string" }, "end": { "properties": { "dateTime": { "description": "End date and time (RFC3339 timestamp)", "type": "string" }, "timeZone": { "description": "Time zone (e.g., 'America/New_York')", "type": "string" } }, "type": "object" }, "eventId": { "description": "Event ID to update", "type": "string" }, "location": { "description": "Event location", "type": "string" }, "start": { "properties": { "dateTime": { "description": "Start date and time (RFC3339 timestamp)", "type": "string" }, "timeZone": { "description": "Time zone (e.g., 'America/New_York')", "type": "string" } }, "type": "object" }, "summary": { "description": "Event title/summary", "type": "string" } }, "required": [ "eventId" ], "type": "object" }

Implementation Reference

  • The handleUpdateEvent function implements the core logic for updating a Google Calendar event. It conditionally builds the update object from provided arguments and calls the Google Calendar API's events.patch method. Returns structured success or error responses.
    async function handleUpdateEvent(args: z.infer<typeof UpdateEventArgsSchema>) { try { const updates: any = {}; if (args.summary !== undefined) updates.summary = args.summary; if (args.description !== undefined) updates.description = args.description; if (args.start !== undefined) updates.start = args.start; if (args.end !== undefined) updates.end = args.end; if (args.location !== undefined) updates.location = args.location; if (args.attendees !== undefined) updates.attendees = args.attendees; const response = await calendar.events.patch({ calendarId: args.calendarId, eventId: args.eventId, requestBody: updates, }); return { content: [ { type: "text", text: JSON.stringify({ success: true, event: response.data, message: `Event "${args.eventId}" updated 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 the update_event tool arguments, defining required eventId and optional update fields.
    const UpdateEventArgsSchema = z.object({ calendarId: z.string().optional().default("primary"), eventId: z.string(), summary: z.string().optional(), description: z.string().optional(), start: z.object({ dateTime: z.string(), timeZone: z.string().optional(), }).optional(), end: z.object({ dateTime: z.string(), timeZone: z.string().optional(), }).optional(), location: z.string().optional(), attendees: z.array(z.object({ email: z.string(), displayName: z.string().optional(), })).optional(), });
  • src/index.ts:223-291 (registration)
    The 'update_event' tool registration in the MCP tools list, providing name, description, and JSON schema for inputs.
    { name: "update_event", description: "Update an existing event in Google Calendar", inputSchema: { type: "object", properties: { calendarId: { type: "string", description: "Calendar ID (default: 'primary')", default: "primary", }, eventId: { type: "string", description: "Event ID to update", }, summary: { type: "string", description: "Event title/summary", }, description: { type: "string", description: "Event description", }, start: { type: "object", properties: { dateTime: { type: "string", description: "Start date and time (RFC3339 timestamp)", }, timeZone: { type: "string", description: "Time zone (e.g., 'America/New_York')", }, }, }, end: { type: "object", properties: { dateTime: { type: "string", description: "End date and time (RFC3339 timestamp)", }, timeZone: { type: "string", description: "Time zone (e.g., 'America/New_York')", }, }, }, location: { type: "string", description: "Event location", }, attendees: { type: "array", items: { type: "object", properties: { email: { type: "string" }, displayName: { type: "string" }, }, required: ["email"], }, description: "List of attendees", }, }, required: ["eventId"], }, },
  • Dispatcher switch case in CallToolRequestHandler that validates args with UpdateEventArgsSchema and invokes the handleUpdateEvent function.
    case "update_event": { const validatedArgs = UpdateEventArgsSchema.parse(args); return await handleUpdateEvent(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