Skip to content
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.

NuGet downloads for Shiny.Calendar.Extensions.AI
using Shiny.Calendar;
using Shiny.Calendar.Extensions.AI;
builder.Services.AddCalendarStore(); // registers ICalendarStore
builder.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] }
);

CalendarAICapabilities is a [Flags] enum, so each operation toggles independently:

FlagTools exposed
Readlist_calendars, search_events, get_event
Createcreate_event
Updateupdate_event
Deletedelete_event
WriteCreate | Update | Delete
AllRead | 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)
ToolCapabilityDescription
list_calendarsReadLists device calendars (id, name, colour, read-only).
search_eventsReadEvents in a date window, optional calendar id + free-text query.
get_eventReadFull detail for one event (attendees, reminders, recurrence).
create_eventCreateCreates an event (title, start, end required; ISO-8601 dates).
update_eventUpdateUpdates supplied fields on an existing event.
delete_eventDeleteDeletes an event by id. Optional deleteSeries (default false) chooses one occurrence vs. this and all future ones.
  • AddCalendarAITools(Action<ICalendarAIToolBuilder>) — DI extension; throws if nothing is added.
  • ICalendarAIToolBuilderAddCalendar(CalendarAICapabilities).
  • CalendarAICapabilities [Flags]None, Read, Create, Update, Delete, Write, All.
  • CalendarAITools — resolve from DI; .Tools is IReadOnlyList<AITool>.