@burdenoff/mcp-libs 2026.522.1 → 2026.525.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.
Files changed (73) hide show
  1. package/dist/chunk-HRWIDQJE.js +1771 -0
  2. package/dist/chunk-HRWIDQJE.js.map +1 -0
  3. package/dist/modules/auth/index.cjs +317 -0
  4. package/dist/modules/auth/index.cjs.map +1 -1
  5. package/dist/modules/auth/index.js +289 -1
  6. package/dist/modules/auth/index.js.map +1 -1
  7. package/dist/modules/channels/index.cjs +47 -0
  8. package/dist/modules/channels/index.cjs.map +1 -1
  9. package/dist/modules/channels/index.js +47 -0
  10. package/dist/modules/channels/index.js.map +1 -1
  11. package/dist/modules/conversations/index.cjs +1355 -0
  12. package/dist/modules/conversations/index.cjs.map +1 -1
  13. package/dist/modules/conversations/index.js +1355 -0
  14. package/dist/modules/conversations/index.js.map +1 -1
  15. package/dist/modules/devportal/index.cjs +281 -0
  16. package/dist/modules/devportal/index.cjs.map +1 -1
  17. package/dist/modules/devportal/index.js +281 -0
  18. package/dist/modules/devportal/index.js.map +1 -1
  19. package/dist/modules/export/index.cjs +348 -0
  20. package/dist/modules/export/index.cjs.map +1 -1
  21. package/dist/modules/export/index.js +348 -0
  22. package/dist/modules/export/index.js.map +1 -1
  23. package/dist/modules/files/index.cjs +244 -2
  24. package/dist/modules/files/index.cjs.map +1 -1
  25. package/dist/modules/files/index.js +244 -2
  26. package/dist/modules/files/index.js.map +1 -1
  27. package/dist/modules/integrations/index.cjs +539 -0
  28. package/dist/modules/integrations/index.cjs.map +1 -1
  29. package/dist/modules/integrations/index.js +539 -0
  30. package/dist/modules/integrations/index.js.map +1 -1
  31. package/dist/modules/organizations/index.cjs +211 -0
  32. package/dist/modules/organizations/index.cjs.map +1 -1
  33. package/dist/modules/organizations/index.js +211 -0
  34. package/dist/modules/organizations/index.js.map +1 -1
  35. package/dist/modules/products/index.cjs +131 -0
  36. package/dist/modules/products/index.cjs.map +1 -1
  37. package/dist/modules/products/index.js +131 -0
  38. package/dist/modules/products/index.js.map +1 -1
  39. package/dist/modules/rbac/index.cjs +114 -0
  40. package/dist/modules/rbac/index.cjs.map +1 -1
  41. package/dist/modules/rbac/index.js +114 -0
  42. package/dist/modules/rbac/index.js.map +1 -1
  43. package/dist/modules/sandbox/index.cjs +864 -0
  44. package/dist/modules/sandbox/index.cjs.map +1 -1
  45. package/dist/modules/sandbox/index.js +699 -1
  46. package/dist/modules/sandbox/index.js.map +1 -1
  47. package/dist/modules/scheduler/index.cjs +860 -0
  48. package/dist/modules/scheduler/index.cjs.map +1 -1
  49. package/dist/modules/scheduler/index.js +860 -0
  50. package/dist/modules/scheduler/index.js.map +1 -1
  51. package/dist/modules/security/index.cjs +51 -0
  52. package/dist/modules/security/index.cjs.map +1 -1
  53. package/dist/modules/security/index.js +51 -0
  54. package/dist/modules/security/index.js.map +1 -1
  55. package/dist/modules/store/index.cjs +102 -0
  56. package/dist/modules/store/index.cjs.map +1 -1
  57. package/dist/modules/store/index.js +102 -0
  58. package/dist/modules/store/index.js.map +1 -1
  59. package/dist/modules/tours/index.cjs +43 -0
  60. package/dist/modules/tours/index.cjs.map +1 -1
  61. package/dist/modules/tours/index.js +43 -0
  62. package/dist/modules/tours/index.js.map +1 -1
  63. package/dist/modules/vibecontrols/index.cjs +4618 -668
  64. package/dist/modules/vibecontrols/index.cjs.map +1 -1
  65. package/dist/modules/vibecontrols/index.js +3626 -434
  66. package/dist/modules/vibecontrols/index.js.map +1 -1
  67. package/dist/modules/workspaces/index.cjs +46 -3
  68. package/dist/modules/workspaces/index.cjs.map +1 -1
  69. package/dist/modules/workspaces/index.js +46 -3
  70. package/dist/modules/workspaces/index.js.map +1 -1
  71. package/package.json +4 -3
  72. package/dist/chunk-4GBVJ4OY.js +0 -847
  73. package/dist/chunk-4GBVJ4OY.js.map +0 -1
@@ -38,6 +38,193 @@ var JOB_EXECUTIONS = `
38
38
  }
39
39
  }
40
40
  `;
