Skip to content

feat: Add freebusy_query tool (client-side implementation) #36

Description

@PhilflowIO

Motivation

FreeBusy queries are useful for "When am I free?" queries.

Problem with native CalDAV free-busy-query

The native CalDAV free-busy-query REPORT (RFC 4791) has poor server support:

Server Native FreeBusy Support
Google CalDAV ❌ Not supported
iCloud ❌ 500 Internal Server Error
Radicale ❌ Not implemented (Issue #34 open since 2013)
Nextcloud ⚠️ Bugs (Issue #50239, #6740)
Baikal ⚠️ Users report problems
DAViCal ✅ Works

tsdav documentation explicitly warns:

"a lot of caldav providers do not support this method like google, apple. use with caution."

Solution: Client-Side Calculation

Instead of relying on server support, we calculate FreeBusy client-side:

  1. Fetch events in time range (works with ALL servers)
  2. Evaluate TRANSP property (OPAQUE = busy, TRANSPARENT = free)
  3. Calculate and return busy/free slots

Advantages:

  • ✅ Works with ALL CalDAV servers
  • ✅ Consistent behavior
  • ✅ No server dependency

Disadvantages:

  • ⚠️ Requires read access to calendar (not just FreeBusy permission)
  • ⚠️ More data is transferred

Implementation

  • New tool: freebusy_query
  • Optional: calendar_url (all calendars if not specified)
  • Required: time_range_start, time_range_end
  • Optional: include_event_details (shows event titles)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions