CreateEventTool

class CreateEventTool(context: Context) : McpTool

Inserts a new event into CalendarContract.Events via ContentResolver. Requires WRITE_CALENDAR (plus READ_CALENDAR for the default-calendar lookup). start/end are parsed strictly as yyyy-MM-dd HH:mm (device timezone; impossible dates and trailing text are rejected) and end must be after start. When calendar_id is omitted it falls back to the primary calendar, else the first visible calendar with at least contributor access (see CalendarSupport.findWritableCalendarId). Output: event_id (the inserted row id, may be null if the URI lacks a numeric segment), plus echoed title, start, and end.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val outputSchema: Map<String, Any>
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult