Skip to main content
Glama

get_calendar_events

Retrieve calendar events from personal or school calendars with date range filtering and predefined period options.

Instructions

Get calendar events with advanced options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendar_typeNoType of calendar to retrieve (personal or school)personal
from_dateNoStart date in YYYY-MM-DD format (optional). If only from_date is provided, it will be treated as a single day.
to_dateNoEnd date in YYYY-MM-DD format (optional). Must be at least 1 day after from_date when both are provided.
periodNoPredefined period (optional, overrides from/to dates). Use "today" for single day queries.

Implementation Reference

  • src/server.ts:261-292 (registration)
    Tool registration and input schema definition for get_calendar_events in the ListToolsRequestSchema handler.
    {
      name: "get_calendar_events",
      description: "Get calendar events with advanced options",
      inputSchema: {
        type: "object",
        properties: {
          calendar_type: {
            type: "string",
            enum: ["personal", "school"],
            description:
              "Type of calendar to retrieve (personal or school)",
            default: "personal",
          },
          from_date: {
            type: "string",
            description:
              "Start date in YYYY-MM-DD format (optional). If only from_date is provided, it will be treated as a single day.",
          },
          to_date: {
            type: "string",
            description:
              "End date in YYYY-MM-DD format (optional). Must be at least 1 day after from_date when both are provided.",
          },
          period: {
            type: "string",
            enum: ["today", "week", "month"],
            description:
              'Predefined period (optional, overrides from/to dates). Use "today" for single day queries.',
          },
        },
      },
    },
  • The core handler logic for executing the get_calendar_events tool. Parses arguments, determines calendar type and date range using helper methods on the API instance, fetches the schedule data, and formats the response.
    case "get_calendar_events":
      try {
        const { calendar_type, from_date, to_date, period } = args as {
          calendar_type?: string;
          from_date?: string;
          to_date?: string;
          period?: string;
        };
    
        // Determine calendar type
        const calendarType =
          calendar_type === "school"
            ? CalendarType.SCHOOL
            : CalendarType.PERSONAL;
    
        // Determine date range
        let dateRange;
        if (period) {
          switch (period) {
            case "today": {
              const today = new Date();
              dateRange = this.api.createSingleDayRange(today);
              break;
            }
            case "week":
              dateRange = this.api.createWeekDateRange();
              break;
            case "month":
              dateRange = this.api.createMonthDateRange();
              break;
            default:
              throw new Error(`Invalid period: ${period}`);
          }
        } else if (from_date && to_date) {
          dateRange = this.api.createDateRange(from_date, to_date);
        } else if (from_date) {
          // Single day range
          dateRange = this.api.createSingleDayRange(from_date);
        }
        // If no date parameters, use default (current week)
    
        const schedule = await this.api.getSchedule(
          calendarType,
          dateRange,
        );
    
        return {
          content: [
            {
              type: "text",
              text: `[DATE] Calendar Events (${calendar_type || "personal"})${
                dateRange
                  ? ` from ${dateRange.from.toDateString()} to ${dateRange.to.toDateString()}`
                  : " (current week)"
              }\n\n${JSON.stringify(schedule, null, 2)}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error instanceof Error ? error.message : "Unknown error"}\n\nTo authenticate:\n1. Login to N Lobby in your browser\n2. Open Developer Tools (F12)\n3. Go to Application/Storage tab\n4. Copy cookies and use the set_cookies tool\n5. Use health_check to verify connection`,
            },
          ],
        };
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'advanced options' but doesn't disclose any behavioral traits such as authentication requirements, rate limits, pagination, error handling, or what 'advanced' means operationally. The description is too vague to inform the agent about how the tool behaves beyond the basic action.

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, efficient sentence that is front-loaded with the core action. However, 'advanced options' is ambiguous and doesn't earn its place by adding clear value, slightly reducing conciseness. Overall, it's brief but could be more precise.

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 4 parameters, no annotations, and no output schema, the description is incomplete. It fails to compensate for the lack of structured data by not explaining return values, error conditions, or the meaning of 'advanced options'. For a tool with multiple parameters and no output schema, this leaves significant gaps in understanding.

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%, providing detailed descriptions for all 4 parameters including enums and defaults. The description adds no additional parameter semantics beyond the schema, as 'advanced options' is too vague to map to specific parameters. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get calendar events with advanced options' which provides a basic verb+resource combination ('Get calendar events'), but lacks specificity about what 'advanced options' entails. It distinguishes from obvious non-calendar siblings but doesn't clearly differentiate from potential calendar-related tools like 'get_schedule' or 'test_calendar_endpoints'.

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. The description mentions 'advanced options' but doesn't specify what makes it advanced compared to other tools like 'get_schedule' or when to prefer one over the other. There's no mention of prerequisites, context, or exclusions.

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/minagishl/nlobby-cli'

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