create_event
Schedule calendar events by specifying details like subject, start/end times, location, and attendees. Integrates with Microsoft Outlook via MCP server for efficient event management.
Instructions
Create a calendar event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| attendees | No | ||
| body | No | ||
| end | Yes | ||
| location | No | ||
| start | Yes | ||
| subject | Yes | ||
| timezone | No | UTC |
Implementation Reference
- src/microsoft_mcp/tools.py:517-550 (handler)The handler function for the 'create_event' tool. It constructs a calendar event payload from input parameters and uses graph.request to POST it to the Microsoft Graph API endpoint '/me/events' to create the event.@mcp.tool def create_event( account_id: str, subject: str, start: str, end: str, location: str | None = None, body: str | None = None, attendees: str | list[str] | None = None, timezone: str = "UTC", ) -> dict[str, Any]: """Create a calendar event""" event = { "subject": subject, "start": {"dateTime": start, "timeZone": timezone}, "end": {"dateTime": end, "timeZone": timezone}, } if location: event["location"] = {"displayName": location} if body: event["body"] = {"contentType": "Text", "content": body} if attendees: attendees_list = [attendees] if isinstance(attendees, str) else attendees event["attendees"] = [ {"emailAddress": {"address": a}, "type": "required"} for a in attendees_list ] result = graph.request("POST", "/me/events", account_id, json=event) if not result: raise ValueError("Failed to create event") return result