Skip to main content
Glama

calendar-update-event

Modify calendar event details including title, time, location, attendees, and description to keep schedules current and accurate.

Instructions

Update an existing calendar event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYesEvent ID
calendarIdNoCalendar ID - Available options: 'primary' (Primary Calendar)primary
summaryNoEvent title/summary
descriptionNoEvent description
locationNoEvent location
startDateTimeNoStart date/time in ISO format
endDateTimeNoEnd date/time in ISO format
attendeesNoArray of attendee email addresses

Implementation Reference

  • Implements the core logic for updating a Google Calendar event: fetches existing event, merges updates, calls Google Calendar API events.update, formats response with Markdown.
    // Update event function
    export async function updateEvent(
      params: z.infer<ReturnType<typeof updateEventSchema>>
    ) {
      try {
        const auth = createCalendarAuth();
        const calendar = google.calendar({ version: "v3", auth });
    
        // First get the existing event
        const existingEvent = await calendar.events.get({
          calendarId: params.calendarId,
          eventId: params.eventId,
        });
    
        const updatedEvent: any = { ...existingEvent.data };
    
        // Update only the provided fields
        if (params.summary !== undefined) updatedEvent.summary = params.summary;
        if (params.description !== undefined)
          updatedEvent.description = params.description;
        if (params.location !== undefined) updatedEvent.location = params.location;
        if (params.startDateTime !== undefined) {
          updatedEvent.start = {
            ...updatedEvent.start,
            dateTime: params.startDateTime,
          };
        }
        if (params.endDateTime !== undefined) {
          updatedEvent.end = { ...updatedEvent.end, dateTime: params.endDateTime };
        }
        if (params.attendees !== undefined) {
          updatedEvent.attendees = params.attendees.map((email) => ({ email }));
        }
    
        const response = await calendar.events.update({
          calendarId: params.calendarId,
          eventId: params.eventId,
          requestBody: updatedEvent,
          sendUpdates: "all",
        });
    
        const updatedEventData = {
          id: response.data.id,
          summary: response.data.summary,
          start: response.data.start,
          end: response.data.end,
          location: response.data.location,
          description: response.data.description,
          attendees: response.data.attendees,
          htmlLink: response.data.htmlLink,
          updated: response.data.updated,
        };
    
        return {
          content: [
            {
              type: "text" as const,
              text: `# Event Updated Successfully ✅\n\n${formatEventToMarkdown(updatedEventData)}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error updating event: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
        };
      }
    }
  • Zod schema defining input parameters for the updateEvent tool, including eventId, optional updates for summary, description, etc.
    export const updateEventSchema = () =>
      z.object({
        eventId: z.string().describe("Event ID"),
        calendarId: z
          .string()
          .default("primary")
          .describe(getCalendarDescription()),
        summary: z.string().optional().describe("Event title/summary"),
        description: z.string().optional().describe("Event description"),
        location: z.string().optional().describe("Event location"),
        startDateTime: z
          .string()
          .optional()
          .describe("Start date/time in ISO format"),
        endDateTime: z.string().optional().describe("End date/time in ISO format"),
        attendees: z
          .array(z.string())
          .optional()
          .describe("Array of attendee email addresses"),
      });
  • src/index.ts:242-249 (registration)
    Registers the 'calendar-update-event' tool with MCP server, providing name, description, schema, and handler wrapper.
    server.tool(
      "calendar-update-event",
      "Update an existing calendar event",
      updateEventSchema().shape,
      async (params) => {
        return await updateEvent(params);
      }
    );
  • Helper function to format event details into Markdown, used in the handler's success response.
    function formatEventToMarkdown(event: any): string {
      let markdown = `# ${event.summary || 'Untitled Event'}\n\n`;
      
      if (event.description) markdown += `${event.description}\n\n`;
      
      const startDate = event.start?.dateTime ? new Date(event.start.dateTime) : null;
      const endDate = event.end?.dateTime ? new Date(event.end.dateTime) : null;
      
      if (startDate) {
        markdown += `Start: ${startDate.toLocaleString()}  \n`;
      }
      if (endDate) {
        markdown += `End: ${endDate.toLocaleString()}  \n`;
      }
      
      if (event.location) markdown += `Location: ${event.location}  \n`;
      
      if (event.attendees && event.attendees.length > 0) {
        markdown += `Attendees: ${event.attendees.map((a: any) => {
          let attendee = a.email || a;
          if (a.responseStatus) {
            const status = a.responseStatus === 'accepted' ? '✅' : 
                         a.responseStatus === 'declined' ? '❌' : 
                         a.responseStatus === 'tentative' ? '❓' : '⏳';
            attendee += ` ${status}`;
          }
          return attendee;
        }).join(', ')}  \n`;
      }
      
      if (event.htmlLink) markdown += `Calendar Link: [View Event](${event.htmlLink})  \n`;
      if (event.id) markdown += `Event ID: \`${event.id}\`  \n`;
      
      return markdown;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update an existing calendar event' implies a mutation operation but doesn't disclose important behavioral traits: whether this requires specific permissions, if updates are partial or complete replacements, what happens to attendees when updating, whether changes are reversible, or any rate limits/quotas. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action ('Update an existing calendar event') and contains no unnecessary elaboration. Every word earns its place in conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 8 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address key contextual questions: what permissions are needed, whether updates are partial or complete, what the response looks like, error conditions, or how it interacts with sibling tools. The agent lacks sufficient context to use this tool effectively beyond basic parameter passing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain which fields are optional vs. required beyond eventId, how partial updates work, or provide examples. Baseline 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('update') and resource ('existing calendar event'), making the purpose immediately understandable. It distinguishes from sibling tools like 'calendar-create-event' and 'calendar-delete-event' by specifying it's for updating existing events. However, it doesn't specify what aspects can be updated or the scope of changes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing an existing event ID), when not to use it, or how it differs from 'calendar-create-event' beyond the obvious update vs. create distinction. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/CaptainCrouton89/google-mcp'

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