41
+ var UPDATE_SCHEDULED_JOB = `
42
+ mutation UpdateScheduledJob($id: ID!, $input: UpdateScheduledJobInput!) {
43
+ updateScheduledJob(id: $id, input: $input) {
44
+ id name status scheduleType cronExpression nextExecutionAt
45
+ }
46
+ }
47
+ `;
48
+ var GET_JOB_EXECUTION = `
49
+ query JobExecution($id: ID!) {
50
+ jobExecution(id: $id) {
51
+ id scheduleId status attemptNumber startedAt completedAt
52
+ errorMessage result success
53
+ }
54
+ }
55
+ `;
56
+ var RETRY_JOB_EXECUTION = `
57
+ mutation RetryJobExecution($executionId: ID!) {
58
+ retryJobExecution(executionId: $executionId) {
59
+ id status attemptNumber startedAt
60
+ }
61
+ }
62
+ `;
63
+ var PAUSE_JOB = `
64
+ mutation PauseScheduledJob($id: ID!) {
65
+ pauseScheduledJob(id: $id) { id name status }
66
+ }
67
+ `;
68
+ var RESUME_JOB = `
69
+ mutation ResumeScheduledJob($id: ID!) {
70
+ resumeScheduledJob(id: $id) { id name status }
71
+ }
72
+ `;
73
+ var ACTIVATE_SCHEDULE = `
74
+ mutation ActivateSchedule($id: ID!) {
75
+ activateSchedule(id: $id) { id name status }
76
+ }
77
+ `;
78
+ var ARCHIVE_SCHEDULE = `
79
+ mutation ArchiveSchedule($id: ID!) {
80
+ archiveSchedule(id: $id) { id name status }
81
+ }
82
+ `;
83
+ var DISABLE_SCHEDULE = `
84
+ mutation DisableSchedule($id: ID!, $reason: String) {
85
+ disableSchedule(id: $id, reason: $reason) { id name status }
86
+ }
87
+ `;
88
+ var CLONE_SCHEDULE = `
89
+ mutation CloneSchedule($sourceId: ID!, $newWorkspaceId: ID, $overrides: CreateScheduledJobInput) {
90
+ cloneSchedule(sourceId: $sourceId, newWorkspaceId: $newWorkspaceId, overrides: $overrides) {
91
+ id name status
92
+ }
93
+ }
94
+ `;
95
+ var EXECUTE_JOB_NOW = `
96
+ mutation ExecuteJobNow($id: ID!) {
97
+ executeJobNow(id: $id) { id scheduledJobId status }
98
+ }
99
+ `;
100
+ var PREVIEW_SCHEDULE = `
101
+ query PreviewSchedule(
102
+ $scheduleType: ScheduleType!
103
+ $cronExpression: String
104
+ $rrule: String
105
+ $interval: Int
106
+ $intervalUnit: String
107
+ $count: Int
108
+ $startDate: DateTime
109
+ $endDate: DateTime
110
+ $timezone: String
111
+ ) {
112
+ previewSchedule(
113
+ scheduleType: $scheduleType
114
+ cronExpression: $cronExpression
115
+ rrule: $rrule
116
+ interval: $interval
117
+ intervalUnit: $intervalUnit
118
+ count: $count
119
+ startDate: $startDate
120
+ endDate: $endDate
121
+ timezone: $timezone
122
+ ) {
123
+ count startDate endDate nextExecutions
124
+ }
125
+ }
126
+ `;
127
+ var LIST_SCHEDULE_TEMPLATES = `
128
+ query ScheduleTemplates(
129
+ $workspaceId: ID!
130
+ $filter: ScheduleTemplateFilterInput
131
+ $pagination: SchedulerPaginationInput
132
+ ) {
133
+ scheduleTemplates(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
134
+ templates { id name category isPublic scheduleType executorType usageCount }
135
+ total nextCursor
136
+ }
137
+ }
138
+ `;
139
+ var LIST_PUBLIC_SCHEDULE_TEMPLATES = `
140
+ query PublicScheduleTemplates(
141
+ $filter: ScheduleTemplateFilterInput
142
+ $pagination: SchedulerPaginationInput
143
+ ) {
144
+ publicScheduleTemplates(filter: $filter, pagination: $pagination) {
145
+ templates { id name category isPublic scheduleType executorType usageCount }
146
+ total nextCursor
147
+ }
148
+ }
149
+ `;
150
+ var GET_SCHEDULE_TEMPLATE = `
151
+ query ScheduleTemplate($id: ID!) {
152
+ scheduleTemplate(id: $id) {
153
+ id name description category isPublic scheduleType executorType
154
+ scheduleConfig executorConfig usageCount
155
+ }
156
+ }
157
+ `;
158
+ var CREATE_SCHEDULE_TEMPLATE = `
159
+ mutation CreateScheduleTemplate($input: CreateScheduleTemplateInput!, $workspaceId: ID!) {
160
+ createScheduleTemplate(input: $input, workspaceId: $workspaceId) { id name scheduleType }
161
+ }
162
+ `;
163
+ var UPDATE_SCHEDULE_TEMPLATE = `
164
+ mutation UpdateScheduleTemplate($id: ID!, $input: UpdateScheduleTemplateInput!) {
165
+ updateScheduleTemplate(id: $id, input: $input) { id name }
166
+ }
167
+ `;
168
+ var DELETE_SCHEDULE_TEMPLATE = `
169
+ mutation DeleteScheduleTemplate($id: ID!) { deleteScheduleTemplate(id: $id) }
170
+ `;
171
+ var CREATE_SCHEDULE_FROM_TEMPLATE = `
172
+ mutation CreateScheduleFromTemplate(
173
+ $templateId: ID!
174
+ $workspaceId: ID!
175
+ $overrides: CreateScheduledJobInput
176
+ ) {
177
+ createScheduleFromTemplate(templateId: $templateId, workspaceId: $workspaceId, overrides: $overrides) {
178
+ id name status
179
+ }
180
+ }
181
+ `;
182
+ var SCHEDULE_VERSION_HISTORY = `
183
+ query ScheduleVersionHistory($scheduleId: ID!) {
184
+ scheduleVersionHistory(scheduleId: $scheduleId) {
185
+ id scheduleId version changedBy changedFields changeReason createdAt
186
+ }
187
+ }
188
+ `;
189
+ var RESTORE_SCHEDULE_VERSION = `
190
+ mutation RestoreScheduleVersion($scheduleId: ID!, $versionId: ID!) {
191
+ restoreScheduleVersion(scheduleId: $scheduleId, versionId: $versionId) { id name version }
192
+ }
193
+ `;
194
+ var TAG_SCHEDULED_JOB = `
195
+ mutation TagScheduledJob($input: TagScheduledJobInput!) {
196
+ tagScheduledJob(input: $input) { id entityId tagId source }
197
+ }
198
+ `;
199
+ var UNTAG_SCHEDULED_JOB = `
200
+ mutation UntagScheduledJob($input: UntagScheduledJobInput!) {
201
+ untagScheduledJob(input: $input)
202
+ }
203
+ `;
204
+ var REPLACE_SCHEDULED_JOB_TAGS = `
205
+ mutation ReplaceScheduledJobTags($input: ReplaceScheduledJobTagsInput!) {
206
+ replaceScheduledJobTags(input: $input) { id entityId tagId source }
207
+ }
208
+ `;
209
+ var GET_SCHEDULED_JOB_TAGS = `
210
+ query GetScheduledJobTags($input: GetScheduledJobTagsInput!) {
211
+ getScheduledJobTags(input: $input) { id entityId tagId source }
212
+ }
213
+ `;
214
+ var EXECUTION_UPDATED_POLL = `
215
+ query ExecutionUpdatedPoll($id: ID!) {
216
+ jobExecution(id: $id) {
217
+ id scheduleId status attemptNumber startedAt completedAt errorMessage success
218
+ }
219
+ }
220
+ `;
221
+ var JOB_STATUS_UPDATED_POLL = `
222
+ query JobStatusUpdatedPoll($id: ID!) {
223
+ scheduledJob(id: $id) {
224
+ id name status nextExecutionAt lastExecutionAt updatedAt
225
+ }
226
+ }
227
+ `;
41
228
 
