Skip to main content
Glama
AnByoungHyun

Google Calendar MCP

by AnByoungHyun

create_event

Schedule new Google Calendar events by specifying summary, start and end times, location, description, and attendee emails via the MCP server.

Instructions

새로운 일정 생성 (attendees: 이메일 리스트)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attendeesNo
descriptionNo
endYes
locationNo
startYes
summaryYes

Implementation Reference

  • The main handler function for the 'create_event' tool. It is decorated with @mcp.tool() which registers it, constructs an event body from parameters, and inserts it into the primary Google Calendar using the authenticated service.
    @mcp.tool()
    def create_event(summary: str, start: str, end: str, description: str = None, location: str = None, attendees: Optional[List[str]] = None) -> dict[str, Any]:
        """새로운 일정 생성 (attendees: 이메일 리스트)"""
        service = get_calendar_service()
        event_body = {
            "summary": summary,
            "description": description,
            "start": {"dateTime": start},
            "end": {"dateTime": end},
        }
        if location:
            event_body["location"] = location
        if attendees:
            event_body["attendees"] = [{"email": email} for email in attendees]
        event = service.events().insert(calendarId='primary', body=event_body).execute()
        return {"message": "일정이 등록되었습니다.", "event": event}
  • Helper function that provides the authenticated Google Calendar API service, handling OAuth token management and refresh. Used by the create_event handler.
    def get_calendar_service():
        creds = None
        if os.path.exists(TOKEN_FILE):
            with open(TOKEN_FILE, "rb") as token:
                creds = pickle.load(token)
        if not creds or not creds.valid:
            if creds and creds.expired and creds.refresh_token:
                creds.refresh(Request())
            else:
                flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRET_FILE, SCOPES)
                creds = flow.run_local_server(port=0)
            with open(TOKEN_FILE, "wb") as token:
                pickle.dump(creds, token)
        service = build("calendar", "v3", credentials=creds)
        return service 
  • The @mcp.tool() decorator registers the create_event function as an MCP tool.
    @mcp.tool()
Install Server

Other Tools

Related 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/AnByoungHyun/google_calendar_mcp'

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