Skip to main content
Glama
erickva

Google Calendar - No deletion

by erickva

create_event

Add new events to Google Calendar without the risk of deletion. Specify title, start/end times, location, description, and attendee emails.

Instructions

Create a new calendar event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attendeesNoList of attendee email addresses
descriptionNoEvent description
endYesEnd time in ISO format
locationNoEvent location
startYesStart time in ISO format
summaryYesEvent title

Implementation Reference

  • The main handler function that creates a new calendar event using Google Calendar API. It destructures arguments, builds the event object with timezone, inserts into primary calendar, and returns success or formatted error.
    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, }; }
  • Input schema for the create_event tool, specifying required fields (summary, start, end) and optional fields (location, description, attendees).
    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:173-207 (registration)
    Registers the create_event tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
    { 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:240-241 (registration)
    In the CallToolRequestSchema handler, routes 'create_event' tool calls to the handleCreateEvent method.
    case 'create_event': return await this.handleCreateEvent(request.params.arguments);

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/erickva/google-workspace-mcp-server-no-calendar-deletetion'

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