Skip to main content
Glama
peadams21

Google Calendar MCP Server

by peadams21

list_events

Retrieve calendar events from Google Calendar by specifying date ranges, calendars, and sorting options to view scheduled activities.

Instructions

List events from a Google Calendar

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendarIdNoCalendar ID (default: 'primary')primary
timeMinNoLower bound for event start time (RFC3339 timestamp)
timeMaxNoUpper bound for event start time (RFC3339 timestamp)
maxResultsNoMaximum number of events to return (default: 250)
singleEventsNoWhether to expand recurring events (default: true)
orderByNoOrder of events (default: 'startTime')startTime

Implementation Reference

  • Handler function that executes the list_events tool: validates args, calls Google Calendar API events.list, returns formatted events or error.
    async function handleListEvents(args: z.infer<typeof ListEventsArgsSchema>) {
      try {
        const response = await calendar.events.list({
          calendarId: args.calendarId,
          timeMin: args.timeMin,
          timeMax: args.timeMax,
          maxResults: args.maxResults,
          singleEvents: args.singleEvents,
          orderBy: args.orderBy,
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: true,
                events: response.data.items || [],
                nextPageToken: response.data.nextPageToken,
                summary: `Found ${(response.data.items || []).length} events`,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: false,
                error: error instanceof Error ? error.message : "Unknown error",
              }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining input parameters for the list_events tool, used for validation in the handler dispatcher.
    const ListEventsArgsSchema = z.object({
      calendarId: z.string().optional().default("primary"),
      timeMin: z.string().optional(),
      timeMax: z.string().optional(),
      maxResults: z.number().optional().default(250),
      singleEvents: z.boolean().optional().default(true),
      orderBy: z.enum(["startTime", "updated"]).optional().default("startTime"),
    });
  • src/index.ts:113-150 (registration)
    Tool object registration in the tools array, defining name, description, and input schema for MCP ListTools response.
    {
      name: "list_events",
      description: "List events from a Google Calendar",
      inputSchema: {
        type: "object",
        properties: {
          calendarId: {
            type: "string",
            description: "Calendar ID (default: 'primary')",
            default: "primary",
          },
          timeMin: {
            type: "string",
            description: "Lower bound for event start time (RFC3339 timestamp)",
          },
          timeMax: {
            type: "string",
            description: "Upper bound for event start time (RFC3339 timestamp)",
          },
          maxResults: {
            type: "number",
            description: "Maximum number of events to return (default: 250)",
            default: 250,
          },
          singleEvents: {
            type: "boolean",
            description: "Whether to expand recurring events (default: true)",
            default: true,
          },
          orderBy: {
            type: "string",
            enum: ["startTime", "updated"],
            description: "Order of events (default: 'startTime')",
            default: "startTime",
          },
        },
      },
    },
  • src/index.ts:547-549 (registration)
    Dispatch case in CallToolRequestHandler that validates args with schema and calls the list_events handler.
    case "list_events": {
      const validatedArgs = ListEventsArgsSchema.parse(args);
      return await handleListEvents(validatedArgs);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic operation. It doesn't mention pagination behavior, rate limits, authentication requirements, error conditions, or what happens with large result sets. For a read operation with 6 parameters, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, focused sentence with zero wasted words. It's perfectly front-loaded with the core purpose and efficiently communicates the essential operation without unnecessary elaboration or redundancy.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't address return format, pagination, error handling, or typical usage patterns. The agent would need to infer too much about how this tool behaves in practice.

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 description adds no parameter-specific information beyond what's already in the schema (which has 100% coverage). It doesn't explain relationships between parameters like timeMin/timeMax, provide usage examples, or clarify edge cases. The baseline score of 3 reflects adequate but minimal value addition given the comprehensive schema.

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 ('List') and resource ('events from a Google Calendar'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'list_calendars' beyond the resource name, missing explicit scope distinction that would warrant a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_calendars' or 'create_event'. There's no mention of prerequisites, typical use cases, or contextual triggers for selecting this specific listing operation over others.

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/peadams21/Google-Calendar-MCP-Server'

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