Skip to main content
Glama

list_events

Retrieve and display calendar events within a specified date range, including recurring instances, using the Microsoft MCP server. Ideal for managing and organizing Outlook schedules efficiently.

Instructions

List calendar events within specified date range, including recurring event instances

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes
days_aheadNo
days_backNo
include_detailsNo

Implementation Reference

  • The handler function for the 'list_events' tool. It queries the Microsoft Graph API's /me/calendarView endpoint to list calendar events within a specified date range, handling recurring events, with options for date range and detail level.
    @mcp.tool def list_events( account_id: str, days_ahead: int = 7, days_back: int = 0, include_details: bool = True, ) -> list[dict[str, Any]]: """List calendar events within specified date range, including recurring event instances""" now = dt.datetime.now(dt.timezone.utc) start = (now - dt.timedelta(days=days_back)).isoformat() end = (now + dt.timedelta(days=days_ahead)).isoformat() params = { "startDateTime": start, "endDateTime": end, "$orderby": "start/dateTime", "$top": 100, } if include_details: params["$select"] = ( "id,subject,start,end,location,body,attendees,organizer,isAllDay,recurrence,onlineMeeting,seriesMasterId" ) else: params["$select"] = "id,subject,start,end,location,organizer,seriesMasterId" # Use calendarView to get recurring event instances events = list( graph.request_paginated("/me/calendarView", account_id, params=params) ) return events

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/elyxlz/microsoft-mcp'

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