Skip to main content
Glama

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
NameRequiredDescriptionDefault
account_idYes
attendeesNo
bodyNo
endYes
locationNo
startYes
subjectYes
timezoneNoUTC

Implementation Reference

  • 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

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