@chronary/toolkit 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -133,72 +133,90 @@ __export(schemas_exports, {
133
133
  UpdateWebhookSchema: () => UpdateWebhookSchema
134
134
  });
135
135
  var import_zod = require("zod");
136
+ var WEBHOOK_EVENT_TYPES = [
137
+ "agent.created",
138
+ "agent.updated",
139
+ "event.created",
140
+ "event.updated",
141
+ "event.deleted",
142
+ "event.started",
143
+ "event.ended",
144
+ "event.reminder",
145
+ "event.hold_created",
146
+ "event.hold_expired",
147
+ "event.hold_released",
148
+ "event.hold_confirmed",
149
+ "proposal.created",
150
+ "proposal.responded",
151
+ "proposal.confirmed",
152
+ "proposal.expired",
153
+ "proposal.cancelled",
154
+ "webhook.deactivated"
155
+ ];
156
+ var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
136
157
  var ListCalendarsSchema = import_zod.z.object({
137
- agent_id: import_zod.z.string().optional().describe("Filter calendars by agent ID"),
138
- include: import_zod.z.enum(["all"]).optional().describe('Set to "all" to include soft-deleted calendars'),
139
- limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
140
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
158
+ include: import_zod.z.enum(["all"]).optional().describe('Pass "all" to include calendars across all agents (org keys only)'),
159
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
160
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
141
161
  });
142
162
  var GetCalendarSchema = import_zod.z.object({
143
- calendar_id: import_zod.z.string().describe("The calendar ID to retrieve")
163
+ calendar_id: import_zod.z.string().describe("Calendar ID to fetch")
144
164
  });
145
165
  var CreateCalendarSchema = import_zod.z.object({
146
- name: import_zod.z.string().describe("Calendar name"),
147
- timezone: import_zod.z.string().describe('IANA timezone (e.g., "America/New_York")'),
148
- agent_id: import_zod.z.string().optional().describe("Agent ID to associate the calendar with"),
149
- default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Default reminder offsets in minutes before start, inherited by events that don't set their own (e.g. [10, 1440]). null/omit = system default (10 min); [] = no reminders. Max 5, each 1\u201340320."),
150
- metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
166
+ name: import_zod.z.string().min(1).max(255).describe("Calendar name"),
167
+ agent_id: import_zod.z.string().optional().describe("Agent ID to own this calendar (omit for org-level)"),
168
+ timezone: import_zod.z.string().min(1).describe("IANA timezone (e.g. America/New_York)"),
169
+ default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Default reminder offsets in minutes before start, inherited by events on this calendar that don't set their own. Omit or null to use the system default (10 min); [] for no reminders.")
151
170
  });
152
171
  var UpdateCalendarSchema = import_zod.z.object({
153
- calendar_id: import_zod.z.string().describe("The calendar ID to update"),
154
- name: import_zod.z.string().optional().describe("New calendar name"),
155
- timezone: import_zod.z.string().optional().describe("New IANA timezone"),
156
- default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("New default reminder offsets in minutes before start. null = system default (10 min); [] = no reminders. Max 5, each 1\u201340320."),
157
- metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Updated metadata")
172
+ calendar_id: import_zod.z.string().describe("Calendar ID to update"),
173
+ name: import_zod.z.string().min(1).max(255).optional().describe("New calendar name"),
174
+ timezone: import_zod.z.string().min(1).optional().describe("New IANA timezone (e.g. America/New_York)"),
175
+ agent_status: import_zod.z.enum(["idle", "working", "waiting", "error"]).optional().describe("Owning agent's status"),
176
+ default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Default reminder offsets in minutes; null for system default, [] for none"),
177
+ metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary metadata (max 16KB)")
158
178
  });
159
179
  var DeleteCalendarSchema = import_zod.z.object({
160
- calendar_id: import_zod.z.string().describe("The calendar ID to delete")
180
+ calendar_id: import_zod.z.string().describe("Calendar ID to delete")
161
181
  });
162
182
  var ListEventsSchema = import_zod.z.object({
163
- calendar_id: import_zod.z.string().optional().describe("Calendar ID to list events from (provide this or agent_id)"),
164
- agent_id: import_zod.z.string().optional().describe("Agent ID to list events for (provide this or calendar_id)"),
165
- start_after: import_zod.z.string().optional().describe("Only events starting after this ISO 8601 datetime"),
166
- start_before: import_zod.z.string().optional().describe("Only events starting before this ISO 8601 datetime"),
167
- status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional().describe("Filter by event status"),
168
- source: import_zod.z.enum(["internal", "external_ical"]).optional().describe("Filter by event source"),
169
- limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
170
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
183
+ calendar_id: import_zod.z.string().describe("Calendar ID to list events from"),
184
+ start_after: import_zod.z.string().datetime().optional().describe("Filter events starting after this time"),
185
+ start_before: import_zod.z.string().datetime().optional().describe("Filter events starting before this time"),
186
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
187
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
171
188
  });
172
189
  var GetEventSchema = import_zod.z.object({
173
- calendar_id: import_zod.z.string().describe("Calendar ID the event belongs to"),
174
- event_id: import_zod.z.string().describe("The event ID to retrieve")
190
+ event_id: import_zod.z.string().describe("Event ID to retrieve"),
191
+ calendar_id: import_zod.z.string().describe("Calendar ID that owns the event. Required \u2014 the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id).")
175
192
  });
176
193
  var CreateEventSchema = import_zod.z.object({
177
- calendar_id: import_zod.z.string().describe("Calendar ID to create the event on"),
178
- title: import_zod.z.string().describe("Event title"),
179
- start_time: import_zod.z.string().describe("Start time in ISO 8601 format"),
180
- end_time: import_zod.z.string().describe("End time in ISO 8601 format"),
181
- description: import_zod.z.string().optional().describe("Event description"),
182
- all_day: import_zod.z.boolean().optional().describe("Whether this is an all-day event"),
183
- status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional().describe('Event status (default "confirmed")'),
184
- reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Reminder offsets in minutes before start (e.g. [10, 1440]). Each fires an event.reminder webhook. null/omit = inherit calendar default (then 10 min); [] = no reminders. Max 5, each 1\u201340320."),
185
- metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
194
+ calendar_id: import_zod.z.string().describe("Calendar ID to add the event to"),
195
+ title: import_zod.z.string().min(1).max(500).describe("Event title"),
196
+ start_time: import_zod.z.string().datetime().describe("Start time (ISO 8601)"),
197
+ end_time: import_zod.z.string().datetime().describe("End time (ISO 8601)"),
198
+ description: import_zod.z.string().optional().describe("Optional event description"),
199
+ all_day: import_zod.z.boolean().default(false).describe("Whether this is an all-day event"),
200
+ status: import_zod.z.enum(["confirmed", "tentative", "hold"]).optional().describe('Event status. "hold" creates a tentative reservation that auto-expires at hold_expires_at. Defaults to "confirmed".'),
201
+ reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Reminder offsets in minutes before start_time (e.g. [10, 1440]). Each fires an event.reminder webhook and shows as an alarm in the iCal feed. Omit or null to inherit the calendar default (then the system default of 10 min); [] for no reminders."),
202
+ hold_expires_at: import_zod.z.string().datetime().optional().describe('Required when status="hold". ISO 8601 timestamp 30s-15min in the future. Auto-releases the hold when reached.'),
203
+ hold_priority: import_zod.z.number().int().min(0).max(100).optional().describe('Only valid with status="hold". Higher-priority overlapping holds pre-empt lower-priority ones. Defaults to 0.')
186
204
  });
