Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!
AI Tools
The optional Shiny.Calendar.Extensions.AI package exposes ICalendarStore as
Microsoft.Extensions.AI tool functions (AIFunctions) for
LLM agents. You opt-in per operation — read, create, update, delete — an allow-list you control on
behalf of the agent (this is not an OS permission prompt; the platform calendar permission must
already be granted). AOT-compatible: hand-built schemas and JsonNode results, no reflection.
using Shiny.Calendar;using Shiny.Calendar.Extensions.AI;
builder.Services.AddCalendarStore(); // registers ICalendarStorebuilder.Services.AddCalendarAITools(tools => tools .AddCalendar(CalendarAICapabilities.Read | CalendarAICapabilities.Create));Resolve the bundle and hand the tools to any IChatClient:
var tools = sp.GetRequiredService<CalendarAITools>().Tools;var response = await chatClient.GetResponseAsync( messages, new ChatOptions { Tools = [.. tools] });Capabilities
Section titled “Capabilities”CalendarAICapabilities is a [Flags] enum, so each operation toggles independently:
| Flag | Tools exposed |
|---|---|
Read | list_calendars, search_events, get_event |
Create | create_event |
Update | update_event |
Delete | delete_event |
Write | Create | Update | Delete |
All | Read | Write |
// read + create only — the agent can add events but not modify or delete them.AddCalendar(CalendarAICapabilities.Read | CalendarAICapabilities.Create)
// full access.AddCalendar(CalendarAICapabilities.All)Generated Tools
Section titled “Generated Tools”| Tool | Capability | Description |
|---|---|---|
list_calendars | Read | Lists device calendars (id, name, colour, read-only). |
search_events | Read | Events in a date window, optional calendar id + free-text query. |
get_event | Read | Full detail for one event (attendees, reminders, recurrence). |
create_event | Create | Creates an event (title, start, end required; ISO-8601 dates). |
update_event | Update | Updates supplied fields on an existing event. |
delete_event | Delete | Deletes an event by id. Optional deleteSeries (default false) chooses one occurrence vs. this and all future ones. |
Key Types
Section titled “Key Types”AddCalendarAITools(Action<ICalendarAIToolBuilder>)— DI extension; throws if nothing is added.ICalendarAIToolBuilder—AddCalendar(CalendarAICapabilities).CalendarAICapabilities[Flags]—None,Read,Create,Update,Delete,Write,All.CalendarAITools— resolve from DI;.ToolsisIReadOnlyList<AITool>.