create_event
Schedule a new calendar event with title, start and end times, location, description, and attendee emails using the Google Workspace MCP Server.
Instructions
Create a new calendar event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attendees | No | List of attendee email addresses | |
| description | No | Event description | |
| end | Yes | End time in ISO format | |
| location | No | Event location | |
| start | Yes | Start time in ISO format | |
| summary | Yes | Event title |
Implementation Reference
- src/index.ts:538-590 (handler)The handler function that creates a new calendar event by calling the Google Calendar API's events.insert method with the provided event details, handling errors appropriately.private async handleCreateEvent(args: any) { try { const { summary, location, description, start, end, attendees = [], } = args; const event = { summary, location, description, start: { dateTime: start, timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, }, end: { dateTime: end, timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, }, attendees: attendees.map((email: string) => ({ email })), }; const response = await this.calendar.events.insert({ calendarId: "primary", requestBody: event, }); return { content: [ { type: "text", text: `Event created successfully. Event ID: ${response.data.id}`, }, ], }; } catch (error: any) { return { content: [ { type: "text", text: `Error creating event: ${error.message}`, }, ], isError: true, }; } } private async handleUpdateEvent(args: any) {
- src/index.ts:181-215 (schema)The input schema and metadata (name, description) for the create_event tool, defining required and optional parameters for event creation.{ name: "create_event", description: "Create a new calendar event", inputSchema: { type: "object", properties: { summary: { type: "string", description: "Event title", }, location: { type: "string", description: "Event location", }, description: { type: "string", description: "Event description", }, start: { type: "string", description: "Start time in ISO format", }, end: { type: "string", description: "End time in ISO format", }, attendees: { type: "array", items: { type: "string" }, description: "List of attendee email addresses", }, }, required: ["summary", "start", "end"], }, },
- src/index.ts:284-285 (registration)The switch case in the CallToolRequestHandler that registers and routes calls to the create_event handler.case "create_event": return await this.handleCreateEvent(request.params.arguments);