Package-level declarations

Types

Link copied to clipboard

Provider for the calendar tool module. Wires up ReadCalendarTool, CreateEventTool, and SearchEventsTool, which read/write events via CalendarContract. Requires READ_CALENDAR (reads) and WRITE_CALENDAR (event creation).

Link copied to clipboard
class CreateEventTool(context: Context) : McpTool

Inserts a new event into CalendarContract.Events via ContentResolver. Requires WRITE_CALENDAR. start/end are parsed as yyyy-MM-dd HH:mm (device timezone); when calendar_id is omitted it falls back to the primary calendar (or first available, see getPrimaryCalendarId). Output: event_id (the inserted row id, may be null if the URI lacks a numeric segment), plus echoed title, start, and end.

Link copied to clipboard
class ReadCalendarTool(context: Context) : McpTool

Reads calendar events in a date range via ContentResolver on CalendarContract.Events, filtered by DTSTART between start_date and end-of-end_date (soft-deleted rows excluded via DELETED != 1). Requires READ_CALENDAR.

Link copied to clipboard
class SearchEventsTool(context: Context) : McpTool

Searches calendar events whose TITLE or DESCRIPTION matches query (SQL LIKE substring), via ContentResolver on CalendarContract.Events, newest first. Requires READ_CALENDAR. Output: events (list of {id, title, start, end, location, description} with times formatted yyyy-MM-dd HH:mm), count, and the echoed query, capped at limit (1–100, default 10).