Skip to main content
Glama

Update Event

update_event
DestructiveIdempotent

Update an event's title, dates, location, or description by providing its unique ID.

Instructions

Update event properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesEvent UID
summaryNoNew title
startDateNoNew start date/time (ISO 8601, e.g. '2026-03-15T09:00:00Z')
endDateNoNew end date/time (ISO 8601, e.g. '2026-03-15T10:00:00Z')
locationNoNew location
descriptionNoNew notes/description

Implementation Reference

  • Handler function for update_event tool - receives event id and optional fields (summary, startDate, endDate, location, description), runs automation via Swift or JXA, returns MutationResult.
    async ({ id, summary, startDate, endDate, location, description }) => {
      try {
        const result = await runAutomation<MutationResult>({
          swift: {
            command: "update-event",
            input: { id, title: summary, startDate, endDate, location, notes: description },
          },
          jxa: () => updateEventScript(id, { summary, startDate, endDate, location, description }),
        });
        return ok(result);
      } catch (e) {
        return errJxaFor("update event", e);
      }
    },
  • Registration of update_event tool with MCP server, including title, description, input schema (id required, rest optional), and annotations (destructive, idempotent).
    server.registerTool(
      "update_event",
      {
        title: "Update Event",
        description:
          "Update event properties. Only specified fields are changed. Attendees and recurrence rules cannot be modified via automation.",
        inputSchema: {
          id: z.string().max(500).describe("Event UID"),
          summary: z.string().max(500).optional().describe("New title"),
          startDate: z
            .string()
            .max(64)
            .optional()
            .describe("New start date/time (ISO 8601, e.g. '2026-03-15T09:00:00Z')"),
          endDate: z.string().max(64).optional().describe("New end date/time (ISO 8601, e.g. '2026-03-15T10:00:00Z')"),
          location: z.string().max(5000).optional().describe("New location"),
          description: z.string().max(5000).optional().describe("New notes/description"),
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: true,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ id, summary, startDate, endDate, location, description }) => {
        try {
          const result = await runAutomation<MutationResult>({
            swift: {
              command: "update-event",
              input: { id, title: summary, startDate, endDate, location, notes: description },
            },
            jxa: () => updateEventScript(id, { summary, startDate, endDate, location, description }),
          });
          return ok(result);
        } catch (e) {
          return errJxaFor("update event", e);
        }
      },
    );
  • JXA helper that generates an AppleScript/JXA string to update a calendar event by UID. Finds the event across all calendars, then applies only the provided fields.
    export function updateEventScript(
      id: string,
      updates: { summary?: string; startDate?: string; endDate?: string; location?: string; description?: string },
    ): string {
      const lines: string[] = [];
      if (updates.summary !== undefined) lines.push(`ev.summary = '${esc(updates.summary)}';`);
      if (updates.startDate !== undefined) lines.push(`ev.startDate = new Date('${esc(updates.startDate)}');`);
      if (updates.endDate !== undefined) lines.push(`ev.endDate = new Date('${esc(updates.endDate)}');`);
      if (updates.location !== undefined) lines.push(`ev.location = '${esc(updates.location)}';`);
      if (updates.description !== undefined) lines.push(`ev.description = '${esc(updates.description)}';`);
    
      return `
        const Calendar = Application('Calendar');
        const cals = Calendar.calendars();
        let ev = null;
        for (const cal of cals) {
          const events = cal.events.whose({uid: '${esc(id)}'})();
          if (events.length > 0) { ev = events[0]; break; }
        }
        if (!ev) throw new Error('Event not found: ${esc(id)}');
        ${lines.join("\n    ")}
        JSON.stringify({id: ev.uid(), summary: ev.summary()});
      `;
    }
  • Input schema for update_event - id required, all other fields optional. Uses Zod validation with max length constraints.
    inputSchema: {
      id: z.string().max(500).describe("Event UID"),
      summary: z.string().max(500).optional().describe("New title"),
      startDate: z
        .string()
        .max(64)
        .optional()
        .describe("New start date/time (ISO 8601, e.g. '2026-03-15T09:00:00Z')"),
      endDate: z.string().max(64).optional().describe("New end date/time (ISO 8601, e.g. '2026-03-15T10:00:00Z')"),
      location: z.string().max(5000).optional().describe("New location"),
      description: z.string().max(5000).optional().describe("New notes/description"),
    },
Behavior3/5

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

Annotations already indicate destructiveHint and idempotentHint, so the description adds no extra behavioral context. It does not mention failure conditions, required permissions, or response format.

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

Conciseness4/5

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

The description is a single sentence with no wasted words. However, it could be more structured to include usage guidance or behavioral notes.

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?

Given the absence of an output schema, the description should explain the return value or result, but it does not. It also lacks differentiation from siblings and behavioral context.

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?

The input schema has 100% coverage with descriptions for each parameter, so the description does not add additional meaning. Baseline is 3 for high schema coverage.

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 action ('Update') and the resource ('event properties'). However, it does not differentiate from sibling tools like 'create_event' or 'delete_event', which are also event-related operations.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it does not state that this tool modifies existing events and should not be used for creating new events.

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/heznpc/AirMCP'

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