187
205
  var UpdateEventSchema = import_zod.z.object({
188
- calendar_id: import_zod.z.string().describe("Calendar ID the event belongs to"),
189
- event_id: import_zod.z.string().describe("The event ID to update"),
190
- title: import_zod.z.string().optional().describe("New event title"),
191
- description: import_zod.z.string().nullable().optional().describe("New description (null to clear)"),
192
- start_time: import_zod.z.string().optional().describe("New start time in ISO 8601 format"),
193
- end_time: import_zod.z.string().optional().describe("New end time in ISO 8601 format"),
206
+ event_id: import_zod.z.string().describe("Event ID to update"),
207
+ calendar_id: import_zod.z.string().describe("Calendar ID that owns the event. Required \u2014 the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id)."),
208
+ title: import_zod.z.string().min(1).max(500).optional().describe("New event title"),
209
+ description: import_zod.z.string().nullable().optional().describe("New description, or null to clear it"),
210
+ start_time: import_zod.z.string().datetime().optional().describe("New start time (ISO 8601)"),
211
+ end_time: import_zod.z.string().datetime().optional().describe("New end time (ISO 8601)"),
194
212
  all_day: import_zod.z.boolean().optional().describe("Whether this is an all-day event"),
195
213
  status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional().describe("New event status"),
196
- reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("New reminder offsets in minutes before start. null = inherit calendar default; [] = no reminders. Max 5, each 1\u201340320."),
197
- metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Updated metadata")
214
+ metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Replacement metadata object"),
215
+ reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Reminder offsets in minutes before start_time. Omit to leave unchanged, null to inherit the calendar default, [] for no reminders.")
198
216
  });
199
217
  var CancelEventSchema = import_zod.z.object({
200
- calendar_id: import_zod.z.string().describe("Calendar ID that owns the event"),
201
- event_id: import_zod.z.string().describe("Event ID to cancel")
218
+ event_id: import_zod.z.string().describe("Event ID to cancel"),
219
+ calendar_id: import_zod.z.string().describe("Calendar ID that owns the event. Required \u2014 the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id).")
202
220
  });
