Skip to main content
Glama
peadams21

Google Calendar MCP Server

by peadams21

update_event

Modify existing Google Calendar events by updating details like title, time, location, or attendees to keep schedules accurate and current.

Instructions

Update an existing event in Google Calendar

Input Schema

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

Implementation Reference

  • Handler function that updates an existing Google Calendar event using the Google Calendar API's events.patch method. Constructs update object from provided args and returns success/error response.
    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 defining the input parameters for the update_event tool, used for validation in the request handler.
    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)
    MCP tool registration object defining the name, description, and JSON inputSchema for the update_event tool, provided in response to ListToolsRequest.
    { 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"], }, },
  • src/index.ts:555-558 (registration)
    Dispatch logic in CallToolRequest handler that validates arguments using UpdateEventArgsSchema and calls the handleUpdateEvent function for the update_event tool.
    case "update_event": { const validatedArgs = UpdateEventArgsSchema.parse(args); return await handleUpdateEvent(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