Skip to main content
Glama
erickva

Google Calendar - No deletion

by erickva

list_events

Retrieve upcoming calendar events within a specified time range using start and end times in ISO format. Set the maximum number of results to display. Preserves calendar data by preventing deletions while maintaining event creation.

Instructions

List upcoming calendar events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of events to return (default: 10)
timeMaxNoEnd time in ISO format
timeMinNoStart time in ISO format (default: now)

Implementation Reference

  • Executes the list_events tool by querying Google Calendar events.list API with provided filters and returns formatted event list or error.
    private async handleListEvents(args: any) { try { const maxResults = args?.maxResults || 10; const timeMin = args?.timeMin || new Date().toISOString(); const timeMax = args?.timeMax; const response = await this.calendar.events.list({ calendarId: 'camilagolin3@gmail.com', timeMin, timeMax, maxResults, singleEvents: true, orderBy: 'startTime', }); const events = response.data.items?.map((event) => ({ id: event.id, summary: event.summary, start: event.start, end: event.end, location: event.location, })); return { content: [ { type: 'text', text: JSON.stringify(events, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error fetching calendar events: ${error.message}`, }, ], isError: true, }; } }
  • Defines the input schema for list_events tool parameters.
    inputSchema: { type: 'object', properties: { maxResults: { type: 'number', description: 'Maximum number of events to return (default: 10)', }, timeMin: { type: 'string', description: 'Start time in ISO format (default: now)', }, timeMax: { type: 'string', description: 'End time in ISO format', }, }, },
  • src/index.ts:152-172 (registration)
    Registers the list_events tool in the ListTools response with name, description, and schema.
    { name: 'list_events', description: 'List upcoming calendar events', inputSchema: { type: 'object', properties: { maxResults: { type: 'number', description: 'Maximum number of events to return (default: 10)', }, timeMin: { type: 'string', description: 'Start time in ISO format (default: now)', }, timeMax: { type: 'string', description: 'End time in ISO format', }, }, }, },
  • src/index.ts:238-239 (registration)
    Routes CallTool requests for list_events to the handler function.
    case 'list_events': return await this.handleListEvents(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