Skip to main content
Glama
seandkendall

productivity-mcp

by seandkendall

list_events

Retrieve events from your calendars within a specified date range using ISO 8601 format. Filter by account or calendar for targeted results.

Instructions

List events in a time range (defaults: now → +7 days). ISO 8601 strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNo
calendarNo
startNo
endNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'list_events'. Defines the @mcp.tool() function that parses ISO 8601 start/end strings, defaults to now→+7 days, and delegates to _calendar(account).list_events(). Returns list of CalendarEvent.to_dict().
    @mcp.tool()
    @_logged
    def list_events(
        account: str | None = None,
        calendar: str | None = None,
        start: str | None = None,
        end: str | None = None,
        limit: int = 100,
    ) -> list[dict[str, Any]]:
        """List events in a time range (defaults: now → +7 days). ISO 8601 strings."""
        start_dt = _parse_dt(start) if start else datetime.now(UTC)
        end_dt = _parse_dt(end) if end else start_dt + timedelta(days=7)
        events = _calendar(account).list_events(calendar, start_dt, end_dt, limit=limit)
        return [e.to_dict() for e in events]
  • Abstract base class definition for list_events. Declares the abstract method signature that all calendar providers must implement: list_events(calendar, start, end, limit) -> list[CalendarEvent].
    @abstractmethod
    def list_events(
        self,
        calendar: str | None,
        start: datetime,
        end: datetime,
        limit: int = 100,
    ) -> list[CalendarEvent]: ...
  • CalDAV implementation of list_events. Uses caldav library to search the specified calendar between start/end, parses iCalendar data, and returns CalendarEvent objects.
    def list_events(
        self,
        calendar: str | None,
        start: datetime,
        end: datetime,
        limit: int = 100,
    ) -> list[CalendarEvent]:
        cal = self._find_calendar(calendar)
        results = cal.search(start=start, end=end, event=True, expand=True)
        events: list[CalendarEvent] = []
        for item in results[:limit]:
            parsed = _parse_ical(item.data, cal.name)
            events.extend(parsed)
        return events
  • EWS (Exchange/WorkMail) implementation of list_events. Uses exchangelib to query the calendar view, converts from EWS timezone-aware datetimes, and returns CalendarEvent objects.
    def list_events(
        self,
        calendar: str | None,
        start: datetime,
        end: datetime,
        limit: int = 100,
    ) -> list[CalendarEvent]:
        acct = self._acct()
        tz = acct.default_timezone or EWSTimeZone("UTC")
        start_ews = EWSDateTime.from_datetime(start).astimezone(tz)
        end_ews = EWSDateTime.from_datetime(end).astimezone(tz)
        qs = acct.calendar.view(start=start_ews, end=end_ews)
        events: list[CalendarEvent] = []
        for item in qs[:limit]:
            events.append(_to_event(item, acct.calendar.name))
        return events
  • Google Calendar implementation of list_events. Uses Google Calendar API v3 events().list() with timeMin/timeMax, resolves calendar ID, and returns CalendarEvent objects.
    def list_events(
        self,
        calendar: str | None,
        start: datetime,
        end: datetime,
        limit: int = 100,
    ) -> list[CalendarEvent]:
        resp = (
            self._svc()
            .events()
            .list(
                calendarId=self._resolve_calendar(calendar),
                timeMin=start.isoformat() + ("Z" if start.tzinfo is None else ""),
                timeMax=end.isoformat() + ("Z" if end.tzinfo is None else ""),
                maxResults=limit,
                singleEvents=True,
                orderBy="startTime",
            )
            .execute()
        )
        return [self._to_event(e, self._resolve_calendar(calendar)) for e in resp.get("items", [])]
Behavior2/5

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

No annotations are provided, so the description must fully disclose behaviors. It mentions time-range defaults but does not state that the tool is read-only, how results are sorted, pagination behavior, or any side effects. This is insufficient for safe agent use.

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?

Single sentence, no wasted words, front-loaded with core purpose and critical details. Efficiently conveys the tool's action and key constraints.

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?

While the description is concise, it omits important context like result ordering, pagination, or how the account and calendar parameters affect behavior. An output schema exists but its content is unknown; the description still should provide more operational details.

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

Parameters2/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 meaning only for start and end parameters by specifying ISO 8601 format and default behavior. The other three parameters (account, calendar, limit) receive no additional context beyond their names.

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

Purpose5/5

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

The description clearly states the tool lists events within a time range, with explicit defaults and format (ISO 8601). It distinguishes from siblings like create_event or search_events by focusing on time-range listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides useful context: defaults (now to +7 days) and format requirements. However, it lacks explicit guidance on when to use this tool versus similar alternatives like search_events.

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/seandkendall/productivity-mcp'

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