Skip to main content
Glama

get_today_events

Retrieve today's scheduled events from your primary Google Calendar to view your daily agenda and manage time effectively.

Instructions

Get today's events from the primary calendar

Args: calendar_id: Calendar ID (default: primary)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendar_idNoprimary

Implementation Reference

  • main.py:438-463 (handler)
    Handler function for the 'get_today_events' tool. Decorated with @mcp.tool() for registration. Computes today's date range and calls the helper to fetch events from Google Calendar, returning formatted JSON.
    @mcp.tool()
    def get_today_events(calendar_id: str = "primary") -> str:
        """
        Get today's events from the primary calendar
        
        Args:
            calendar_id: Calendar ID (default: primary)
        """
        try:
            # Get today's date range
            today = datetime.now()
            time_min = today.replace(hour=0, minute=0, second=0, microsecond=0).isoformat() + 'Z'
            time_max = today.replace(hour=23, minute=59, second=59, microsecond=999999).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_today_events: {e}")
            return json.dumps({
                "success": False,
                "error": str(e),
                "message": "Failed to retrieve today's events"
            }, indent=2)
  • Core helper utility (static method in GoogleCalendarTools) that implements the Google Calendar API call to list events, formats them, and handles errors. Used by get_today_events and other tools.
    @staticmethod
    def get_calendar_events(connection_id: str, provider_config_key: str, calendar_id: str = "primary", 
                           time_min: Optional[str] = None, time_max: Optional[str] = None,
                           max_results: int = 10) -> Dict:
        """Get events from Google Calendar with flexible filtering"""
        try:
            service = GoogleCalendarAuth.authenticate_google_calendar(connection_id, provider_config_key)
            
            params = {
                'calendarId': calendar_id,
                'maxResults': max_results,
                'singleEvents': True,
                'orderBy': 'startTime'
            }
            
            if time_min:
                params['timeMin'] = time_min
            if time_max:
                params['timeMax'] = time_max
            
            events_result = service.events().list(**params).execute()
            events = events_result.get('items', [])
            
            # Format events for better usability
            formatted_events = []
            for event in events:
                formatted_event = {
                    'id': event.get('id'),
                    'summary': event.get('summary', 'No Title'),
                    'description': event.get('description', ''),
                    'start': event.get('start', {}),
                    'end': event.get('end', {}),
                    'location': event.get('location', ''),
                    'status': event.get('status', ''),
                    'created': event.get('created'),
                    'updated': event.get('updated'),
                    'html_link': event.get('htmlLink'),
                    'calendar_id': calendar_id
                }
                formatted_events.append(formatted_event)
            
            return {
                "success": True,
                "events": formatted_events,
                "total_events": len(formatted_events),
                "calendar_id": calendar_id,
                "message": f"Retrieved {len(formatted_events)} events successfully"
            }
            
        except HttpError as error:
            logger.error(f'HTTP error in get_calendar_events: {error}')
            return {
                "success": False,
                "message": f"HTTP error occurred: {error}",
                "error": f"http_error_{error.resp.status if hasattr(error, 'resp') else 'unknown'}",
                "calendar_id": calendar_id
            }
        except Exception as error:
            logger.error(f'Unexpected error in get_calendar_events: {error}')
            return {
                "success": False,
                "message": f"Unexpected error occurred: {str(error)}",
                "error": "unexpected_error",
                "calendar_id": calendar_id
            }
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 discloses minimal behavioral traits. It mentions retrieving events but doesn't describe authentication requirements, rate limits, pagination behavior, error conditions, or what happens with invalid calendar IDs. The description doesn't contradict annotations (none exist), but provides inadequate behavioral context.

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 brief with two sentences and an Args section. The front-loaded purpose statement is clear, though the Args formatting could be more integrated. No wasted words, though slightly more context could improve completeness without sacrificing conciseness.

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 read operation with no annotations, no output schema, and minimal parameter documentation, the description is insufficient. It doesn't explain what format events are returned in, whether results are filtered by time of day, authentication requirements, or how it differs from sibling tools. The description leaves too many contextual gaps for effective tool selection.

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 the parameter 'calendar_id' with a brief explanation and default value, but with 0% schema description coverage and only 1 parameter, this provides basic compensation. However, it doesn't explain what constitutes a valid calendar ID format, whether 'primary' is a special value, or what happens with invalid IDs.

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 'Get today's events from the primary calendar' which specifies the verb (get), resource (events), and temporal scope (today). However, it doesn't explicitly differentiate from siblings like get_calendar_events or get_upcoming_events, which likely have different filtering capabilities.

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_upcoming_events. It mentions 'primary calendar' but doesn't explain when to use this versus other calendar tools or what makes 'today' different from other time ranges.

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