42
229
  // src/modules/scheduler/tools.ts
43
230
  function readWorkspaceId(ctx) {
@@ -145,6 +332,63 @@ function registerSchedulerTools(server, ctx, track) {
145
332
  }
146
333
  }
147
334
  );
335
+ server.registerTool(
336
+ track(mcpToolName(ctx.productName, "scheduler_jobs_update")),
337
+ {
338
+ title: "Update Scheduled Job",
339
+ description: "Update a scheduled job (cron expression, executor config, retry policy, etc.). At least one field must be provided. Returns the updated ScheduledJob.",
340
+ inputSchema: {
341
+ id: z.string().describe("Job ID"),
342
+ name: z.string().optional().describe("Updated job name"),
343
+ description: z.string().optional().describe("Updated description"),
344
+ cronExpression: z.string().optional().describe("Updated cron expression (CRON jobs only)"),
345
+ interval: z.number().int().optional().describe("Updated interval (INTERVAL jobs only)"),
346
+ intervalUnit: z.string().optional().describe("Interval unit (SECONDS|MINUTES|HOURS|DAYS, will be uppercased)"),
347
+ endDate: z.string().optional().describe("Updated end date (ISO-8601)"),
348
+ executorConfig: z.record(z.string(), z.unknown()).optional().describe("Updated executor configuration"),
349
+ maxRetries: z.number().int().optional().describe("Max retry attempts on failure"),
350
+ changeReason: z.string().optional().describe("Audit-trail reason for the change")
351
+ }
352
+ },
353
+ async ({
354
+ id,
355
+ name,
356
+ description,
357
+ cronExpression,
358
+ interval,
359
+ intervalUnit,
360
+ endDate,
361
+ executorConfig,
362
+ maxRetries,
363
+ changeReason
364
+ }) => {
365
+ try {
366
+ const input = {};
367
+ if (name !== void 0) input.name = name;
368
+ if (description !== void 0) input.description = description;
369
+ if (cronExpression !== void 0) input.cronExpression = cronExpression;
370
+ if (interval !== void 0) input.interval = interval;
371
+ if (intervalUnit !== void 0) input.intervalUnit = intervalUnit.toUpperCase();
372
+ if (endDate !== void 0) input.endDate = endDate;
373
+ if (executorConfig !== void 0) input.executorConfig = executorConfig;
374
+ if (maxRetries !== void 0) input.maxRetries = maxRetries;
375
+ if (changeReason !== void 0) input.changeReason = changeReason;
376
+ if (Object.keys(input).length === 0) {
377
+ return errorResult("No updates specified \u2014 provide at least one field to update");
378
+ }
379
+ const data = await ctx.gql.workspace.request(
380
+ UPDATE_SCHEDULED_JOB,
381
+ { id, input }
382
+ );
383
+ return jsonResult(data.updateScheduledJob);
384
+ } catch (error) {
385
+ ctx.logger.error("scheduler_jobs_update failed", { error: String(error) });
386
+ return errorResult(
387
+ `Failed to update scheduled job: ${error instanceof Error ? error.message : String(error)}`
388
+ );
389
+ }
390
+ }
391
+ );
148
392
  server.registerTool(
149
393
  track(mcpToolName(ctx.productName, "scheduler_jobs_delete")),
150
394
  {
@@ -192,6 +436,622 @@ function registerSchedulerTools(server, ctx, track) {
192
436
  }
193
437
  }
194
438
  );
