Skip to main content
Glama

list_calendar_events

Retrieve upcoming Google Calendar events to view your schedule and manage appointments within your Obsidian vault.

Instructions

List upcoming Google Calendar events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
days_aheadNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core helper method in CalendarService that queries the Google Calendar API to list events within a time range. Returns list of event dicts from the API. Used by the MCP tool handler. This is the main implementation logic for fetching events." ,
    def list_events(
        self,
        max_results: int = 10,
        time_min: datetime | None = None,
        time_max: datetime | None = None,
    ) -> list[dict[str, Any]]:
        """
        List upcoming calendar events.
    
        Args:
            max_results: Maximum number of events to return
            time_min: Start of time range (default: now)
            time_max: End of time range (default: 7 days from now)
    
        Returns:
            List of event details
    
        Raises:
            CalendarError: If listing fails
        """
        service = self.get_service()
    
        if time_min is None:
            time_min = datetime.now(timezone.utc)
        if time_max is None:
            time_max = time_min + timedelta(days=7)
    
        try:
            events_result = (
                service.events()
                .list(
                    calendarId=self.calendar_id,
                    timeMin=time_min.isoformat() + "Z",
                    timeMax=time_max.isoformat() + "Z",
                    maxResults=max_results,
                    singleEvents=True,
                    orderBy="startTime",
                )
                .execute()
            )
            events = events_result.get("items", [])
            logger.info(f"Retrieved {len(events)} calendar events")
            return events  # type: ignore[no-any-return]
        except HttpError as e:
            raise CalendarError(f"Failed to list events: {e}") from e
    
    def get_event(self, event_id: str) -> dict[str, Any]:
        """
        Get a specific calendar event.
    
        Args:
            event_id: Event ID
    
        Returns:
            Event details
    
        Raises:
            CalendarError: If retrieval fails
        """
        service = self.get_service()
    
        try:
            event = service.events().get(calendarId=self.calendar_id, eventId=event_id).execute()
            return event  # type: ignore[no-any-return]
        except HttpError as e:
            raise CalendarError(f"Failed to get event: {e}") from e
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 action ('List upcoming') but doesn't mention authentication requirements, rate limits, pagination behavior, error conditions, or what 'upcoming' means relative to current time. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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, efficient sentence that gets straight to the point with no wasted words. It's appropriately sized for a simple listing tool and front-loads the essential information.

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 (listing with filtering), no annotations, and an output schema that presumably covers return values, the description is minimally adequate. It states what the tool does but lacks important context about behavior, parameters, and differentiation from siblings. The existence of an output schema prevents this from being a lower score.

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 has 0% description coverage, so parameters are only documented by their titles and types. The description doesn't mention either parameter, providing no additional semantic meaning beyond what's in the schema. However, with only 2 parameters and default values provided in the schema, the baseline is 3 as the schema provides basic documentation.

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 verb ('List') and resource ('Google Calendar events') with a qualifier ('upcoming'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'search_calendar_events', which could serve a similar purpose with 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 'search_calendar_events' or 'get_calendar_event'. It lacks any context about prerequisites, appropriate scenarios, or exclusions, leaving the agent to infer usage from the name 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/getglad/obsidian_mcp'

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