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);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure. It fails to mention sorting order, inclusion of canceled events, pagination behavior, or default time range behavior beyond implying 'upcoming'. The schema covers parameters but not runtime behavior.

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 unnecessary words. However, it omits important behavioral context, so it is not perfectly concise for a helpful description. Still, it is efficiently brief.

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 no output schema, the description could have explained the return format or common use cases. It also fails to mention that timeMin can be set in the past, contradicting 'upcoming'. The tool is simple but the description lacks completeness for effective use.

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 baseline is 3. The description adds no additional meaning beyond the schema, but since the schema is sufficient, this score is appropriate.

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 'List upcoming calendar events' clearly states the action (list) and resource (calendar events). However, 'upcoming' may be misleading since the tool can list events in any time range via parameters. It distinguishes from siblings implicitly as there is no other event list tool.

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 like create_event, update_event, or delete_event. The description does not indicate that this is a read-only operation or that for email lists one should use list_emails.

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

Deploy Server

Other Tools

Related Tools