439
+ server.registerTool(
440
+ track(mcpToolName(ctx.productName, "scheduler_executions_get")),
441
+ {
442
+ title: "Get Job Execution",
443
+ description: "Fetch a single job execution by ID, including status, attempt number, timings, error message and result payload. Returns the JobExecution or an error if not found.",
444
+ inputSchema: { id: z.string().describe("Execution ID") }
445
+ },
446
+ async ({ id }) => {
447
+ try {
448
+ const data = await ctx.gql.workspace.request(
449
+ GET_JOB_EXECUTION,
450
+ { id }
451
+ );
452
+ if (!data.jobExecution) return errorResult(`Execution ${id} not found`);
453
+ return jsonResult(data.jobExecution);
454
+ } catch (error) {
455
+ ctx.logger.error("scheduler_executions_get failed", { error: String(error) });
456
+ return errorResult(
457
+ `Failed to get job execution: ${error instanceof Error ? error.message : String(error)}`
458
+ );
459
+ }
460
+ }
461
+ );
462
+ for (const [tool, op, title, desc, mutationField] of [
463
+ [
464
+ "scheduler_jobs_pause",
465
+ PAUSE_JOB,
466
+ "Pause Scheduled Job",
467
+ "Pause a scheduled job.",
468
+ "pauseScheduledJob"
469
+ ],
470
+ [
471
+ "scheduler_jobs_resume",
472
+ RESUME_JOB,
473
+ "Resume Scheduled Job",
474
+ "Resume a paused scheduled job.",
475
+ "resumeScheduledJob"
476
+ ],
477
+ [
478
+ "scheduler_jobs_activate",
479
+ ACTIVATE_SCHEDULE,
480
+ "Activate Schedule",
481
+ "Activate a draft or disabled schedule.",
482
+ "activateSchedule"
483
+ ],
484
+ [
485
+ "scheduler_jobs_archive",
486
+ ARCHIVE_SCHEDULE,
487
+ "Archive Schedule",
488
+ "Archive a scheduled job (soft delete).",
489
+ "archiveSchedule"
490
+ ]
491
+ ]) {
492
+ server.registerTool(
493
+ track(mcpToolName(ctx.productName, tool)),
494
+ {
495
+ title,
496
+ description: desc,
497
+ inputSchema: { id: z.string().describe("Schedule ID") }
498
+ },
499
+ async ({ id }) => {
500
+ try {
501
+ const data = await ctx.gql.workspace.request(op, { id });
502
+ return jsonResult(data[mutationField]);
503
+ } catch (error) {
504
+ ctx.logger.error(`${tool} failed`, { error: String(error) });
505
+ return errorResult(
506
+ `${title} failed: ${error instanceof Error ? error.message : String(error)}`
507
+ );
508
+ }
509
+ }
510
+ );
511
+ }
512
+ server.registerTool(
513
+ track(mcpToolName(ctx.productName, "scheduler_jobs_disable")),
514
+ {
515
+ title: "Disable Schedule",
516
+ description: "Disable a schedule with an optional reason.",
517
+ inputSchema: {
518
+ id: z.string().describe("Schedule ID"),
519
+ reason: z.string().optional().describe("Disable reason (audit trail)")
520
+ }
521
+ },
522
+ async ({ id, reason }) => {
523
+ try {
524
+ const data = await ctx.gql.workspace.request(
525
+ DISABLE_SCHEDULE,
526
+ { id, reason: reason ?? null }
527
+ );
528
+ return jsonResult(data.disableSchedule);
529
+ } catch (error) {
530
+ ctx.logger.error("scheduler_jobs_disable failed", { error: String(error) });
531
+ return errorResult(
532
+ `Failed to disable: ${error instanceof Error ? error.message : String(error)}`
533
+ );
534
+ }
535
+ }
536
+ );
537
+ server.registerTool(
538
+ track(mcpToolName(ctx.productName, "scheduler_jobs_clone")),
539
+ {
540
+ title: "Clone Schedule",
541
+ description: "Clone an existing schedule. Optionally move to another workspace and supply override fields.",
542
+ inputSchema: {
543
+ sourceId: z.string().describe("Source schedule ID"),
544
+ newWorkspaceId: z.string().optional().describe("Target workspace (defaults to source)"),
545
+ overrides: z.record(z.string(), z.unknown()).optional().describe("CreateScheduledJobInput overrides")
546
+ }
547
+ },
548
+ async ({ sourceId, newWorkspaceId, overrides }) => {
549
+ try {
550
+ const data = await ctx.gql.workspace.request(
551
+ CLONE_SCHEDULE,
552
+ { sourceId, newWorkspaceId: newWorkspaceId ?? null, overrides: overrides ?? null }
553
+ );
554
+ return jsonResult(data.cloneSchedule);
555
+ } catch (error) {
556
+ ctx.logger.error("scheduler_jobs_clone failed", { error: String(error) });
557
+ return errorResult(
558
+ `Failed to clone: ${error instanceof Error ? error.message : String(error)}`
559
+ );
560
+ }
561
+ }
562
+ );
563
+ server.registerTool(
564
+ track(mcpToolName(ctx.productName, "scheduler_jobs_execute_now")),
565
+ {
566
+ title: "Execute Job Now",
567
+ description: "Trigger a scheduled job to execute immediately (out-of-band).",
568
+ inputSchema: { id: z.string().describe("Schedule ID") }
569
+ },
570
+ async ({ id }) => {
571
+ try {
572
+ const data = await ctx.gql.workspace.request(
573
+ EXECUTE_JOB_NOW,
574
+ { id }
575
+ );
576
+ return jsonResult(data.executeJobNow);
577
+ } catch (error) {
578
+ ctx.logger.error("scheduler_jobs_execute_now failed", { error: String(error) });
579
+ return errorResult(
580
+ `Failed to execute: ${error instanceof Error ? error.message : String(error)}`
581
+ );
582
+ }
583
+ }
584
+ );
585
+ server.registerTool(
586
+ track(mcpToolName(ctx.productName, "scheduler_jobs_preview")),
587
+ {
588
+ title: "Preview Schedule",
589
+ description: "Compute upcoming execution times for a schedule definition without creating it.",
590
+ inputSchema: {
591
+ scheduleType: z.string().describe("CRON | FIXED_INTERVAL | ONE_TIME | RRULE | WINDOWED"),
592
+ cronExpression: z.string().optional(),
593
+ rrule: z.string().optional(),
594
+ interval: z.number().int().optional(),
595
+ intervalUnit: z.string().optional(),
596
+ count: z.number().int().optional().describe("How many upcoming executions to return"),
597
+ startDate: z.string().optional(),
598
+ endDate: z.string().optional(),
599
+ timezone: z.string().optional()
600
+ }
601
+ },
602
+ async ({
603
+ scheduleType,
604
+ cronExpression,
605
+ rrule,
606
+ interval,
607
+ intervalUnit,
608
+ count,
609
+ startDate,
610
+ endDate,
611
+ timezone
612
+ }) => {
613
+ try {
614
+ const data = await ctx.gql.workspace.request(PREVIEW_SCHEDULE, {
615
+ scheduleType: scheduleType.toUpperCase(),
616
+ cronExpression: cronExpression ?? null,
617
+ rrule: rrule ?? null,
618
+ interval: interval ?? null,
619
+ intervalUnit: intervalUnit ?? null,
620
+ count: count ?? null,
621
+ startDate: startDate ?? null,
622
+ endDate: endDate ?? null,
623
+ timezone: timezone ?? null
624
+ });
625
+ return jsonResult(data.previewSchedule);
626
+ } catch (error) {
627
+ ctx.logger.error("scheduler_jobs_preview failed", { error: String(error) });
628
+ return errorResult(
629
+ `Failed to preview: ${error instanceof Error ? error.message : String(error)}`
630
+ );
631
+ }
632
+ }
633
+ );
634
+ server.registerTool(
635
+ track(mcpToolName(ctx.productName, "scheduler_templates_list")),
636
+ {
637
+ title: "List Schedule Templates",
638
+ description: "List schedule templates in the active workspace.",
639
+ inputSchema: {
640
+ category: z.string().optional(),
641
+ isPublic: z.boolean().optional(),
642
+ limit: z.number().optional()
643
+ }
644
+ },
645
+ async ({ category, isPublic, limit }) => {
646
+ try {
647
+ const workspaceId = readWorkspaceId(ctx);
648
+ if (!workspaceId) return errorResult("No workspace set.");
649
+ const filter = {};
650
+ if (category !== void 0) filter.category = category;
651
+ if (isPublic !== void 0) filter.isPublic = isPublic;
652
+ const data = await ctx.gql.workspace.request(LIST_SCHEDULE_TEMPLATES, {
653
+ workspaceId,
654
+ filter: Object.keys(filter).length > 0 ? filter : void 0,
655
+ pagination: { first: limit ?? 100 }
656
+ });
657
+ return jsonResult(data.scheduleTemplates);
658
+ } catch (error) {
659
+ ctx.logger.error("scheduler_templates_list failed", { error: String(error) });
660
+ return errorResult(
661
+ `Failed to list templates: ${error instanceof Error ? error.message : String(error)}`
662
+ );
663
+ }
664
+ }
665
+ );
666
+ server.registerTool(
667
+ track(mcpToolName(ctx.productName, "scheduler_templates_list_public")),
668
+ {
669
+ title: "List Public Schedule Templates",
670
+ description: "List public (cross-workspace) schedule templates.",
671
+ inputSchema: {
672
+ category: z.string().optional(),
673
+ limit: z.number().optional()
674
+ }
675
+ },
676
+ async ({ category, limit }) => {
677
+ try {
678
+ const filter = {};
679
+ if (category !== void 0) filter.category = category;
680
+ const data = await ctx.gql.workspace.request(LIST_PUBLIC_SCHEDULE_TEMPLATES, {
681
+ filter: Object.keys(filter).length > 0 ? filter : void 0,
682
+ pagination: { first: limit ?? 100 }
683
+ });
684
+ return jsonResult(data.publicScheduleTemplates);
685
+ } catch (error) {
686
+ ctx.logger.error("scheduler_templates_list_public failed", { error: String(error) });
687
+ return errorResult(
688
+ `Failed to list: ${error instanceof Error ? error.message : String(error)}`
689
+ );
690
+ }
691
+ }
692
+ );
693
+ server.registerTool(
694
+ track(mcpToolName(ctx.productName, "scheduler_templates_get")),
695
+ {
696
+ title: "Get Schedule Template",
697
+ description: "Get a schedule template by ID.",
698
+ inputSchema: { id: z.string() }
699
+ },
700
+ async ({ id }) => {
701
+ try {
702
+ const data = await ctx.gql.workspace.request(
703
+ GET_SCHEDULE_TEMPLATE,
704
+ { id }
705
+ );
706
+ if (!data.scheduleTemplate) return errorResult(`Template ${id} not found`);
707
+ return jsonResult(data.scheduleTemplate);
708
+ } catch (error) {
709
+ ctx.logger.error("scheduler_templates_get failed", { error: String(error) });
710
+ return errorResult(
711
+ `Failed to get template: ${error instanceof Error ? error.message : String(error)}`
712
+ );
713
+ }
714
+ }
715
+ );
716
+ server.registerTool(
717
+ track(mcpToolName(ctx.productName, "scheduler_templates_create")),
718
+ {
719
+ title: "Create Schedule Template",
720
+ description: "Create a reusable schedule template in the active workspace.",
721
+ inputSchema: {
722
+ name: z.string(),
723
+ scheduleType: z.string().describe("CRON | FIXED_INTERVAL | ONE_TIME | RRULE | WINDOWED"),
724
+ executorType: z.string().describe("WEBHOOK | INTERNAL_API | NATS_TOPIC | GRAPHQL"),
725
+ scheduleConfig: z.record(z.string(), z.unknown()),
726
+ executorConfig: z.record(z.string(), z.unknown()),
727
+ description: z.string().optional(),
728
+ category: z.string().optional(),
729
+ isPublic: z.boolean().optional()
730
+ }
731
+ },
732
+ async ({
733
+ name,
734
+ scheduleType,
735
+ executorType,
736
+ scheduleConfig,
737
+ executorConfig,
738
+ description,
739
+ category,
740
+ isPublic
741
+ }) => {
742
+ try {
743
+ const workspaceId = readWorkspaceId(ctx);
744
+ if (!workspaceId) return errorResult("No workspace set.");
745
+ const input = {
746
+ name,
747
+ scheduleType: scheduleType.toUpperCase(),
748
+ executorType: executorType.toUpperCase(),
749
+ scheduleConfig,
750
+ executorConfig
751
+ };
752
+ if (description !== void 0) input.description = description;
753
+ if (category !== void 0) input.category = category;
754
+ if (isPublic !== void 0) input.isPublic = isPublic;
755
+ const data = await ctx.gql.workspace.request(
756
+ CREATE_SCHEDULE_TEMPLATE,
757
+ { workspaceId, input }
758
+ );
759
+ return jsonResult(data.createScheduleTemplate);
760
+ } catch (error) {
761
+ ctx.logger.error("scheduler_templates_create failed", { error: String(error) });
762
+ return errorResult(
763
+ `Failed to create template: ${error instanceof Error ? error.message : String(error)}`
764
+ );
765
+ }
766
+ }
767
+ );
768
+ server.registerTool(
769
+ track(mcpToolName(ctx.productName, "scheduler_templates_update")),
770
+ {
771
+ title: "Update Schedule Template",
772
+ description: "Update a schedule template.",
773
+ inputSchema: {
774
+ id: z.string(),
775
+ name: z.string().optional(),
776
+ description: z.string().optional(),
777
+ category: z.string().optional(),
778
+ isPublic: z.boolean().optional()
779
+ }
780
+ },
781
+ async ({ id, name, description, category, isPublic }) => {
782
+ try {
783
+ const input = {};
784
+ if (name !== void 0) input.name = name;
785
+ if (description !== void 0) input.description = description;
786
+ if (category !== void 0) input.category = category;
787
+ if (isPublic !== void 0) input.isPublic = isPublic;
788
+ if (Object.keys(input).length === 0) {
789
+ return errorResult("Provide at least one field to update");
790
+ }
791
+ const data = await ctx.gql.workspace.request(
792
+ UPDATE_SCHEDULE_TEMPLATE,
793
+ { id, input }
794
+ );
795
+ return jsonResult(data.updateScheduleTemplate);
796
+ } catch (error) {
797
+ ctx.logger.error("scheduler_templates_update failed", { error: String(error) });
798
+ return errorResult(
799
+ `Failed to update template: ${error instanceof Error ? error.message : String(error)}`
800
+ );
801
+ }
802
+ }
803
+ );
804
+ server.registerTool(
805
+ track(mcpToolName(ctx.productName, "scheduler_templates_delete")),
806
+ {
807
+ title: "Delete Schedule Template",
808
+ description: "Delete a schedule template.",
809
+ inputSchema: { id: z.string() }
810
+ },
811
+ async ({ id }) => {
812
+ try {
813
+ const data = await ctx.gql.workspace.request(
814
+ DELETE_SCHEDULE_TEMPLATE,
815
+ { id }
816
+ );
817
+ return jsonResult({ deleted: data.deleteScheduleTemplate, id });
818
+ } catch (error) {
819
+ ctx.logger.error("scheduler_templates_delete failed", { error: String(error) });
820
+ return errorResult(
821
+ `Failed to delete: ${error instanceof Error ? error.message : String(error)}`
822
+ );
823
+ }
824
+ }
825
+ );
826
+ server.registerTool(
827
+ track(mcpToolName(ctx.productName, "scheduler_templates_create_from")),
828
+ {
829
+ title: "Create Schedule From Template",
830
+ description: "Instantiate a schedule from a template; optional overrides.",
831
+ inputSchema: {
832
+ templateId: z.string(),
833
+ overrides: z.record(z.string(), z.unknown()).optional()
834
+ }
835
+ },
836
+ async ({ templateId, overrides }) => {
837
+ try {
838
+ const workspaceId = readWorkspaceId(ctx);
839
+ if (!workspaceId) return errorResult("No workspace set.");
840
+ const data = await ctx.gql.workspace.request(
841
+ CREATE_SCHEDULE_FROM_TEMPLATE,
842
+ { templateId, workspaceId, overrides: overrides ?? null }
843
+ );
844
+ return jsonResult(data.createScheduleFromTemplate);
845
+ } catch (error) {
846
+ ctx.logger.error("scheduler_templates_create_from failed", { error: String(error) });
847
+ return errorResult(
848
+ `Failed to create: ${error instanceof Error ? error.message : String(error)}`
849
+ );
850
+ }
851
+ }
852
+ );
853
+ server.registerTool(
854
+ track(mcpToolName(ctx.productName, "scheduler_versions_history")),
855
+ {
856
+ title: "Schedule Version History",
857
+ description: "List version history for a schedule.",
858
+ inputSchema: { scheduleId: z.string() }
859
+ },
860
+ async ({ scheduleId }) => {
861
+ try {
862
+ const data = await ctx.gql.workspace.request(
863
+ SCHEDULE_VERSION_HISTORY,
864
+ { scheduleId }
865
+ );
866
+ return jsonResult(data.scheduleVersionHistory);
867
+ } catch (error) {
868
+ ctx.logger.error("scheduler_versions_history failed", { error: String(error) });
869
+ return errorResult(
870
+ `Failed to get history: ${error instanceof Error ? error.message : String(error)}`
871
+ );
872
+ }
873
+ }
874
+ );
875
+ server.registerTool(
876
+ track(mcpToolName(ctx.productName, "scheduler_versions_restore")),
877
+ {
878
+ title: "Restore Schedule Version",
879
+ description: "Restore a schedule to a prior version.",
880
+ inputSchema: { scheduleId: z.string(), versionId: z.string() }
881
+ },
882
+ async ({ scheduleId, versionId }) => {
883
+ try {
884
+ const data = await ctx.gql.workspace.request(
885
+ RESTORE_SCHEDULE_VERSION,
886
+ { scheduleId, versionId }
887
+ );
888
+ return jsonResult(data.restoreScheduleVersion);
889
+ } catch (error) {
890
+ ctx.logger.error("scheduler_versions_restore failed", { error: String(error) });
891
+ return errorResult(
892
+ `Failed to restore: ${error instanceof Error ? error.message : String(error)}`
893
+ );
894
+ }
895
+ }
896
+ );
897
+ server.registerTool(
898
+ track(mcpToolName(ctx.productName, "scheduler_jobs_tag_add")),
899
+ {
900
+ title: "Tag Scheduled Job",
901
+ description: "Add a tag assignment to a scheduled job.",
902
+ inputSchema: {
903
+ entityId: z.string(),
904
+ tagId: z.string(),
905
+ source: z.string().optional()
906
+ }
907
+ },
908
+ async ({ entityId, tagId, source }) => {
909
+ try {
910
+ const input = { entityId, tagId };
911
+ if (source !== void 0) input.source = source;
912
+ const data = await ctx.gql.workspace.request(
913
+ TAG_SCHEDULED_JOB,
914
+ { input }
915
+ );
916
+ return jsonResult(data.tagScheduledJob);
917
+ } catch (error) {
918
+ ctx.logger.error("scheduler_jobs_tag_add failed", { error: String(error) });
919
+ return errorResult(
920
+ `Failed to tag: ${error instanceof Error ? error.message : String(error)}`
921
+ );
922
+ }
923
+ }
924
+ );
925
+ server.registerTool(
926
+ track(mcpToolName(ctx.productName, "scheduler_jobs_tag_remove")),
927
+ {
928
+ title: "Untag Scheduled Job",
929
+ description: "Remove a tag assignment from a scheduled job.",
930
+ inputSchema: { entityId: z.string(), tagId: z.string() }
931
+ },
932
+ async ({ entityId, tagId }) => {
933
+ try {
934
+ const data = await ctx.gql.workspace.request(
935
+ UNTAG_SCHEDULED_JOB,
936
+ { input: { entityId, tagId } }
937
+ );
938
+ return jsonResult({ removed: data.untagScheduledJob });
939
+ } catch (error) {
940
+ ctx.logger.error("scheduler_jobs_tag_remove failed", { error: String(error) });
941
+ return errorResult(
942
+ `Failed to untag: ${error instanceof Error ? error.message : String(error)}`
943
+ );
944
+ }
945
+ }
946
+ );
947
+ server.registerTool(
948
+ track(mcpToolName(ctx.productName, "scheduler_jobs_tag_replace")),
949
+ {
950
+ title: "Replace Scheduled Job Tags",
951
+ description: "Replace all tag assignments on a scheduled job.",
952
+ inputSchema: { entityId: z.string(), tagIds: z.array(z.string()) }
953
+ },
954
+ async ({ entityId, tagIds }) => {
955
+ try {
956
+ const data = await ctx.gql.workspace.request(
957
+ REPLACE_SCHEDULED_JOB_TAGS,
958
+ { input: { entityId, tagIds } }
959
+ );
960
+ return jsonResult(data.replaceScheduledJobTags);
961
+ } catch (error) {
962
+ ctx.logger.error("scheduler_jobs_tag_replace failed", { error: String(error) });
963
+ return errorResult(
964
+ `Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`
965
+ );
966
+ }
967
+ }
968
+ );
969
+ server.registerTool(
970
+ track(mcpToolName(ctx.productName, "scheduler_jobs_tag_list")),
971
+ {
972
+ title: "List Scheduled Job Tags",
973
+ description: "List tag assignments on a scheduled job.",
974
+ inputSchema: { entityId: z.string() }
975
+ },
976
+ async ({ entityId }) => {
977
+ try {
978
+ const data = await ctx.gql.workspace.request(
979
+ GET_SCHEDULED_JOB_TAGS,
980
+ { input: { entityId } }
981
+ );
982
+ return jsonResult(data.getScheduledJobTags);
983
+ } catch (error) {
984
+ ctx.logger.error("scheduler_jobs_tag_list failed", { error: String(error) });
985
+ return errorResult(
986
+ `Failed to list tags: ${error instanceof Error ? error.message : String(error)}`
987
+ );
988
+ }
989
+ }
990
+ );
991
+ server.registerTool(
992
+ track(mcpToolName(ctx.productName, "scheduler_executions_check")),
993
+ {
994
+ title: "Check Execution Status (poll)",
995
+ description: "Polling proxy for the executionUpdated subscription \u2014 returns the current state of an execution.",
996
+ inputSchema: { id: z.string().describe("Execution ID") }
997
+ },
998
+ async ({ id }) => {
999
+ try {
1000
+ const data = await ctx.gql.workspace.request(
1001
+ EXECUTION_UPDATED_POLL,
1002
+ { id }
1003
+ );
1004
+ if (!data.jobExecution) return errorResult(`Execution ${id} not found`);
1005
+ return jsonResult(data.jobExecution);
1006
+ } catch (error) {
1007
+ ctx.logger.error("scheduler_executions_check failed", { error: String(error) });
1008
+ return errorResult(`Failed: ${error instanceof Error ? error.message : String(error)}`);
1009
+ }
1010
+ }
1011
+ );
1012
+ server.registerTool(
1013
+ track(mcpToolName(ctx.productName, "scheduler_jobs_check")),
1014
+ {
1015
+ title: "Check Job Status (poll)",
1016
+ description: "Polling proxy for the jobStatusUpdated subscription \u2014 returns the current state of a scheduled job.",
1017
+ inputSchema: { id: z.string().describe("Schedule ID") }
1018
+ },
1019
+ async ({ id }) => {
1020
+ try {
1021
+ const data = await ctx.gql.workspace.request(
1022
+ JOB_STATUS_UPDATED_POLL,
1023
+ { id }
1024
+ );
1025
+ if (!data.scheduledJob) return errorResult(`Job ${id} not found`);
1026
+ return jsonResult(data.scheduledJob);
1027
+ } catch (error) {
1028
+ ctx.logger.error("scheduler_jobs_check failed", { error: String(error) });
1029
+ return errorResult(`Failed: ${error instanceof Error ? error.message : String(error)}`);
1030
+ }
1031
+ }
1032
+ );
1033
+ server.registerTool(
1034
+ track(mcpToolName(ctx.productName, "scheduler_executions_retry")),
1035
+ {
1036
+ title: "Retry Job Execution",
1037
+ description: "Re-run a failed (or completed) scheduled-job execution. Returns the new JobExecution row created for the retry.",
1038
+ inputSchema: { executionId: z.string().describe("Execution ID to retry") }
1039
+ },
1040
+ async ({ executionId }) => {
1041
+ try {
1042
+ const data = await ctx.gql.workspace.request(
1043
+ RETRY_JOB_EXECUTION,
1044
+ { executionId }
1045
+ );
1046
+ return jsonResult(data.retryJobExecution);
1047
+ } catch (error) {
1048
+ ctx.logger.error("scheduler_executions_retry failed", { error: String(error) });
1049
+ return errorResult(
1050
+ `Failed to retry job execution: ${error instanceof Error ? error.message : String(error)}`
1051
+ );
1052
+ }
1053
+ }
1054
+ );
195
1055
  }
196
1056
 
197
1057
  // src/modules/scheduler/index.ts