Skip to main content
Glama

get_upcoming_events

Retrieve scheduled events from Google Calendar for a specified number of upcoming days to view your agenda and manage time effectively.

Instructions

Get upcoming events for the next N days

Args: days_ahead: Number of days to look ahead (default: 7) calendar_id: Calendar ID (default: primary)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
days_aheadNo
calendar_idNoprimary

Implementation Reference

  • main.py:465-492 (handler)
    Handler function decorated with @mcp.tool(), implementing the get_upcoming_events tool logic. Fetches upcoming events from Google Calendar within the specified days_ahead using GoogleCalendarTools.
    @mcp.tool()
    def get_upcoming_events(days_ahead: int = 7, calendar_id: str = "primary") -> str:
        """
        Get upcoming events for the next N days
        
        Args:
            days_ahead: Number of days to look ahead (default: 7)
            calendar_id: Calendar ID (default: primary)
        """
        try:
            # Calculate date range
            now = datetime.now()
            future = now + timedelta(days=days_ahead)
            time_min = now.isoformat() + 'Z'
            time_max = future.isoformat() + 'Z'
            
            result = GoogleCalendarTools.get_calendar_events(
                NANGO_CONNECTION_ID, NANGO_INTEGRATION_ID, calendar_id, time_min, time_max, 50
            )
            
            return json.dumps(result, indent=2)
        except Exception as e:
            logger.error(f"Error in get_upcoming_events: {e}")
            return json.dumps({
                "success": False,
                "error": str(e),
                "message": "Failed to retrieve upcoming events"
            }, indent=2)
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It implies a read operation ('Get') but doesn't disclose permissions needed, rate limits, pagination, error conditions, or what 'upcoming events' includes (e.g., all-day events, recurring events). The description is functional but lacks critical operational details.

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 appropriately sized with a clear purpose statement followed by parameter details in a structured 'Args:' section. Every sentence earns its place by explaining the tool's function and parameters without unnecessary fluff, though it could be slightly more front-loaded with key distinctions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and parameters well, but lacks guidance on sibling differentiation and behavioral traits like permissions or output format, leaving gaps for the agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context for both parameters: 'days_ahead' specifies it's the 'Number of days to look ahead' with a default, and 'calendar_id' clarifies it's a 'Calendar ID' with a default. This goes beyond the schema's basic titles and types, providing practical usage information.

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 tool's purpose with a specific verb ('Get') and resource ('upcoming events'), including the temporal scope ('for the next N days'). It distinguishes from some siblings like 'get_today_events' by specifying a variable time range, but doesn't explicitly differentiate from 'get_calendar_events' which might have overlapping functionality.

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 'get_calendar_events' or 'get_today_events'. It mentions the parameters but doesn't explain scenarios where this tool is preferred over siblings, leaving the agent to guess based on tool names alone.

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/Shameerpc5029/google-calendar-mcp'

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