203
221
  var ConfirmEventSchema = import_zod.z.object({
204
222
  event_id: import_zod.z.string().describe("Event ID of the hold to confirm")
@@ -209,14 +227,13 @@ var ReleaseEventSchema = import_zod.z.object({
209
227
  var CreateAgentSchema = import_zod.z.object({
210
228
  name: import_zod.z.string().min(1).max(255).describe("Display name for the agent"),
211
229
  type: import_zod.z.enum(["ai", "human", "resource"]).describe("Agent type"),
212
- description: import_zod.z.string().optional().describe("Optional description"),
213
- metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
230
+ description: import_zod.z.string().optional().describe("Optional description")
214
231
  });
215
232
  var ListAgentsSchema = import_zod.z.object({
216
233
  type: import_zod.z.enum(["ai", "human", "resource"]).optional().describe("Filter by agent type"),
217
234
  status: import_zod.z.enum(["active", "paused", "decommissioned"]).optional().describe("Filter by status"),
218
- limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
219
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
235
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
236
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
220
237
  });
221
238
  var GetAgentSchema = import_zod.z.object({
222
239
  agent_id: import_zod.z.string().describe("Agent ID to fetch")
@@ -233,27 +250,32 @@ var DeleteAgentSchema = import_zod.z.object({
233
250
  });
234
251
  var GetAvailabilitySchema = import_zod.z.object({
235
252
  agent_id: import_zod.z.string().describe("Agent ID to check availability for"),
236
- start: import_zod.z.string().describe("Range start (ISO 8601)"),
237
- end: import_zod.z.string().describe("Range end (ISO 8601)"),
238
- slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
239
- include_busy: import_zod.z.boolean().optional().describe("Include busy blocks in response")
253
+ start: import_zod.z.string().datetime().optional().describe("Range start (ISO 8601). Alias: start_time."),
254
+ end: import_zod.z.string().datetime().optional().describe("Range end (ISO 8601). Alias: end_time."),
255
+ start_time: import_zod.z.string().datetime().optional().describe("Alias for `start` (matches REST events naming)."),
256
+ end_time: import_zod.z.string().datetime().optional().describe("Alias for `end` (matches REST events naming)."),
257
+ slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).default("30m").describe("Minimum slot duration required \u2014 only free blocks at least this long are returned"),
258
+ include_busy: import_zod.z.boolean().default(false).describe("Include busy blocks in response")
240
259
  });
241
260
  var FindMeetingTimeSchema = import_zod.z.object({
242
- agents: import_zod.z.array(import_zod.z.string()).min(1).describe("Array of agent IDs to find common free time for. All agents must be free during the returned slots."),
243
- start: import_zod.z.string().describe("Search range start (ISO 8601)"),
244
- end: import_zod.z.string().describe("Search range end (ISO 8601)"),
245
- slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
261
+ agents: import_zod.z.array(import_zod.z.string()).min(1).optional().describe("Array of agent IDs to find common free time for. All agents must be free during the returned slots. Alias: agent_ids."),
262
+ agent_ids: import_zod.z.array(import_zod.z.string()).min(1).optional().describe("Alias for `agents` (matches REST/scheduling-proposal naming)."),
263
+ start: import_zod.z.string().datetime().optional().describe("Search range start (ISO 8601). Alias: start_time."),
264
+ end: import_zod.z.string().datetime().optional().describe("Search range end (ISO 8601). Alias: end_time."),
265
+ start_time: import_zod.z.string().datetime().optional().describe("Alias for `start` (matches REST events naming)."),
266
+ end_time: import_zod.z.string().datetime().optional().describe("Alias for `end` (matches REST events naming)."),
267
+ slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).default("30m").describe("Minimum slot duration required \u2014 only free blocks at least this long are returned"),
246
268
  calendars: import_zod.z.array(import_zod.z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
247
- include_busy: import_zod.z.boolean().optional().describe("Include per-agent busy blocks in response")
269
+ include_busy: import_zod.z.boolean().default(false).describe("Include per-agent busy blocks in response")
248
270
  });
249
271
  var GetCalendarContextSchema = import_zod.z.object({
250
272
  calendar_id: import_zod.z.string().describe("Calendar ID")
251
273
  });
252
274
  var proposalSlotSchema = import_zod.z.object({
253
- start_time: import_zod.z.string().describe("Slot start (ISO 8601)"),
254
- end_time: import_zod.z.string().describe("Slot end (ISO 8601)"),
255
- weight: import_zod.z.number().min(0).max(10).optional().describe("Preference weight (default 1.0)"),
256
- calendar_id: import_zod.z.string().optional().describe("Override calendar for this slot")
275
+ start_time: import_zod.z.string().datetime(),
276
+ end_time: import_zod.z.string().datetime(),
277
+ weight: import_zod.z.number().min(0).max(10).default(1).optional(),
278
+ calendar_id: import_zod.z.string().optional()
257
279
  });
258
280
  var CreateProposalSchema = import_zod.z.object({
259
281
  title: import_zod.z.string().min(1).max(500).describe("Short description of what the meeting is about"),
@@ -262,7 +284,7 @@ var CreateProposalSchema = import_zod.z.object({
262
284
  participant_agent_ids: import_zod.z.array(import_zod.z.string()).min(1).max(50).describe("Agent IDs invited to respond"),
263
285
  calendar_id: import_zod.z.string().describe("Calendar the resolved event will be created on"),
264
286
  slots: import_zod.z.array(proposalSlotSchema).min(1).max(20).describe("Candidate time slots (up to 20)"),
265
- expires_at: import_zod.z.string().optional().describe("Auto-cancel cutoff if unresolved (ISO 8601)")
287
+ expires_at: import_zod.z.string().datetime().optional().describe("Auto-cancel cutoff if unresolved")
266
288
  });
267
289
  var ListProposalsSchema = import_zod.z.object({
268
290
  status: import_zod.z.enum(["pending", "confirmed", "expired", "cancelled"]).optional().describe("Filter by proposal status"),
@@ -287,9 +309,10 @@ var ResolveProposalSchema = import_zod.z.object({
287
309
  var CancelProposalSchema = import_zod.z.object({
288
310
  proposal_id: import_zod.z.string().describe("Proposal to cancel")
289
311
  });
312
+ var timeOfDay = import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time");
290
313
  var workingHoursDaySchema = import_zod.z.object({
291
- start: import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time"),
292
- end: import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time")
314
+ start: timeOfDay,
315
+ end: timeOfDay
293
316
  });
294
317
  var workingHoursSchema = import_zod.z.object({
295
318
  mon: workingHoursDaySchema.optional(),
@@ -302,10 +325,10 @@ var workingHoursSchema = import_zod.z.object({
302
325
  }).nullable();
303
326
  var SetAvailabilityRulesSchema = import_zod.z.object({
304
327
  calendar_id: import_zod.z.string().describe("Calendar to configure"),
305
- buffer_before_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Minutes of buffer before each event (0\u2013120)"),
306
- buffer_after_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Minutes of buffer after each event (0\u2013120)"),
307
- working_hours: workingHoursSchema.optional().describe("Per-day working hours map in the calendar's timezone; omit keys for off-days. Pass null to remove any working-hours constraint."),
308
- timezone: import_zod.z.string().min(1).max(64).optional().describe("IANA timezone used to interpret working_hours (e.g. America/New_York)")
328
+ buffer_before_minutes: import_zod.z.number().int().min(0).max(120).default(0).describe("Minutes of buffer before each event (0\u2013120)"),
329
+ buffer_after_minutes: import_zod.z.number().int().min(0).max(120).default(0).describe("Minutes of buffer after each event (0\u2013120)"),
330
+ working_hours: workingHoursSchema.default(null).describe("Per-day working hours map in the calendar's timezone; omit keys for off-days. Pass null to remove any working-hours constraint."),
331
+ timezone: import_zod.z.string().min(1).max(64).default("UTC").describe("IANA timezone used to interpret working_hours (e.g. America/New_York)")
309
332
  });
310
333
  var GetAvailabilityRulesSchema = import_zod.z.object({
311
334
  calendar_id: import_zod.z.string().describe("Calendar to read")
@@ -322,8 +345,8 @@ var RevokeScopedKeySchema = import_zod.z.object({
322
345
  key_id: import_zod.z.string().describe("ID of the scoped key to revoke")
323
346
  });
324
347
  var GetAuditLogSchema = import_zod.z.object({
325
- from: import_zod.z.string().optional().describe("Start of the window (ISO 8601). Silently clamped to the plan retention window if older."),
326
- to: import_zod.z.string().optional().describe("End of the window (ISO 8601)"),
348
+ from: import_zod.z.string().datetime({ offset: true }).optional().describe("Start of the window (ISO 8601). Silently clamped to the plan retention window if older."),
349
+ to: import_zod.z.string().datetime({ offset: true }).optional().describe("End of the window (ISO 8601)"),
327
350
  action: import_zod.z.string().min(1).max(64).optional().describe("Filter by action name (e.g. event.created)"),
328
351
  actor_key_prefix: import_zod.z.string().min(1).max(32).optional().describe("Filter by the API key prefix that performed the action"),
329
352
  cursor: import_zod.z.string().min(1).max(256).optional().describe("Opaque pagination cursor from a previous response"),
@@ -333,33 +356,40 @@ var AcceptTermsSchema = import_zod.z.object({
333
356
  tos_version: import_zod.z.string().min(1).describe("The terms-of-service version to accept; must match the current version")
334
357
  });
335
358
  var ListWebhooksSchema = import_zod.z.object({
336
- limit: import_zod.z.number().int().min(1).max(100).optional().describe("Max results per page (default 20)"),
337
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
359
+ limit: import_zod.z.number().int().min(1).max(100).default(20).describe("Max results to return"),
360
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
338
361
  });
339
362
  var GetWebhookSchema = import_zod.z.object({
340
- webhook_id: import_zod.z.string().describe("The webhook ID to retrieve")
363
+ webhook_id: import_zod.z.string().describe("Webhook subscription to fetch")
341
364
  });
342
365
  var CreateWebhookSchema = import_zod.z.object({
343
- url: import_zod.z.string().describe("HTTPS URL to receive webhook payloads"),
344
- events: import_zod.z.array(import_zod.z.string()).describe('Event types to subscribe to (e.g., ["event.created", "event.updated"])')
366
+ url: import_zod.z.string().url().describe("HTTPS endpoint that will receive event deliveries"),
367
+ events: import_zod.z.array(import_zod.z.enum(WEBHOOK_EVENT_TYPES)).min(1).describe("Event types to subscribe to")
345
368
  });
346
369
  var UpdateWebhookSchema = import_zod.z.object({
347
- webhook_id: import_zod.z.string().describe("The webhook ID to update"),
348
- url: import_zod.z.string().optional().describe("New webhook URL"),
349
- events: import_zod.z.array(import_zod.z.string()).optional().describe("New event type subscriptions"),
350
- active: import_zod.z.boolean().optional().describe("Enable or disable the webhook")
370
+ webhook_id: import_zod.z.string().describe("Webhook subscription to update"),
371
+ url: import_zod.z.string().url().optional().describe("New HTTPS delivery endpoint"),
372
+ events: import_zod.z.array(import_zod.z.enum(WEBHOOK_EVENT_TYPES)).min(1).optional().describe("Replacement set of event types to subscribe to"),
373
+ active: import_zod.z.boolean().optional().describe("Set false to pause deliveries, true to resume")
351
374
  });
352
375
  var DeleteWebhookSchema = import_zod.z.object({
353
- webhook_id: import_zod.z.string().describe("The webhook ID to delete")
376
+ webhook_id: import_zod.z.string().describe("Webhook subscription to delete")
377
+ });
378
+ var ListWebhookDeliveriesSchema = import_zod.z.object({
379
+ webhook_id: import_zod.z.string().describe("Webhook subscription whose deliveries to list"),
380
+ limit: import_zod.z.number().int().min(1).max(100).default(20).describe("Max results to return"),
381
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset"),
382
+ status: import_zod.z.enum(WEBHOOK_DELIVERY_STATUSES).optional().describe("Filter to a single delivery status"),
383
+ include_payload: import_zod.z.boolean().optional().describe("Include the full event payload sent on each delivery")
354
384
  });
355
385
  var ListICalSubscriptionsSchema = import_zod.z.object({
356
- agent_id: import_zod.z.string().describe("Agent ID to list subscriptions for"),
386
+ agent_id: import_zod.z.string().describe("Agent ID whose iCal subscriptions to list"),
357
387
  status: import_zod.z.enum(["active", "error", "paused"]).optional().describe("Filter by subscription status"),
358
- limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
359
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
388
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
389
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
360
390
  });
361
391
  var GetICalSubscriptionSchema = import_zod.z.object({
362
- subscription_id: import_zod.z.string().describe("The iCal subscription ID to retrieve")
392
+ subscription_id: import_zod.z.string().describe("iCal subscription ID to fetch")
363
393
  });
364
394
  var SubscribeICalSchema = import_zod.z.object({
365
395
  agent_id: import_zod.z.string().describe("Agent ID that will own this subscription"),
@@ -367,23 +397,16 @@ var SubscribeICalSchema = import_zod.z.object({
367
397
  url: import_zod.z.string().url().describe("HTTPS URL of the iCal feed (.ics) to subscribe to"),
368
398
  label: import_zod.z.string().optional().describe("Optional label for this subscription")
369
399
  });
370
- var ListWebhookDeliveriesSchema = import_zod.z.object({
371
- webhook_id: import_zod.z.string().describe("Webhook subscription whose deliveries to list"),
372
- limit: import_zod.z.number().int().min(1).max(100).optional().describe("Max results to return (default 20)"),
373
- offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)"),
374
- status: import_zod.z.enum(["pending", "delivered", "failed"]).optional().describe("Filter to a single delivery status"),
375
- include_payload: import_zod.z.boolean().optional().describe("Include the full event payload sent on each delivery")
376
- });
377
400
  var UpdateICalSubscriptionSchema = import_zod.z.object({
378
- subscription_id: import_zod.z.string().describe("The iCal subscription ID to update"),
379
- label: import_zod.z.string().optional().describe("New label"),
380
- url: import_zod.z.string().optional().describe("New iCal feed URL")
401
+ subscription_id: import_zod.z.string().describe("iCal subscription ID to update"),
402
+ label: import_zod.z.string().min(1).max(255).optional().describe("New label for this subscription"),
403
+ url: import_zod.z.string().url().startsWith("https://", "URL must use HTTPS").optional().describe("New HTTPS URL of the iCal feed (.ics)")
381
404
  });
382
405
  var DeleteICalSubscriptionSchema = import_zod.z.object({
383
- subscription_id: import_zod.z.string().describe("The iCal subscription ID to delete")
406
+ subscription_id: import_zod.z.string().describe("iCal subscription ID to delete")
384
407
  });
385
408
  var SyncICalSubscriptionSchema = import_zod.z.object({
386
- subscription_id: import_zod.z.string().describe("The iCal subscription ID to sync immediately")
409
+ subscription_id: import_zod.z.string().describe("iCal subscription ID to sync")
387
410
  });
388
411
  var GetUsageSchema = import_zod.z.object({});
389
412
 
@@ -413,7 +436,7 @@ async function fetchPage(iterator, offset, limit) {
413
436
  }
414
437
  var listCalendars = safeFunc(async (ctx) => {
415
438
  const { client, params } = ctx;
416
- const iter = client.calendars.list({ agentId: params.agent_id, include: params.include, limit: params.limit });
439
+ const iter = client.calendars.list({ include: params.include, limit: params.limit });
417
440
  return fetchPage(iter, params.offset, params.limit);
418
441
  });
419
442
  var getCalendar = safeFunc(async (ctx) => {
@@ -442,11 +465,8 @@ var listEvents = safeFunc(async (ctx) => {
442
465
  const { client, params } = ctx;
443
466
  const iter = client.events.list({
444
467
  calendarId: params.calendar_id,
445
- agentId: params.agent_id,
446
468
  start_after: params.start_after,
447
469
  start_before: params.start_before,
448
- status: params.status,
449
- source: params.source,
450
470
  limit: params.limit
451
471
  });
452
472
  return fetchPage(iter, params.offset, params.limit);
@@ -496,15 +516,34 @@ var deleteAgent = safeFunc(async (ctx) => {
496
516
  });
497
517
  var getAvailability = safeFunc(async (ctx) => {
498
518
  const { client, params } = ctx;
519
+ const start = params.start ?? params.start_time;
520
+ const end = params.end ?? params.end_time;
521
+ if (!start || !end) {
522
+ throw new Error("start (or start_time) and end (or end_time) are required");
523
+ }
499
524
  return client.availability.forAgent(params.agent_id, {
500
- start: params.start,
501
- end: params.end,
525
+ start,
526
+ end,
502
527
  slot_duration: params.slot_duration,
503
528
  include_busy: params.include_busy
504
529
  });
505
530
  });
506
531
  var findMeetingTime = safeFunc(async (ctx) => {
507
- return ctx.client.availability.check(ctx.params);
532
+ const { client, params } = ctx;
533
+ const agents = params.agents ?? params.agent_ids;
534
+ const start = params.start ?? params.start_time;
535
+ const end = params.end ?? params.end_time;
536
+ if (!agents || !start || !end) {
537
+ throw new Error("agents (or agent_ids), start (or start_time), and end (or end_time) are required");
538
+ }
539
+ return client.availability.check({
540
+ agents,
541
+ start,
542
+ end,
543
+ slot_duration: params.slot_duration,
544
+ calendars: params.calendars,
545
+ include_busy: params.include_busy
546
+ });
508
547
  });
509
548
  var getCalendarContext = safeFunc(async (ctx) => {
510
549
  return ctx.client.calendars.getContext(ctx.params.calendar_id);
@@ -678,35 +717,35 @@ var TOOL_DEFINITIONS = [
678
717
  // ── Calendars ──────────────────────────────────────────────────
679
718
  {
680
719
  name: "list_calendars",
681
- description: "List calendars, optionally filtered by agent. Returns paginated results.",
720
+ description: "List calendars in the org. Org-level API keys see every calendar (agent-owned and shared); agent-scoped keys see only their own agent's calendars. Use this to discover calendar IDs before creating or listing events.",
682
721
  schema: ListCalendarsSchema,
683
722
  annotations: { title: "List Calendars", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
684
723
  execute: createExecutor(listCalendars)
685
724
  },
686
725
  {
687
726
  name: "get_calendar",
688
- description: "Get a calendar by its ID, including its name, timezone, and iCal feed URL.",
727
+ description: "Fetch a single calendar by ID, including its name, timezone, agent status, and default reminders. Agent-scoped keys may only read calendars owned by their agent.",
689
728
  schema: GetCalendarSchema,
690
729
  annotations: { title: "Get Calendar", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
691
730
  execute: createExecutor(getCalendar)
692
731
  },
693
732
  {
694
733
  name: "create_calendar",
695
- description: "Create a new calendar. Specify a name and IANA timezone. Optionally scope it to an agent.",
734
+ description: 'Create a calendar to hold events and track availability. Calendars are required before creating events \u2014 call this first when setting up a new agent. An agent can have multiple calendars (e.g. "Work", "Personal"). Org-level calendars (no agent_id) can be used as shared resources like meeting rooms.',
696
735
  schema: CreateCalendarSchema,
697
736
  annotations: { title: "Create Calendar", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
698
737
  execute: createExecutor(createCalendar)
699
738
  },
700
739
  {
701
740
  name: "update_calendar",
702
- description: "Update a calendar's name, timezone, or metadata.",
741
+ description: "Update a calendar's name, timezone, agent status, default reminders, or metadata. Agent-scoped keys may only update calendars owned by their agent.",
703
742
  schema: UpdateCalendarSchema,
704
743
  annotations: { title: "Update Calendar", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
705
744
  execute: createExecutor(updateCalendar)
706
745
  },
707
746
  {
708
747
  name: "delete_calendar",
709
- description: "Permanently delete a calendar and all its events.",
748
+ description: "Delete a calendar (soft delete). Its events are no longer returned and it stops contributing to availability. Agent-scoped keys may only delete calendars owned by their agent.",
710
749
  schema: DeleteCalendarSchema,
711
750
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
712
751
  execute: createExecutor(deleteCalendar)
@@ -714,42 +753,42 @@ var TOOL_DEFINITIONS = [
714
753
  // ── Events ─────────────────────────────────────────────────────
715
754
  {
716
755
  name: "list_events",
717
- description: "List events on a calendar or for an agent. Supports date range and status filters. Provide calendar_id or agent_id.",
756
+ description: "List all events on a calendar, including internally created events and externally synced events from iCal subscriptions (e.g. Google Calendar, Outlook). Use start_after and start_before to query a specific time window.",
718
757
  schema: ListEventsSchema,
719
758
  annotations: { title: "List Events", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
720
759
  execute: createExecutor(listEvents)
721
760
  },
722
761
  {
723
762
  name: "get_event",
724
- description: "Get a specific event by its calendar ID and event ID.",
763
+ description: "Retrieve a single event by ID, including its title, times, status, location, reminders, and metadata. Works for both internally created events and externally synced iCal events. `calendar_id` is optional \u2014 if omitted the calendar is resolved from the event. Provide `calendar_id` to fail fast on cross-calendar typos.",
725
764
  schema: GetEventSchema,
726
765
  annotations: { title: "Get Event", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
727
766
  execute: createExecutor(getEvent)
728
767
  },
729
768
  {
730
769
  name: "create_event",
731
- description: "Create a new event on a calendar. The event blocks the agent's availability during the specified time window and appears in availability queries.",
770
+ description: `Create a booking, appointment, meeting, hold, or any scheduled event on a calendar. The calendar_id comes from create_calendar or list_events. Once created, this event blocks the agent's availability during that time and appears in availability queries. Use status="hold" with hold_expires_at to tentatively reserve a slot that auto-releases on TTL.`,
732
771
  schema: CreateEventSchema,
733
772
  annotations: { title: "Create Event", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
734
773
  execute: createExecutor(createEvent)
735
774
  },
736
775
  {
737
776
  name: "update_event",
738
- description: "Update an existing event's title, times, status, or other properties.",
777
+ description: "Reschedule or edit an event \u2014 change its title, description, start/end times, location, status, reminders, or metadata. Use this to move an appointment to a new time or update its details. Provide only the fields you want to change. Holds cannot be edited via this tool (use confirm_event / release_event). External iCal events are read-only. `calendar_id` is optional \u2014 if omitted it is resolved from the event.",
739
778
  schema: UpdateEventSchema,
740
779
  annotations: { title: "Update Event", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
741
780
  execute: createExecutor(updateEvent)
742
781
  },
743
782
  {
744
783
  name: "cancel_event",
745
- description: "Delete or cancel an event from a calendar. The event is marked cancelled and excluded from future availability calculations.",
784
+ description: "Delete or cancel an event from a calendar. Use this to remove, cancel, or delete any scheduled event or appointment. The event is marked cancelled and excluded from future availability calculations. `calendar_id` is optional \u2014 if omitted the calendar is looked up from the event. Provide `calendar_id` to fail fast on cross-calendar typos.",
746
785
  schema: CancelEventSchema,
747
786
  annotations: { title: "Cancel Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
748
787
  execute: createExecutor(cancelEvent)
749
788
  },
750
789
  {
751
790
  name: "confirm_event",
752
- description: 'Promote a held event to a confirmed booking. The event must currently have status="hold" and its hold_expires_at must not have passed.',
791
+ description: 'Promote a held event to a confirmed booking. The event must currently have status="hold" and its hold_expires_at must not have passed. After confirmation, event.started and event.ended lifecycle webhooks fire at the scheduled times.',
753
792
  schema: ConfirmEventSchema,
754
793
  annotations: { title: "Confirm Event", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
755
794
  execute: createExecutor(confirmEvent)
@@ -771,28 +810,28 @@ var TOOL_DEFINITIONS = [
771
810
  },
772
811
  {
773
812
  name: "list_agents",
774
- description: "List all agents in your organization. Returns paginated results.",
813
+ description: "List all agents in your organization",
775
814
  schema: ListAgentsSchema,
776
815
  annotations: { title: "List Agents", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
777
816
  execute: createExecutor(listAgents)
778
817
  },
779
818
  {
780
819
  name: "get_agent",
781
- description: "Fetch a single agent by ID. An agent represents an AI assistant, human, or shared resource (e.g. a meeting room).",
820
+ description: "Fetch a single agent by ID. An agent represents an AI assistant, human, or shared resource (e.g. a meeting room). Agent-scoped API keys may only read their own agent.",
782
821
  schema: GetAgentSchema,
783
822
  annotations: { title: "Get Agent", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
784
823
  execute: createExecutor(getAgent)
785
824
  },
786
825
  {
787
826
  name: "update_agent",
788
- description: "Update an agent's name, description, metadata, or status (active/paused). Requires an org-level API key.",
827
+ description: "Update an agent's name, description, metadata, or status (active/paused). Requires an org-level API key \u2014 agent-scoped keys cannot mutate agents.",
789
828
  schema: UpdateAgentSchema,
790
829
  annotations: { title: "Update Agent", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
791
830
  execute: createExecutor(updateAgent)
792
831
  },
793
832
  {
794
833
  name: "delete_agent",
795
- description: "Decommission an agent. This marks the agent as decommissioned and revokes all of its scoped API keys. Requires an org-level API key.",
834
+ description: "Decommission an agent. This marks the agent as decommissioned and revokes all of its scoped API keys. Requires an org-level API key \u2014 agent-scoped keys cannot delete agents.",
796
835
  schema: DeleteAgentSchema,
797
836
  annotations: { title: "Delete Agent", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
798
837
  execute: createExecutor(deleteAgent)
@@ -800,14 +839,14 @@ var TOOL_DEFINITIONS = [
800
839
  // ── Availability ───────────────────────────────────────────────
801
840
  {
802
841
  name: "get_availability",
803
- description: "Check when a single agent is free within a time range. Returns available time slots and optionally busy blocks.",
842
+ description: "Check when a single agent is free within a time range. Accepts `start`/`end` (preferred \u2014 matches the underlying availability service) or `start_time`/`end_time` (aliases that match the REST events schema).",
804
843
  schema: GetAvailabilitySchema,
805
844
  annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
806
845
  execute: createExecutor(getAvailability)
807
846
  },
808
847
  {
809
848
  name: "find_meeting_time",
810
- description: "Find time slots when multiple agents are all free simultaneously. All agents must be free during the returned slots.",
849
+ description: "Find time slots when multiple agents are all free simultaneously. Accepts `agents`/`start`/`end` (preferred \u2014 matches the availability service) or `agent_ids`/`start_time`/`end_time` (aliases that match the REST/scheduling-proposal naming).",
811
850
  schema: FindMeetingTimeSchema,
812
851
  annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
813
852
  execute: createExecutor(findMeetingTime)
@@ -815,7 +854,7 @@ var TOOL_DEFINITIONS = [
815
854
  // ── Calendar context ───────────────────────────────────────────
816
855
  {
817
856
  name: "get_calendar_context",
818
- description: "Get a calendar's temporal context in a single call: the current event, the next upcoming event, recent past events, a short upcoming window, and the owning agent's status.",
857
+ description: `Get a calendar's temporal context in a single call: the current event (if one is happening now), the next upcoming event, recent past events, a short upcoming window, and the owning agent's status (idle/working/waiting/error). Use this to answer "what is this agent doing right now?" without issuing multiple list_events queries.`,
819
858
  schema: GetCalendarContextSchema,
820
859
  annotations: { title: "Get Calendar Context", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
821
860
  execute: createExecutor(getCalendarContext)
@@ -823,14 +862,14 @@ var TOOL_DEFINITIONS = [
823
862
  // ── Scheduling proposals ───────────────────────────────────────
824
863
  {
825
864
  name: "create_proposal",
826
- description: "Create a scheduling proposal \u2014 send candidate time slots to one or more participant agents so they can accept, decline, or counter-propose. Requires an org-level API key. Pro plan only.",
865
+ description: "Create a scheduling proposal \u2014 send a set of candidate time slots to one or more participant agents so they can accept, decline, or counter-propose. The organizer agent owns the proposal; once every participant responds, the system auto-resolves to the highest-scoring slot (or cancels if all decline). Requires an org-level API key. Pro plan only.",
827
866
  schema: CreateProposalSchema,
828
867
  annotations: { title: "Create Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
829
868
  execute: createExecutor(createProposal)
830
869
  },
831
870
  {
832
871
  name: "list_proposals",
833
- description: "List scheduling proposals for the org. Filter by status or organizer_agent_id. Requires an org-level API key.",
872
+ description: "List scheduling proposals for the org. Filter by status (pending|confirmed|expired|cancelled) or organizer_agent_id. Requires an org-level API key.",
834
873
  schema: ListProposalsSchema,
835
874
  annotations: { title: "List Proposals", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
836
875
  execute: createExecutor(listProposals)
@@ -844,14 +883,14 @@ var TOOL_DEFINITIONS = [
844
883
  },
845
884
  {
846
885
  name: "respond_to_proposal",
847
- description: "Submit a response (accept / decline / counter) on behalf of one participant agent to an open proposal. Requires an org-level API key. Pro plan only.",
886
+ description: 'Submit a response (accept / decline / counter) on behalf of one participant agent to an open proposal. An "accept" requires the slot id from the proposal; a "counter" can suggest alternative slots. When all participants have responded the proposal auto-resolves \u2014 no separate resolve call needed in the normal flow. Requires an org-level API key. Pro plan only.',
848
887
  schema: RespondToProposalSchema,
849
888
  annotations: { title: "Respond To Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
850
889
  execute: createExecutor(respondToProposal)
851
890
  },
852
891
  {
853
892
  name: "resolve_proposal",
854
- description: "Force-resolve an open proposal using responses collected so far. Picks the highest-scoring slot and creates a confirmed calendar event. Requires an org-level API key. Pro plan only.",
893
+ description: 'Force-resolve an open proposal using responses collected so far. Picks the highest-scoring slot among those accepted by the most participants and creates a confirmed calendar event. If every response was "decline", the proposal is cancelled instead. Use when you want to close out a proposal without waiting for every participant. Requires an org-level API key. Pro plan only.',
855
894
  schema: ResolveProposalSchema,
856
895
  annotations: { title: "Resolve Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
857
896
  execute: createExecutor(resolveProposal)
@@ -866,7 +905,7 @@ var TOOL_DEFINITIONS = [
866
905
  // ── Availability rules ─────────────────────────────────────────
867
906
  {
868
907
  name: "set_availability_rules",
869
- description: "Set or replace the availability rules on a calendar \u2014 buffer times before/after events and optional per-day working hours. Upsert: overwrites any existing rules.",
908
+ description: "Set or replace the availability rules on a calendar \u2014 buffer times before/after events and optional per-day working hours. When these rules are set, every availability query on this calendar automatically applies them (busy-block expansion for buffers, masking outside working hours). Upsert: overwrites any existing rules.",
870
909
  schema: SetAvailabilityRulesSchema,
871
910
  annotations: { title: "Set Availability Rules", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
872
911
  execute: createExecutor(setAvailabilityRules)
@@ -880,7 +919,7 @@ var TOOL_DEFINITIONS = [
880
919
  },
881
920
  {
882
921
  name: "clear_availability_rules",
883
- description: "Remove the availability rules from a calendar, reverting to the default (no buffers, no working-hours mask).",
922
+ description: "Remove the availability rules from a calendar, reverting to the default (no buffers, no working-hours mask). Returns the deleted row, or an error if none were set.",
884
923
  schema: ClearAvailabilityRulesSchema,
885
924
  annotations: { title: "Clear Availability Rules", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
886
925
  execute: createExecutor(clearAvailabilityRules)
@@ -888,35 +927,35 @@ var TOOL_DEFINITIONS = [
888
927
  // ── Webhooks ───────────────────────────────────────────────────
889
928
  {
890
929
  name: "list_webhooks",
891
- description: "List all webhook subscriptions for the organization.",
930
+ description: "List the org's webhook subscriptions with their subscribed event types and active state. Signing secrets are never returned. Requires an org-level API key.",
892
931
  schema: ListWebhooksSchema,
893
932
  annotations: { title: "List Webhooks", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
894
933
  execute: createExecutor(listWebhooks)
895
934
  },
896
935
  {
897
936
  name: "get_webhook",
898
- description: "Get a webhook subscription by its ID.",
937
+ description: "Get a single webhook subscription by id, including its subscribed event types and active state. The signing secret is never returned. Requires an org-level API key.",
899
938
  schema: GetWebhookSchema,
900
939
  annotations: { title: "Get Webhook", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
901
940
  execute: createExecutor(getWebhook)
902
941
  },
903
942
  {
904
943
  name: "create_webhook",
905
- description: "Create a webhook subscription to receive event notifications at a URL. Payloads are signed with HMAC-SHA256.",
944
+ description: "Create a webhook subscription so the org receives HTTP POST notifications when events occur (e.g. event.created, proposal.confirmed). The signing secret is returned ONCE in this response \u2014 store it to verify the HMAC-SHA256 signature on delivered payloads. Requires an org-level API key.",
906
945
  schema: CreateWebhookSchema,
907
946
  annotations: { title: "Create Webhook", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
908
947
  execute: createExecutor(createWebhook)
909
948
  },
910
949
  {
911
950
  name: "update_webhook",
912
- description: "Update a webhook's URL, subscribed events, or active status.",
951
+ description: "Update a webhook subscription \u2014 change its delivery URL, the set of subscribed event types, or pause/resume it via active. At least one field must be supplied. Requires an org-level API key.",
913
952
  schema: UpdateWebhookSchema,
914
953
  annotations: { title: "Update Webhook", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
915
954
  execute: createExecutor(updateWebhook)
916
955
  },
917
956
  {
918
957
  name: "delete_webhook",
919
- description: "Delete a webhook subscription. No further events will be delivered to this URL.",
958
+ description: "Permanently delete a webhook subscription. This frees its endpoint slot against the per-plan cap. Requires an org-level API key.",
920
959
  schema: DeleteWebhookSchema,
921
960
  annotations: { title: "Delete Webhook", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
922
961
  execute: createExecutor(deleteWebhook)
@@ -931,42 +970,42 @@ var TOOL_DEFINITIONS = [
931
970
  // ── iCal Subscriptions ─────────────────────────────────────────
932
971
  {
933
972
  name: "list_ical_subscriptions",
934
- description: "List external calendar imports (iCal subscriptions) for an agent.",
973
+ description: "List an agent's external iCal feed subscriptions (e.g. linked Google Calendar / Outlook feeds), including their sync status and last sync time.",
935
974
  schema: ListICalSubscriptionsSchema,
936
975
  annotations: { title: "List iCal Subscriptions", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
937
976
  execute: createExecutor(listICalSubscriptions)
938
977
  },
939
978
  {
940
979
  name: "get_ical_subscription",
941
- description: "Get an iCal subscription by its ID, including sync status and last error.",
980
+ description: "Get a single external iCal feed subscription by id, including its sync status, last sync time, and last error.",
942
981
  schema: GetICalSubscriptionSchema,
943
982
  annotations: { title: "Get iCal Subscription", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
944
983
  execute: createExecutor(getICalSubscription)
945
984
  },
946
985
  {
947
986
  name: "subscribe_ical",
948
- description: "Link an external iCal feed (e.g. a human's Google Calendar) to an agent's calendar so external events appear in availability calculations. Events are synced every 30 minutes.",
987
+ description: "Link an external iCal feed (e.g. a human's Google Calendar) to an agent's calendar so external events appear in availability calculations. The target calendar must be owned by the specified agent \u2014 create the calendar with that agent_id first (org-level calendars without an agent_id cannot host external iCal subscriptions; create a dedicated per-agent calendar for sync targets).",
949
988
  schema: SubscribeICalSchema,
950
989
  annotations: { title: "Subscribe iCal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
951
990
  execute: createExecutor(subscribeICal)
952
991
  },
953
992
  {
954
993
  name: "update_ical_subscription",
955
- description: "Update an iCal subscription's label or feed URL.",
994
+ description: "Update an external iCal feed subscription \u2014 change its label or its feed URL. Changing the URL forces a full re-sync on the next poll.",
956
995
  schema: UpdateICalSubscriptionSchema,
957
996
  annotations: { title: "Update iCal Subscription", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
958
997
  execute: createExecutor(updateICalSubscription)
959
998
  },
960
999
  {
961
1000
  name: "delete_ical_subscription",
962
- description: "Remove an external calendar import. Previously synced events remain on the calendar.",
1001
+ description: "Delete an external iCal feed subscription. Events previously synced from the feed are no longer refreshed.",
963
1002
  schema: DeleteICalSubscriptionSchema,
964
1003
  annotations: { title: "Delete iCal Subscription", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
965
1004
  execute: createExecutor(deleteICalSubscription)
966
1005
  },
967
1006
  {
968
1007
  name: "sync_ical_subscription",
969
- description: "Trigger an immediate sync of an iCal subscription instead of waiting for the next 30-minute poll.",
1008
+ description: "Trigger an immediate sync of an external iCal feed subscription instead of waiting for the next scheduled poll. Returns once the sync has been queued.",
970
1009
  schema: SyncICalSubscriptionSchema,
971
1010
  annotations: { title: "Sync iCal Subscription", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
972
1011
  execute: createExecutor(syncICalSubscription)
@@ -974,14 +1013,14 @@ var TOOL_DEFINITIONS = [
974
1013
  // ── Scoped keys ────────────────────────────────────────────────
975
1014
  {
976
1015
  name: "create_scoped_key",
977
- description: "Create an agent-scoped API key (chr_ak_*) that can only act on behalf of a single agent. The plaintext key is returned exactly once. Requires an org-level API key.",
1016
+ description: "Create an agent-scoped API key (chr_ak_*) that can only act on behalf of a single agent. Use this to self-provision or rotate per-agent credentials. The plaintext key is returned exactly once in the response \u2014 store it immediately, it cannot be retrieved later. Requires an org-level API key.",
978
1017
  schema: CreateScopedKeySchema,
979
1018
  annotations: { title: "Create Scoped Key", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
980
1019
  execute: createExecutor(createScopedKey)
981
1020
  },
982
1021
  {
983
1022
  name: "list_scoped_keys",
984
- description: "List all live (non-revoked) agent-scoped API keys for this org. Returns key metadata only \u2014 never the plaintext secret. Requires an org-level API key.",
1023
+ description: "List all live (non-revoked) agent-scoped API keys for this org. Returns key metadata only (id, prefix, agent_id, label, created_at) \u2014 never the plaintext secret. Requires an org-level API key.",
985
1024
  schema: ListScopedKeysSchema,
986
1025
  annotations: { title: "List Scoped Keys", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
987
1026
  execute: createExecutor(listScopedKeys)
@@ -996,7 +1035,7 @@ var TOOL_DEFINITIONS = [
996
1035
  // ── Audit log ──────────────────────────────────────────────────
997
1036
  {
998
1037
  name: "get_audit_log",
999
- description: "List audit-log entries for the calling org \u2014 mutating operations and auth-lifecycle events, newest first. Results are clamped to the plan's retention window. Requires an org-level API key.",
1038
+ description: "List audit-log entries for the calling org \u2014 mutating operations and auth-lifecycle events, newest first. Results are clamped to the plan's retention window. Requires an org-level API key (chr_sk_*); agent-scoped keys cannot read the org-wide audit log.",
1000
1039
  schema: GetAuditLogSchema,
1001
1040
  annotations: { title: "Get Audit Log", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1002
1041
  execute: createExecutor(getAuditLog)
@@ -1004,7 +1043,7 @@ var TOOL_DEFINITIONS = [
1004
1043
  // ── Terms ──────────────────────────────────────────────────────
1005
1044
  {
1006
1045
  name: "accept_terms",
1007
- description: "Re-accept the current Chronary terms of service on behalf of the calling org. Use this when responses carry the Chronary-Terms-Upgrade-Required header. Requires an org-level API key.",
1046
+ description: "Re-accept the current Chronary terms of service on behalf of the calling org. Use this when responses carry the Chronary-Terms-Upgrade-Required header \u2014 a material ToS bump otherwise leaves MCP-only agents stuck without a console session. Pass the current tos_version (read it from GET /v1/auth/terms/current). Requires an org-level API key (chr_sk_*); agent-scoped keys cannot accept org-wide terms.",
1008
1047
  schema: AcceptTermsSchema,
1009
1048
  annotations: { title: "Accept Terms", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1010
1049
  execute: createExecutor(acceptTerms)
@@ -1012,7 +1051,7 @@ var TOOL_DEFINITIONS = [
1012
1051
  // ── Usage ──────────────────────────────────────────────────────
1013
1052
  {
1014
1053
  name: "get_usage",
1015
- description: "Get quota and usage statistics for the current billing period.",
1054
+ description: "Get the calling org's current-period usage and plan limits (agents, calendars, events, API calls, webhooks, availability queries, iCal subscriptions, proposals, scoped keys, holds, cross-calendar queries). Requires an org-level API key (chr_sk_*); agent-scoped keys cannot read org-wide usage.",
1016
1055
  schema: GetUsageSchema,
1017
1056
  annotations: { title: "Get Usage", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1018
1057
  execute: createExecutor(getUsage)