From 71f09a47caba539b3ca8528b6311159461a79446 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Mon, 20 Oct 2025 00:54:35 +0200 Subject: [PATCH] docs: Update CalendarClient docstrings [skip ci] --- nextcloud_mcp_server/client/calendar.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nextcloud_mcp_server/client/calendar.py b/nextcloud_mcp_server/client/calendar.py index fa49499..ec19974 100644 --- a/nextcloud_mcp_server/client/calendar.py +++ b/nextcloud_mcp_server/client/calendar.py @@ -97,7 +97,9 @@ class CalendarClient: async def list_calendars(self) -> List[Dict[str, Any]]: """List all available calendars for the user.""" - # Use PROPFIND to discover calendars in the calendar home set + # Use custom PROPFIND with CalendarServer namespace (cs:) for calendar-color. + # caldav library's nsmap lacks "CS" namespace, and its CalendarColor uses + # Apple iCal namespace which Nextcloud doesn't recognize. from lxml import etree propfind_body = """ @@ -186,8 +188,10 @@ class CalendarClient: color: str = "#1976D2", ) -> Dict[str, Any]: """Create a new calendar with retry on 429 errors.""" - # Use direct MKCALENDAR request instead of caldav library's make_calendar - # to avoid XML element issues + # Use custom MKCALENDAR XML instead of caldav library's make_calendar() due to: + # 1. Missing CalendarServer namespace (cs:) in caldav's nsmap + # 2. caldav's CalendarColor uses Apple iCal namespace, not cs:calendar-color + # 3. make_calendar() doesn't support calendar-description or calendar-color params calendar_url = ( f"{self.base_url}/remote.php/dav/calendars/{self.username}/{calendar_name}/" )