@chronary/toolkit 0.1.2 → 1.0.1

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/mastra.js CHANGED
@@ -16,13 +16,15 @@ var CreateCalendarSchema = z.object({
16
16
  name: z.string().describe("Calendar name"),
17
17
  timezone: z.string().describe('IANA timezone (e.g., "America/New_York")'),
18
18
  agent_id: z.string().optional().describe("Agent ID to associate the calendar with"),
19
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata")
19
+ default_reminders: z.array(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."),
20
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Arbitrary key-value metadata")
20
21
  });
21
22
  var UpdateCalendarSchema = z.object({
22
23
  calendar_id: z.string().describe("The calendar ID to update"),
23
24
  name: z.string().optional().describe("New calendar name"),
24
25
  timezone: z.string().optional().describe("New IANA timezone"),
25
- metadata: z.record(z.unknown()).optional().describe("Updated metadata")
26
+ default_reminders: z.array(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."),
27
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Updated metadata")
26
28
  });
27
29
  var DeleteCalendarSchema = z.object({
28
30
  calendar_id: z.string().describe("The calendar ID to delete")
@@ -49,7 +51,8 @@ var CreateEventSchema = z.object({
49
51
  description: z.string().optional().describe("Event description"),
50
52
  all_day: z.boolean().optional().describe("Whether this is an all-day event"),
51
53
  status: z.enum(["confirmed", "tentative", "cancelled"]).optional().describe('Event status (default "confirmed")'),
52
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata")
54
+ reminders: z.array(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."),
55
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Arbitrary key-value metadata")
53
56
  });
54
57
  var UpdateEventSchema = z.object({
55
58
  calendar_id: z.string().describe("Calendar ID the event belongs to"),
@@ -60,20 +63,145 @@ var UpdateEventSchema = z.object({
60
63
  end_time: z.string().optional().describe("New end time in ISO 8601 format"),
61
64
  all_day: z.boolean().optional().describe("Whether this is an all-day event"),
62
65
  status: z.enum(["confirmed", "tentative", "cancelled"]).optional().describe("New event status"),
63
- metadata: z.record(z.unknown()).optional().describe("Updated metadata")
66
+ reminders: z.array(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."),
67
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Updated metadata")
64
68
  });
65
- var DeleteEventSchema = z.object({
66
- calendar_id: z.string().describe("Calendar ID the event belongs to"),
67
- event_id: z.string().describe("The event ID to delete")
68
- });
69
- var CheckAvailabilitySchema = z.object({
70
- agents: z.array(z.string()).min(1).describe("Agent IDs to check availability for"),
71
- start: z.string().describe("Start of time range in ISO 8601 format"),
72
- end: z.string().describe("End of time range in ISO 8601 format"),
73
- slot_duration: z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Duration of availability slots (default "30m")'),
74
- calendars: z.array(z.string()).optional().describe("Specific calendar IDs to check (default: all agent calendars)"),
69
+ var CancelEventSchema = z.object({
70
+ calendar_id: z.string().describe("Calendar ID that owns the event"),
71
+ event_id: z.string().describe("Event ID to cancel")
72
+ });
73
+ var ConfirmEventSchema = z.object({
74
+ event_id: z.string().describe("Event ID of the hold to confirm")
75
+ });
76
+ var ReleaseEventSchema = z.object({
77
+ event_id: z.string().describe("Event ID of the hold to release")
78
+ });
79
+ var CreateAgentSchema = z.object({
80
+ name: z.string().min(1).max(255).describe("Display name for the agent"),
81
+ type: z.enum(["ai", "human", "resource"]).describe("Agent type"),
82
+ description: z.string().optional().describe("Optional description"),
83
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Arbitrary key-value metadata")
84
+ });
85
+ var ListAgentsSchema = z.object({
86
+ type: z.enum(["ai", "human", "resource"]).optional().describe("Filter by agent type"),
87
+ status: z.enum(["active", "paused", "decommissioned"]).optional().describe("Filter by status"),
88
+ limit: z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
89
+ offset: z.number().int().min(0).optional().describe("Pagination offset (default 0)")
90
+ });
91
+ var GetAgentSchema = z.object({
92
+ agent_id: z.string().describe("Agent ID to fetch")
93
+ });
94
+ var UpdateAgentSchema = z.object({
95
+ agent_id: z.string().describe("Agent ID to update"),
96
+ name: z.string().min(1).max(255).optional().describe("New display name"),
97
+ description: z.string().nullable().optional().describe("New description (null to clear)"),
98
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Arbitrary metadata (max 16KB)"),
99
+ status: z.enum(["active", "paused"]).optional().describe("Operational status")
100
+ });
101
+ var DeleteAgentSchema = z.object({
102
+ agent_id: z.string().describe("Agent ID to decommission")
103
+ });
104
+ var GetAvailabilitySchema = z.object({
105
+ agent_id: z.string().describe("Agent ID to check availability for"),
106
+ start: z.string().describe("Range start (ISO 8601)"),
107
+ end: z.string().describe("Range end (ISO 8601)"),
108
+ slot_duration: z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
75
109
  include_busy: z.boolean().optional().describe("Include busy blocks in response")
76
110
  });
111
+ var FindMeetingTimeSchema = z.object({
112
+ agents: z.array(z.string()).min(1).describe("Array of agent IDs to find common free time for. All agents must be free during the returned slots."),
113
+ start: z.string().describe("Search range start (ISO 8601)"),
114
+ end: z.string().describe("Search range end (ISO 8601)"),
115
+ slot_duration: z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
116
+ calendars: z.array(z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
117
+ include_busy: z.boolean().optional().describe("Include per-agent busy blocks in response")
118
+ });
119
+ var GetCalendarContextSchema = z.object({
120
+ calendar_id: z.string().describe("Calendar ID")
121
+ });
122
+ var proposalSlotSchema = z.object({
123
+ start_time: z.string().describe("Slot start (ISO 8601)"),
124
+ end_time: z.string().describe("Slot end (ISO 8601)"),
125
+ weight: z.number().min(0).max(10).optional().describe("Preference weight (default 1.0)"),
126
+ calendar_id: z.string().optional().describe("Override calendar for this slot")
127
+ });
128
+ var CreateProposalSchema = z.object({
129
+ title: z.string().min(1).max(500).describe("Short description of what the meeting is about"),
130
+ description: z.string().max(5e3).optional().describe("Longer context/agenda"),
131
+ organizer_agent_id: z.string().describe("Agent ID proposing the meeting"),
132
+ participant_agent_ids: z.array(z.string()).min(1).max(50).describe("Agent IDs invited to respond"),
133
+ calendar_id: z.string().describe("Calendar the resolved event will be created on"),
134
+ slots: z.array(proposalSlotSchema).min(1).max(20).describe("Candidate time slots (up to 20)"),
135
+ expires_at: z.string().optional().describe("Auto-cancel cutoff if unresolved (ISO 8601)")
136
+ });
137
+ var ListProposalsSchema = z.object({
138
+ status: z.enum(["pending", "confirmed", "expired", "cancelled"]).optional().describe("Filter by proposal status"),
139
+ organizer_agent_id: z.string().optional().describe("Filter by organizer agent"),
140
+ limit: z.number().int().min(1).max(200).optional().describe("Max results (default 50)"),
141
+ offset: z.number().int().min(0).optional().describe("Pagination offset (default 0)")
142
+ });
143
+ var GetProposalSchema = z.object({
144
+ proposal_id: z.string().describe("Proposal to fetch")
145
+ });
146
+ var RespondToProposalSchema = z.object({
147
+ proposal_id: z.string().describe("Proposal to respond to"),
148
+ agent_id: z.string().describe("Participant agent responding"),
149
+ response: z.enum(["accept", "decline", "counter"]).describe("Decision from this agent"),
150
+ selected_slot_id: z.string().optional().describe('Required when response is "accept"'),
151
+ counter_slots: z.array(proposalSlotSchema).max(20).optional().describe('Alternative slots when response is "counter"'),
152
+ message: z.string().max(2e3).optional().describe("Optional note for the organizer")
153
+ });
154
+ var ResolveProposalSchema = z.object({
155
+ proposal_id: z.string().describe("Proposal to resolve")
156
+ });
157
+ var CancelProposalSchema = z.object({
158
+ proposal_id: z.string().describe("Proposal to cancel")
159
+ });
160
+ var workingHoursDaySchema = z.object({
161
+ start: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time"),
162
+ end: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time")
163
+ });
164
+ var workingHoursSchema = z.object({
165
+ mon: workingHoursDaySchema.optional(),
166
+ tue: workingHoursDaySchema.optional(),
167
+ wed: workingHoursDaySchema.optional(),
168
+ thu: workingHoursDaySchema.optional(),
169
+ fri: workingHoursDaySchema.optional(),
170
+ sat: workingHoursDaySchema.optional(),
171
+ sun: workingHoursDaySchema.optional()
172
+ }).nullable();
173
+ var SetAvailabilityRulesSchema = z.object({
174
+ calendar_id: z.string().describe("Calendar to configure"),
175
+ buffer_before_minutes: z.number().int().min(0).max(120).optional().describe("Minutes of buffer before each event (0\u2013120)"),
176
+ buffer_after_minutes: z.number().int().min(0).max(120).optional().describe("Minutes of buffer after each event (0\u2013120)"),
177
+ 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."),
178
+ timezone: z.string().min(1).max(64).optional().describe("IANA timezone used to interpret working_hours (e.g. America/New_York)")
179
+ });
180
+ var GetAvailabilityRulesSchema = z.object({
181
+ calendar_id: z.string().describe("Calendar to read")
182
+ });
183
+ var ClearAvailabilityRulesSchema = z.object({
184
+ calendar_id: z.string().describe("Calendar whose rules should be cleared")
185
+ });
186
+ var CreateScopedKeySchema = z.object({
187
+ agent_id: z.string().regex(/^agt_/).describe("Agent ID this key is scoped to"),
188
+ label: z.string().min(1).max(100).optional().describe("Human-readable label for the key")
189
+ });
190
+ var ListScopedKeysSchema = z.object({});
191
+ var RevokeScopedKeySchema = z.object({
192
+ key_id: z.string().describe("ID of the scoped key to revoke")
193
+ });
194
+ var GetAuditLogSchema = z.object({
195
+ from: z.string().optional().describe("Start of the window (ISO 8601). Silently clamped to the plan retention window if older."),
196
+ to: z.string().optional().describe("End of the window (ISO 8601)"),
197
+ action: z.string().min(1).max(64).optional().describe("Filter by action name (e.g. event.created)"),
198
+ actor_key_prefix: z.string().min(1).max(32).optional().describe("Filter by the API key prefix that performed the action"),
199
+ cursor: z.string().min(1).max(256).optional().describe("Opaque pagination cursor from a previous response"),
200
+ limit: z.number().int().min(1).max(200).optional().describe("Max results to return (default 50)")
201
+ });
202
+ var AcceptTermsSchema = z.object({
203
+ tos_version: z.string().min(1).describe("The terms-of-service version to accept; must match the current version")
204
+ });
77
205
  var ListWebhooksSchema = z.object({
78
206
  limit: z.number().int().min(1).max(100).optional().describe("Max results per page (default 20)"),
79
207
  offset: z.number().int().min(0).optional().describe("Pagination offset (default 0)")
@@ -103,11 +231,18 @@ var ListICalSubscriptionsSchema = z.object({
103
231
  var GetICalSubscriptionSchema = z.object({
104
232
  subscription_id: z.string().describe("The iCal subscription ID to retrieve")
105
233
  });
106
- var CreateICalSubscriptionSchema = z.object({
107
- agent_id: z.string().describe("Agent ID to create the subscription for"),
108
- calendar_id: z.string().describe("Calendar ID to import events into"),
109
- url: z.string().describe("HTTPS URL of the iCal feed to subscribe to"),
110
- label: z.string().optional().describe("Human-readable label for the subscription")
234
+ var SubscribeICalSchema = z.object({
235
+ agent_id: z.string().describe("Agent ID that will own this subscription"),
236
+ calendar_id: z.string().describe("Calendar ID to sync external events into"),
237
+ url: z.string().url().describe("HTTPS URL of the iCal feed (.ics) to subscribe to"),
238
+ label: z.string().optional().describe("Optional label for this subscription")
239
+ });
240
+ var ListWebhookDeliveriesSchema = z.object({
241
+ webhook_id: z.string().describe("Webhook subscription whose deliveries to list"),
242
+ limit: z.number().int().min(1).max(100).optional().describe("Max results to return (default 20)"),
243
+ offset: z.number().int().min(0).optional().describe("Pagination offset (default 0)"),
244
+ status: z.enum(["pending", "delivered", "failed"]).optional().describe("Filter to a single delivery status"),
245
+ include_payload: z.boolean().optional().describe("Include the full event payload sent on each delivery")
111
246
  });
112
247
  var UpdateICalSubscriptionSchema = z.object({
113
248
  subscription_id: z.string().describe("The iCal subscription ID to update"),
@@ -160,6 +295,7 @@ var createCalendar = safeFunc(async (ctx) => {
160
295
  name: params.name,
161
296
  timezone: params.timezone,
162
297
  agentId: params.agent_id,
298
+ default_reminders: params.default_reminders,
163
299
  metadata: params.metadata
164
300
  });
165
301
  });
@@ -198,13 +334,99 @@ var updateEvent = safeFunc(async (ctx) => {
198
334
  const { calendar_id, event_id, ...updates } = params;
199
335
  return client.events.update(calendar_id, event_id, updates);
200
336
  });
201
- var deleteEvent = safeFunc(async (ctx) => {
337
+ var cancelEvent = safeFunc(async (ctx) => {
202
338
  await ctx.client.events.delete(ctx.params.calendar_id, ctx.params.event_id);
203
339
  return void 0;
204
340
  });
205
- var checkAvailability = safeFunc(async (ctx) => {
341
+ var confirmEvent = safeFunc(async (ctx) => {
342
+ return ctx.client.events.confirm(ctx.params.event_id);
343
+ });
344
+ var releaseEvent = safeFunc(async (ctx) => {
345
+ return ctx.client.events.release(ctx.params.event_id);
346
+ });
347
+ var createAgent = safeFunc(async (ctx) => {
348
+ return ctx.client.agents.create(ctx.params);
349
+ });
350
+ var listAgents = safeFunc(async (ctx) => {
351
+ const { client, params } = ctx;
352
+ const iter = client.agents.list({ type: params.type, status: params.status, limit: params.limit });
353
+ return fetchPage(iter, params.offset, params.limit);
354
+ });
355
+ var getAgent = safeFunc(async (ctx) => {
356
+ return ctx.client.agents.get(ctx.params.agent_id);
357
+ });
358
+ var updateAgent = safeFunc(async (ctx) => {
359
+ const { client, params } = ctx;
360
+ const { agent_id, ...updates } = params;
361
+ return client.agents.update(agent_id, updates);
362
+ });
363
+ var deleteAgent = safeFunc(async (ctx) => {
364
+ await ctx.client.agents.delete(ctx.params.agent_id);
365
+ return void 0;
366
+ });
367
+ var getAvailability = safeFunc(async (ctx) => {
368
+ const { client, params } = ctx;
369
+ return client.availability.forAgent(params.agent_id, {
370
+ start: params.start,
371
+ end: params.end,
372
+ slot_duration: params.slot_duration,
373
+ include_busy: params.include_busy
374
+ });
375
+ });
376
+ var findMeetingTime = safeFunc(async (ctx) => {
206
377
  return ctx.client.availability.check(ctx.params);
207
378
  });
379
+ var getCalendarContext = safeFunc(async (ctx) => {
380
+ return ctx.client.calendars.getContext(ctx.params.calendar_id);
381
+ });
382
+ var createProposal = safeFunc(async (ctx) => {
383
+ return ctx.client.scheduling.create(ctx.params);
384
+ });
385
+ var listProposals = safeFunc(async (ctx) => {
386
+ const { client, params } = ctx;
387
+ const iter = client.scheduling.list({
388
+ status: params.status,
389
+ organizer_agent_id: params.organizer_agent_id,
390
+ limit: params.limit
391
+ });
392
+ return fetchPage(iter, params.offset, params.limit);
393
+ });
394
+ var getProposal = safeFunc(async (ctx) => {
395
+ return ctx.client.scheduling.get(ctx.params.proposal_id);
396
+ });
397
+ var respondToProposal = safeFunc(async (ctx) => {
398
+ const { client, params } = ctx;
399
+ const { proposal_id, ...body } = params;
400
+ return client.scheduling.respond(proposal_id, body);
401
+ });
402
+ var resolveProposal = safeFunc(async (ctx) => {
403
+ return ctx.client.scheduling.resolve(ctx.params.proposal_id);
404
+ });
405
+ var cancelProposal = safeFunc(async (ctx) => {
406
+ return ctx.client.scheduling.cancel(ctx.params.proposal_id);
407
+ });
408
+ var setAvailabilityRules = safeFunc(async (ctx) => {
409
+ const { client, params } = ctx;
410
+ const { calendar_id, ...rules } = params;
411
+ return client.calendars.setAvailabilityRules(calendar_id, rules);
412
+ });
413
+ var getAvailabilityRules = safeFunc(async (ctx) => {
414
+ return ctx.client.calendars.getAvailabilityRules(ctx.params.calendar_id);
415
+ });
416
+ var clearAvailabilityRules = safeFunc(async (ctx) => {
417
+ await ctx.client.calendars.deleteAvailabilityRules(ctx.params.calendar_id);
418
+ return void 0;
419
+ });
420
+ var createScopedKey = safeFunc(async (ctx) => {
421
+ return ctx.client.keys.create(ctx.params);
422
+ });
423
+ var listScopedKeys = safeFunc(async (ctx) => {
424
+ return ctx.client.keys.list();
425
+ });
426
+ var revokeScopedKey = safeFunc(async (ctx) => {
427
+ await ctx.client.keys.delete(ctx.params.key_id);
428
+ return void 0;
429
+ });
208
430
  var listWebhooks = safeFunc(async (ctx) => {
209
431
  const { client, params } = ctx;
210
432
  const iter = client.webhooks.list({ limit: params.limit });
@@ -225,6 +447,17 @@ var deleteWebhook = safeFunc(async (ctx) => {
225
447
  await ctx.client.webhooks.delete(ctx.params.webhook_id);
226
448
  return void 0;
227
449
  });
450
+ var listWebhookDeliveries = safeFunc(async (ctx) => {
451
+ const { client, params } = ctx;
452
+ const { webhook_id, ...query } = params;
453
+ return client.webhooks.listDeliveries(webhook_id, query);
454
+ });
455
+ var getAuditLog = safeFunc(async (ctx) => {
456
+ return ctx.client.auditLog.list(ctx.params);
457
+ });
458
+ var acceptTerms = safeFunc(async (ctx) => {
459
+ return ctx.client.terms.accept(ctx.params);
460
+ });
228
461
  var listICalSubscriptions = safeFunc(async (ctx) => {
229
462
  const { client, params } = ctx;
230
463
  const iter = client.icalSubscriptions.list({
@@ -237,7 +470,7 @@ var listICalSubscriptions = safeFunc(async (ctx) => {
237
470
  var getICalSubscription = safeFunc(async (ctx) => {
238
471
  return ctx.client.icalSubscriptions.get(ctx.params.subscription_id);
239
472
  });
240
- var createICalSubscription = safeFunc(async (ctx) => {
473
+ var subscribeICal = safeFunc(async (ctx) => {
241
474
  const { client, params } = ctx;
242
475
  const { agent_id, ...subParams } = params;
243
476
  return client.icalSubscriptions.create(agent_id, subParams);
@@ -268,12 +501,19 @@ var HOSTED_API_MCP_TOOL_NAMES = [
268
501
  "create_calendar",
269
502
  "create_event",
270
503
  "list_events",
504
+ "get_event",
505
+ "update_event",
271
506
  "get_availability",
272
507
  "find_meeting_time",
273
508
  "cancel_event",
274
509
  "confirm_event",
275
510
  "release_event",
276
511
  "subscribe_ical",
512
+ "list_ical_subscriptions",
513
+ "get_ical_subscription",
514
+ "update_ical_subscription",
515
+ "delete_ical_subscription",
516
+ "sync_ical_subscription",
277
517
  "get_calendar_context",
278
518
  "create_proposal",
279
519
  "list_proposals",
@@ -283,7 +523,26 @@ var HOSTED_API_MCP_TOOL_NAMES = [
283
523
  "cancel_proposal",
284
524
  "set_availability_rules",
285
525
  "get_availability_rules",
286
- "clear_availability_rules"
526
+ "clear_availability_rules",
527
+ "create_scoped_key",
528
+ "list_scoped_keys",
529
+ "revoke_scoped_key",
530
+ "create_webhook",
531
+ "list_webhooks",
532
+ "get_webhook",
533
+ "update_webhook",
534
+ "delete_webhook",
535
+ "list_webhook_deliveries",
536
+ "get_agent",
537
+ "update_agent",
538
+ "delete_agent",
539
+ "list_calendars",
540
+ "get_calendar",
541
+ "update_calendar",
542
+ "delete_calendar",
543
+ "get_usage",
544
+ "get_audit_log",
545
+ "accept_terms"
287
546
  ];
288
547
  var TOOL_DEFINITIONS = [
289
548
  // ── Calendars ──────────────────────────────────────────────────
@@ -352,19 +611,149 @@ var TOOL_DEFINITIONS = [
352
611
  execute: createExecutor(updateEvent)
353
612
  },
354
613
  {
355
- name: "delete_event",
356
- description: "Delete an event from a calendar. This frees the agent's availability during that time.",
357
- schema: DeleteEventSchema,
358
- annotations: { title: "Delete Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
359
- execute: createExecutor(deleteEvent)
614
+ name: "cancel_event",
615
+ description: "Delete or cancel an event from a calendar. The event is marked cancelled and excluded from future availability calculations.",
616
+ schema: CancelEventSchema,
617
+ annotations: { title: "Cancel Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
618
+ execute: createExecutor(cancelEvent)
619
+ },
620
+ {
621
+ name: "confirm_event",
622
+ 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.',
623
+ schema: ConfirmEventSchema,
624
+ annotations: { title: "Confirm Event", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
625
+ execute: createExecutor(confirmEvent)
626
+ },
627
+ {
628
+ name: "release_event",
629
+ description: 'Manually release a held event before its hold_expires_at. The event must currently have status="hold". Frees the slot for other agents to book.',
630
+ schema: ReleaseEventSchema,
631
+ annotations: { title: "Release Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
632
+ execute: createExecutor(releaseEvent)
633
+ },
634
+ // ── Agents ─────────────────────────────────────────────────────
635
+ {
636
+ name: "create_agent",
637
+ description: "Register your agent (AI assistant, human participant, or resource) with Chronary so it can own calendars, events, and webhooks.",
638
+ schema: CreateAgentSchema,
639
+ annotations: { title: "Create Agent", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
640
+ execute: createExecutor(createAgent)
641
+ },
642
+ {
643
+ name: "list_agents",
644
+ description: "List all agents in your organization. Returns paginated results.",
645
+ schema: ListAgentsSchema,
646
+ annotations: { title: "List Agents", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
647
+ execute: createExecutor(listAgents)
648
+ },
649
+ {
650
+ name: "get_agent",
651
+ description: "Fetch a single agent by ID. An agent represents an AI assistant, human, or shared resource (e.g. a meeting room).",
652
+ schema: GetAgentSchema,
653
+ annotations: { title: "Get Agent", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
654
+ execute: createExecutor(getAgent)
655
+ },
656
+ {
657
+ name: "update_agent",
658
+ description: "Update an agent's name, description, metadata, or status (active/paused). Requires an org-level API key.",
659
+ schema: UpdateAgentSchema,
660
+ annotations: { title: "Update Agent", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
661
+ execute: createExecutor(updateAgent)
662
+ },
663
+ {
664
+ name: "delete_agent",
665
+ description: "Decommission an agent. This marks the agent as decommissioned and revokes all of its scoped API keys. Requires an org-level API key.",
666
+ schema: DeleteAgentSchema,
667
+ annotations: { title: "Delete Agent", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
668
+ execute: createExecutor(deleteAgent)
360
669
  },
361
670
  // ── Availability ───────────────────────────────────────────────
362
671
  {
363
- name: "check_availability",
364
- description: "Check free/busy availability across one or more agents within a time range. Returns available time slots and optionally busy blocks.",
365
- schema: CheckAvailabilitySchema,
366
- annotations: { title: "Check Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
367
- execute: createExecutor(checkAvailability)
672
+ name: "get_availability",
673
+ description: "Check when a single agent is free within a time range. Returns available time slots and optionally busy blocks.",
674
+ schema: GetAvailabilitySchema,
675
+ annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
676
+ execute: createExecutor(getAvailability)
677
+ },
678
+ {
679
+ name: "find_meeting_time",
680
+ description: "Find time slots when multiple agents are all free simultaneously. All agents must be free during the returned slots.",
681
+ schema: FindMeetingTimeSchema,
682
+ annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
683
+ execute: createExecutor(findMeetingTime)
684
+ },
685
+ // ── Calendar context ───────────────────────────────────────────
686
+ {
687
+ name: "get_calendar_context",
688
+ 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.",
689
+ schema: GetCalendarContextSchema,
690
+ annotations: { title: "Get Calendar Context", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
691
+ execute: createExecutor(getCalendarContext)
692
+ },
693
+ // ── Scheduling proposals ───────────────────────────────────────
694
+ {
695
+ name: "create_proposal",
696
+ 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.",
697
+ schema: CreateProposalSchema,
698
+ annotations: { title: "Create Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
699
+ execute: createExecutor(createProposal)
700
+ },
701
+ {
702
+ name: "list_proposals",
703
+ description: "List scheduling proposals for the org. Filter by status or organizer_agent_id. Requires an org-level API key.",
704
+ schema: ListProposalsSchema,
705
+ annotations: { title: "List Proposals", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
706
+ execute: createExecutor(listProposals)
707
+ },
708
+ {
709
+ name: "get_proposal",
710
+ description: "Get a scheduling proposal by id, including its slots and per-participant responses. Requires an org-level API key.",
711
+ schema: GetProposalSchema,
712
+ annotations: { title: "Get Proposal", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
713
+ execute: createExecutor(getProposal)
714
+ },
715
+ {
716
+ name: "respond_to_proposal",
717
+ 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.",
718
+ schema: RespondToProposalSchema,
719
+ annotations: { title: "Respond To Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
720
+ execute: createExecutor(respondToProposal)
721
+ },
722
+ {
723
+ name: "resolve_proposal",
724
+ 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.",
725
+ schema: ResolveProposalSchema,
726
+ annotations: { title: "Resolve Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
727
+ execute: createExecutor(resolveProposal)
728
+ },
729
+ {
730
+ name: "cancel_proposal",
731
+ description: 'Cancel an open proposal. Fires a proposal.cancelled webhook with reason="organizer_cancelled". Requires an org-level API key. Pro plan only.',
732
+ schema: CancelProposalSchema,
733
+ annotations: { title: "Cancel Proposal", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
734
+ execute: createExecutor(cancelProposal)
735
+ },
736
+ // ── Availability rules ─────────────────────────────────────────
737
+ {
738
+ name: "set_availability_rules",
739
+ 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.",
740
+ schema: SetAvailabilityRulesSchema,
741
+ annotations: { title: "Set Availability Rules", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
742
+ execute: createExecutor(setAvailabilityRules)
743
+ },
744
+ {
745
+ name: "get_availability_rules",
746
+ description: "Read the buffer times and working-hours rules configured on a calendar. Returns the rules row, or an error if none are set.",
747
+ schema: GetAvailabilityRulesSchema,
748
+ annotations: { title: "Get Availability Rules", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
749
+ execute: createExecutor(getAvailabilityRules)
750
+ },
751
+ {
752
+ name: "clear_availability_rules",
753
+ description: "Remove the availability rules from a calendar, reverting to the default (no buffers, no working-hours mask).",
754
+ schema: ClearAvailabilityRulesSchema,
755
+ annotations: { title: "Clear Availability Rules", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
756
+ execute: createExecutor(clearAvailabilityRules)
368
757
  },
369
758
  // ── Webhooks ───────────────────────────────────────────────────
370
759
  {
@@ -402,6 +791,13 @@ var TOOL_DEFINITIONS = [
402
791
  annotations: { title: "Delete Webhook", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
403
792
  execute: createExecutor(deleteWebhook)
404
793
  },
794
+ {
795
+ name: "list_webhook_deliveries",
796
+ description: "List delivery attempts for a webhook subscription, with per-status counts (pending/delivered/failed). Use this to debug failing deliveries. Requires an org-level API key.",
797
+ schema: ListWebhookDeliveriesSchema,
798
+ annotations: { title: "List Webhook Deliveries", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
799
+ execute: createExecutor(listWebhookDeliveries)
800
+ },
405
801
  // ── iCal Subscriptions ─────────────────────────────────────────
406
802
  {
407
803
  name: "list_ical_subscriptions",
@@ -418,11 +814,11 @@ var TOOL_DEFINITIONS = [
418
814
  execute: createExecutor(getICalSubscription)
419
815
  },
420
816
  {
421
- name: "create_ical_subscription",
422
- description: "Import an external calendar by subscribing to an iCal feed URL. Events are synced every 30 minutes.",
423
- schema: CreateICalSubscriptionSchema,
424
- annotations: { title: "Create iCal Subscription", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
425
- execute: createExecutor(createICalSubscription)
817
+ name: "subscribe_ical",
818
+ 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.",
819
+ schema: SubscribeICalSchema,
820
+ annotations: { title: "Subscribe iCal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
821
+ execute: createExecutor(subscribeICal)
426
822
  },
427
823
  {
428
824
  name: "update_ical_subscription",
@@ -445,6 +841,44 @@ var TOOL_DEFINITIONS = [
445
841
  annotations: { title: "Sync iCal Subscription", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
446
842
  execute: createExecutor(syncICalSubscription)
447
843
  },
844
+ // ── Scoped keys ────────────────────────────────────────────────
845
+ {
846
+ name: "create_scoped_key",
847
+ 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.",
848
+ schema: CreateScopedKeySchema,
849
+ annotations: { title: "Create Scoped Key", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
850
+ execute: createExecutor(createScopedKey)
851
+ },
852
+ {
853
+ name: "list_scoped_keys",
854
+ 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.",
855
+ schema: ListScopedKeysSchema,
856
+ annotations: { title: "List Scoped Keys", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
857
+ execute: createExecutor(listScopedKeys)
858
+ },
859
+ {
860
+ name: "revoke_scoped_key",
861
+ description: "Revoke an agent-scoped API key by ID. The key stops authenticating immediately and cannot be un-revoked. Requires an org-level API key.",
862
+ schema: RevokeScopedKeySchema,
863
+ annotations: { title: "Revoke Scoped Key", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
864
+ execute: createExecutor(revokeScopedKey)
865
+ },
866
+ // ── Audit log ──────────────────────────────────────────────────
867
+ {
868
+ name: "get_audit_log",
869
+ 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.",
870
+ schema: GetAuditLogSchema,
871
+ annotations: { title: "Get Audit Log", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
872
+ execute: createExecutor(getAuditLog)
873
+ },
874
+ // ── Terms ──────────────────────────────────────────────────────
875
+ {
876
+ name: "accept_terms",
877
+ 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.",
878
+ schema: AcceptTermsSchema,
879
+ annotations: { title: "Accept Terms", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
880
+ execute: createExecutor(acceptTerms)
881
+ },
448
882
  // ── Usage ──────────────────────────────────────────────────────
449
883
  {
450
884
  name: "get_usage",