Skip to main content
Glama

calendar_get_upcoming_events

Retrieve upcoming calendar events within a specified date range to help users view and manage their schedule.

Instructions

Get upcoming events in date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days ahead to look (default: 7)

Implementation Reference

  • src/index.ts:266-277 (registration)
    Registration of the calendar_get_upcoming_events tool, including name, description, and input schema definition.
      name: 'calendar_get_upcoming_events',
      description: 'Get upcoming events in date range',
      inputSchema: {
        type: 'object',
        properties: {
          days: {
            type: 'number',
            description: 'Number of days ahead to look (default: 7)',
          },
        },
      },
    },
  • The handler for calendar_get_upcoming_events executes an AppleScript command via execAsync to retrieve upcoming calendar events within the specified number of days (default 7), formats the output, and returns it as text content.
    case 'calendar_get_upcoming_events':
      try {
        const days = (args?.days as number) || 7;
        
        const command = `osascript -e 'on run argv
          set numDays to (item 1 of argv) as number
          tell application "Calendar"
            set upcomingEvents to {}
            set startDate to (current date)
            set endDate to startDate + (numDays * 24 * 60 * 60)
            repeat with aCal in calendars
              set calName to title of aCal
              repeat with anEvent in events of aCal
                set eventStart to start date of anEvent
                if eventStart ≥ startDate and eventStart ≤ endDate then
                  set eventSummary to summary of anEvent
                  set eventTime to (eventStart as string)
                  set end of upcomingEvents to (eventSummary & " (" & calName & ") - " & eventTime)
                end if
              end repeat
            end repeat
            return upcomingEvents as string
          end tell
        end run' -- ${days}`;
        
        const { stdout, stderr } = await execAsync(command);
        
        if (stderr.trim()) {
          return {
            content: [
              {
                type: 'text',
                text: `Error getting upcoming events: ${stderr.trim()}`,
              },
            ],
          };
        }
        
        const output = stdout.trim();
        if (!output || output === '') {
          return {
            content: [
              {
                type: 'text',
                text: `No events scheduled in the next ${days} days`,
              },
            ],
          };
        }
        
        return {
          content: [
            {
              type: 'text',
              text: `Upcoming Events (next ${days} days):\n${output}`,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error executing upcoming events command: ${error.message}`,
            },
          ],
        };
      }
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. It states the basic function but lacks critical details: whether it requires authentication, rate limits, what format events are returned in, pagination behavior, or error conditions. For a read operation with zero annotation coverage, this is insufficient.

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 extremely concise at just 5 words, front-loading the core purpose with zero wasted words. Every element ('Get upcoming events in date range') directly contributes to understanding the tool's function.

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 no annotations, no output schema, and multiple sibling calendar tools, the description is incomplete. It doesn't explain what 'upcoming events' means operationally, how results are structured, or how it differs from similar tools. The agent would need to guess about return format and behavioral characteristics.

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 schema description coverage is 100% (the 'days' parameter is fully documented in the schema), so the baseline is 3. The description adds no additional parameter information beyond what's already in the schema, maintaining the minimum viable level.

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 ('Get upcoming events') and scope ('in date range'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'calendar_get_today_events' or 'calendar_get_calendars', which prevents 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 'calendar_get_today_events' or 'calendar_get_calendars'. There's no mention of prerequisites, exclusions, or specific contexts where this tool is preferred over siblings.

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/samicokar/mcp-mac'

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