@classroomio/mcp 0.0.4 → 0.0.5

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 (3) hide show
  1. package/README.md +7 -5
  2. package/dist/index.js +543 -277
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -41,6 +41,7 @@ ClassroomIO DB
41
41
 
42
42
  Current tools:
43
43
 
44
+ - `list_org_courses`
44
45
  - `get_course_structure`
45
46
  - `create_course_draft`
46
47
  - `create_course_draft_from_course`
@@ -267,11 +268,12 @@ Take my existing Algebra course, reorganize it, and rewrite the lesson content f
267
268
 
268
269
  Expected tool sequence:
269
270
 
270
- 1. Agent calls `get_course_structure` with the existing `courseId`.
271
- 2. Agent optionally calls `create_course_draft_from_course` to persist a seeded draft.
272
- 3. Agent updates the draft with the new structure and content using `update_course_draft`.
273
- 4. User reviews the changes.
274
- 5. Agent calls `publish_course_draft_to_existing_course`.
271
+ 1. Agent calls `list_org_courses` if it needs to resolve the course ID from the course name first.
272
+ 2. Agent calls `get_course_structure` with the existing `courseId`.
273
+ 3. Agent optionally calls `create_course_draft_from_course` to persist a seeded draft.
274
+ 4. Agent updates the draft with the new structure and content using `update_course_draft`.
275
+ 5. User reviews the changes.
276
+ 6. Agent calls `publish_course_draft_to_existing_course`.
275
277
 
276
278
  What this publish does today:
277
279
 
package/dist/index.js CHANGED
@@ -40,6 +40,14 @@ var ClassroomIoApiClient = class {
40
40
  method: "GET"
41
41
  });
42
42
  }
43
+ async listOrganizationCourses(query = {}) {
44
+ const searchParams = new URLSearchParams();
45
+ if (query.tags) searchParams.set("tags", query.tags);
46
+ const querySuffix = searchParams.toString() ? `?${searchParams.toString()}` : "";
47
+ return this.request(`/organization/courses${querySuffix}`, {
48
+ method: "GET"
49
+ });
50
+ }
43
51
  async listCourseExercises(courseId, query = {}) {
44
52
  const searchParams = new URLSearchParams();
45
53
  if (query.lessonId) searchParams.set("lessonId", query.lessonId);
@@ -209,9 +217,256 @@ var ZAutomationCourseTagAssignment = ZAutomationDraftTagAssignment.extend({
209
217
  courseIds: z2.array(z2.string().uuid()).min(1).max(100)
210
218
  });
211
219
 
212
- // ../utils/dist/validation/exercise/exercise.js
220
+ // ../utils/dist/validation/organization/organization.js
213
221
  import * as z3 from "zod";
214
222
 
223
+ // ../utils/dist/constants/org.js
224
+ var blockedSubdomain = [
225
+ "academy",
226
+ "app",
227
+ "apps",
228
+ "blog",
229
+ "build",
230
+ "campaign",
231
+ "church",
232
+ "cloud",
233
+ "community",
234
+ "conference",
235
+ "course",
236
+ "courses",
237
+ "demo",
238
+ "dev",
239
+ "forum",
240
+ "group",
241
+ "groups",
242
+ "help",
243
+ "launch",
244
+ "launchweek",
245
+ "mobile",
246
+ "play",
247
+ "prod",
248
+ "production",
249
+ "schools",
250
+ "stage",
251
+ "staging",
252
+ "support",
253
+ "teacher",
254
+ "teachers",
255
+ "tech",
256
+ "training"
257
+ ];
258
+
259
+ // ../utils/dist/constants/content.js
260
+ var ContentType;
261
+ (function(ContentType2) {
262
+ ContentType2["Section"] = "SECTION";
263
+ ContentType2["Lesson"] = "LESSON";
264
+ ContentType2["Exercise"] = "EXERCISE";
265
+ })(ContentType || (ContentType = {}));
266
+
267
+ // ../utils/dist/validation/organization/organization.js
268
+ var ZGetOrganizations = z3.object({
269
+ siteName: z3.string().min(1).optional(),
270
+ customDomain: z3.string().min(1).optional(),
271
+ isCustomDomainVerified: z3.boolean().optional()
272
+ });
273
+ var ZGetCoursesBySiteName = z3.object({
274
+ siteName: z3.string().min(1),
275
+ tags: z3.string().optional()
276
+ });
277
+ var ZGetOrganizationCoursesQuery = z3.object({
278
+ tags: z3.string().optional()
279
+ });
280
+ var ZGetOrgSetup = z3.object({
281
+ siteName: z3.string().min(1)
282
+ });
283
+ var ZCreateOrgPlan = z3.object({
284
+ orgId: z3.uuid(),
285
+ planName: z3.enum(["EARLY_ADOPTER", "ENTERPRISE", "BASIC"]),
286
+ subscriptionId: z3.string().min(1),
287
+ triggeredBy: z3.number().int().positive(),
288
+ payload: z3.record(z3.string(), z3.unknown())
289
+ });
290
+ var ZUpdateOrgPlan = z3.object({
291
+ subscriptionId: z3.string().min(1),
292
+ payload: z3.record(z3.string(), z3.unknown())
293
+ });
294
+ var ZCancelOrgPlan = z3.object({
295
+ subscriptionId: z3.string().min(1),
296
+ payload: z3.record(z3.string(), z3.unknown())
297
+ });
298
+ var ZCreateOrganization = z3.object({
299
+ name: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
300
+ message: "Organization name cannot start or end with a hyphen"
301
+ }),
302
+ siteName: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
303
+ message: "Site name cannot start or end with a hyphen"
304
+ }).refine((val) => !blockedSubdomain.includes(val), {
305
+ message: "Sitename already exists."
306
+ })
307
+ });
308
+ var ZUpdateOrganization = z3.object({
309
+ name: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
310
+ message: "Organization name cannot start or end with a hyphen"
311
+ }).optional(),
312
+ avatarUrl: z3.url().optional(),
313
+ theme: z3.string().optional(),
314
+ landingpage: z3.record(z3.string(), z3.unknown()).optional(),
315
+ siteName: z3.string().min(1).optional(),
316
+ customDomain: z3.string().nullable().optional(),
317
+ isCustomDomainVerified: z3.boolean().optional(),
318
+ customization: z3.record(z3.string(), z3.unknown()).optional(),
319
+ disableSignup: z3.boolean().optional(),
320
+ disableSignupMessage: z3.string().optional(),
321
+ disableEmailPassword: z3.boolean().optional(),
322
+ disableGoogleAuth: z3.boolean().optional(),
323
+ /** Nested settings (stored in organization.settings JSONB). signup.inviteOnly = true means invite-only signup. */
324
+ settings: z3.object({
325
+ signup: z3.object({
326
+ inviteOnly: z3.boolean().optional()
327
+ }).optional()
328
+ }).optional()
329
+ });
330
+ var ZInviteTeamMembers = z3.object({
331
+ emails: z3.array(z3.string().email()).min(1).max(50),
332
+ roleId: z3.number().int().positive()
333
+ });
334
+ var ZRemoveTeamMember = z3.object({
335
+ memberId: z3.coerce.number().int().positive()
336
+ });
337
+ var ZGetUserAnalytics = z3.object({
338
+ userId: z3.uuid()
339
+ });
340
+
341
+ // ../utils/dist/validation/organization/quiz.js
342
+ import * as z4 from "zod";
343
+ var ZQuizGetParam = z4.object({
344
+ orgId: z4.uuid(),
345
+ quizId: z4.uuid()
346
+ });
347
+ var ZQuizListParam = z4.object({
348
+ orgId: z4.uuid()
349
+ });
350
+ var ZQuizCreate = z4.object({
351
+ title: z4.string().min(1),
352
+ questions: z4.array(z4.any()).optional(),
353
+ timelimit: z4.string().optional(),
354
+ theme: z4.string().optional()
355
+ });
356
+ var ZQuizUpdate = z4.object({
357
+ title: z4.string().min(1).optional(),
358
+ questions: z4.array(z4.any()).optional(),
359
+ timelimit: z4.string().optional(),
360
+ theme: z4.string().optional()
361
+ });
362
+
363
+ // ../utils/dist/validation/organization/exercise.js
364
+ import * as z5 from "zod";
365
+ var ZLMSExercisesParam = z5.object({
366
+ orgId: z5.uuid()
367
+ });
368
+
369
+ // ../utils/dist/validation/organization/invite.js
370
+ import * as z6 from "zod";
371
+ var ZOrganizationInviteTokenParam = z6.object({
372
+ token: z6.string().min(10).max(512)
373
+ });
374
+
375
+ // ../utils/dist/validation/organization/sso.js
376
+ import * as z7 from "zod";
377
+ var SSO_PROVIDERS = ["OKTA", "GOOGLE_WORKSPACE", "AUTH0"];
378
+ var ZCreateSsoConnection = z7.object({
379
+ provider: z7.enum(SSO_PROVIDERS),
380
+ displayName: z7.string().min(1, "Display name is required"),
381
+ issuer: z7.url("Must be a valid URL"),
382
+ domain: z7.string().min(1, "Domain is required").regex(/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/, "Invalid domain format"),
383
+ clientId: z7.string().min(1, "Client ID is required"),
384
+ clientSecret: z7.string().min(1, "Client secret is required"),
385
+ scopes: z7.string().default("openid profile email")
386
+ });
387
+ var ZUpdateSsoConnection = z7.object({
388
+ displayName: z7.string().min(1).optional(),
389
+ issuer: z7.url().optional(),
390
+ domain: z7.string().optional(),
391
+ clientId: z7.string().optional(),
392
+ clientSecret: z7.string().optional(),
393
+ scopes: z7.string().optional(),
394
+ isActive: z7.boolean().optional()
395
+ });
396
+ var ZUpdateSsoPolicy = z7.object({
397
+ forceSso: z7.boolean().optional(),
398
+ autoJoinSsoDomains: z7.boolean().optional(),
399
+ breakGlassEnabled: z7.boolean().optional(),
400
+ defaultRoleId: z7.number().int().positive().optional(),
401
+ roleMapping: z7.record(z7.string(), z7.number()).optional()
402
+ });
403
+ var ZSsoDiscoveryQuery = z7.object({
404
+ email: z7.email("Valid email is required")
405
+ });
406
+ var ZGetSsoConfig = z7.object({
407
+ orgId: z7.uuid()
408
+ });
409
+
410
+ // ../utils/dist/validation/organization/login-link.js
411
+ import { z as z8 } from "zod";
412
+ var ZLoginLinkQuery = z8.object({
413
+ token: z8.string().min(1),
414
+ redirect: z8.string().optional()
415
+ });
416
+ var ZLoginLinkPayload = z8.object({
417
+ sub: z8.uuid(),
418
+ email: z8.email(),
419
+ type: z8.literal("login-link")
420
+ });
421
+
422
+ // ../utils/dist/validation/organization/token-auth.js
423
+ import { z as z9 } from "zod";
424
+ var ZTokenExchangeQuery = z9.object({
425
+ token: z9.string().min(1),
426
+ redirect: z9.string().optional()
427
+ });
428
+ var ZTokenExchangePayload = z9.object({
429
+ sub: z9.string(),
430
+ email: z9.email(),
431
+ name: z9.string().optional(),
432
+ avatar: z9.url().optional(),
433
+ iat: z9.number(),
434
+ exp: z9.number()
435
+ });
436
+
437
+ // ../utils/dist/validation/organization/automation-key.js
438
+ import { z as z10 } from "zod";
439
+ var ZOrganizationApiKeyType = z10.enum(["mcp", "api", "zapier"]);
440
+ var ZOrganizationApiKeyScope = z10.enum([
441
+ "course_import:draft:create",
442
+ "course_import:draft:read",
443
+ "course_import:draft:update",
444
+ "course_import:draft:publish",
445
+ "course:read",
446
+ "course:tag:write",
447
+ "course:exercise:read",
448
+ "course:exercise:write",
449
+ "public_api:*"
450
+ ]);
451
+ var ZListOrganizationApiKeysQuery = z10.object({
452
+ type: ZOrganizationApiKeyType.optional()
453
+ });
454
+ var ZOrganizationAutomationUsageQuery = z10.object({
455
+ type: ZOrganizationApiKeyType.default("mcp")
456
+ });
457
+ var ZCreateOrganizationApiKey = z10.object({
458
+ type: ZOrganizationApiKeyType,
459
+ label: z10.string().min(1).max(120).optional(),
460
+ expiresAt: z10.string().datetime().optional(),
461
+ scopes: z10.array(ZOrganizationApiKeyScope).min(1).optional()
462
+ });
463
+ var ZOrganizationApiKeyParam = z10.object({
464
+ keyId: z10.string().uuid()
465
+ });
466
+
467
+ // ../utils/dist/validation/exercise/exercise.js
468
+ import * as z11 from "zod";
469
+
215
470
  // ../question-types/dist/question-type-keys.js
216
471
  var QUESTION_TYPE_KEY = {
217
472
  RADIO: "RADIO",
@@ -608,22 +863,22 @@ var QUESTION_VALIDATION_RULES = {
608
863
  ],
609
864
  [QUESTION_TYPE.TEXTAREA]: []
610
865
  };
611
- var ZExerciseUpdateQuestionBase = z3.object({
612
- id: z3.number().int().optional(),
613
- question: z3.string().min(1),
614
- questionTypeId: z3.number().int().min(1).optional(),
866
+ var ZExerciseUpdateQuestionBase = z11.object({
867
+ id: z11.number().int().optional(),
868
+ question: z11.string().min(1),
869
+ questionTypeId: z11.number().int().min(1).optional(),
615
870
  // Added to support question type updates
616
- points: z3.number().int().min(0).optional(),
617
- order: z3.number().int().min(0).optional(),
618
- settings: z3.record(z3.string(), z3.unknown()).optional(),
619
- deletedAt: z3.string().optional(),
871
+ points: z11.number().int().min(0).optional(),
872
+ order: z11.number().int().min(0).optional(),
873
+ settings: z11.record(z11.string(), z11.unknown()).optional(),
874
+ deletedAt: z11.string().optional(),
620
875
  // Marks question as deleted
621
- options: z3.array(z3.object({
622
- id: z3.number().int().optional(),
623
- label: z3.string().min(1),
624
- isCorrect: z3.boolean(),
625
- settings: z3.record(z3.string(), z3.unknown()).optional(),
626
- deletedAt: z3.string().optional()
876
+ options: z11.array(z11.object({
877
+ id: z11.number().int().optional(),
878
+ label: z11.string().min(1),
879
+ isCorrect: z11.boolean(),
880
+ settings: z11.record(z11.string(), z11.unknown()).optional(),
881
+ deletedAt: z11.string().optional()
627
882
  // Marks option as deleted
628
883
  })).optional()
629
884
  });
@@ -643,284 +898,284 @@ function validateQuestionOptions(question, ctx) {
643
898
  }
644
899
  }
645
900
  var ZExerciseUpdateQuestion = ZExerciseUpdateQuestionBase.superRefine(validateQuestionOptions);
646
- var ZExerciseCreate = z3.object({
647
- title: z3.string().min(1),
648
- description: z3.string().optional(),
649
- lessonId: z3.string().optional(),
650
- sectionId: z3.string().optional(),
651
- order: z3.number().int().optional(),
652
- courseId: z3.string().min(1),
653
- dueBy: z3.string().optional(),
654
- questions: z3.array(z3.object({
655
- question: z3.string().min(1),
656
- questionTypeId: z3.number().int().min(1).optional(),
657
- points: z3.number().int().min(0).optional(),
658
- settings: z3.record(z3.string(), z3.unknown()).optional(),
659
- options: z3.array(z3.object({
660
- label: z3.string().min(1),
661
- isCorrect: z3.boolean(),
662
- settings: z3.record(z3.string(), z3.unknown()).optional()
901
+ var ZExerciseCreate = z11.object({
902
+ title: z11.string().min(1),
903
+ description: z11.string().optional(),
904
+ lessonId: z11.string().optional(),
905
+ sectionId: z11.string().optional(),
906
+ order: z11.number().int().optional(),
907
+ courseId: z11.string().min(1),
908
+ dueBy: z11.string().optional(),
909
+ questions: z11.array(z11.object({
910
+ question: z11.string().min(1),
911
+ questionTypeId: z11.number().int().min(1).optional(),
912
+ points: z11.number().int().min(0).optional(),
913
+ settings: z11.record(z11.string(), z11.unknown()).optional(),
914
+ options: z11.array(z11.object({
915
+ label: z11.string().min(1),
916
+ isCorrect: z11.boolean(),
917
+ settings: z11.record(z11.string(), z11.unknown()).optional()
663
918
  })).min(2)
664
919
  })).optional()
665
920
  });
666
- var ZExerciseUpdate = z3.object({
667
- title: z3.string().min(1).optional(),
668
- description: z3.string().optional(),
669
- lessonId: z3.string().optional(),
670
- sectionId: z3.string().optional(),
671
- order: z3.number().int().optional(),
672
- isUnlocked: z3.boolean().optional(),
673
- dueBy: z3.string().optional(),
921
+ var ZExerciseUpdate = z11.object({
922
+ title: z11.string().min(1).optional(),
923
+ description: z11.string().optional(),
924
+ lessonId: z11.string().optional(),
925
+ sectionId: z11.string().optional(),
926
+ order: z11.number().int().optional(),
927
+ isUnlocked: z11.boolean().optional(),
928
+ dueBy: z11.string().optional(),
674
929
  // Changed from iso.datetime() to string to match frontend format
675
- questions: z3.array(ZExerciseUpdateQuestion).optional()
930
+ questions: z11.array(ZExerciseUpdateQuestion).optional()
676
931
  });
677
- var ZExerciseGetParam = z3.object({
678
- exerciseId: z3.string().min(1)
932
+ var ZExerciseGetParam = z11.object({
933
+ exerciseId: z11.string().min(1)
679
934
  });
680
- var ZExerciseListQuery = z3.object({
681
- lessonId: z3.string().optional(),
682
- sectionId: z3.string().optional()
935
+ var ZExerciseListQuery = z11.object({
936
+ lessonId: z11.string().optional(),
937
+ sectionId: z11.string().optional()
683
938
  });
684
- var ZExerciseSubmissionCreate = z3.object({
685
- exerciseId: z3.string().min(1),
686
- answers: z3.array(z3.object({
687
- questionId: z3.number().int(),
688
- optionId: z3.number().int().optional(),
689
- answer: z3.string().optional()
939
+ var ZExerciseSubmissionCreate = z11.object({
940
+ exerciseId: z11.string().min(1),
941
+ answers: z11.array(z11.object({
942
+ questionId: z11.number().int(),
943
+ optionId: z11.number().int().optional(),
944
+ answer: z11.string().optional()
690
945
  })).min(1)
691
946
  });
692
- var ZExerciseFromTemplate = z3.object({
693
- lessonId: z3.string().optional(),
694
- sectionId: z3.string().optional(),
695
- order: z3.number().int().optional(),
696
- templateId: z3.number().int().min(1)
947
+ var ZExerciseFromTemplate = z11.object({
948
+ lessonId: z11.string().optional(),
949
+ sectionId: z11.string().optional(),
950
+ order: z11.number().int().optional(),
951
+ templateId: z11.number().int().min(1)
697
952
  });
698
953
 
699
954
  // ../utils/dist/validation/course-import/course-import.js
700
- import * as z5 from "zod";
955
+ import * as z13 from "zod";
701
956
 
702
957
  // ../utils/dist/validation/course/course.js
703
- import * as z4 from "zod";
704
- var ZCourseClone = z4.object({
705
- title: z4.string().min(1),
706
- description: z4.string().optional(),
707
- slug: z4.string().min(1),
708
- organizationId: z4.string().min(1)
709
- });
710
- var ZCourseCloneParam = z4.object({
711
- courseId: z4.string().min(1)
712
- });
713
- var ZCourseGetParam = z4.object({
714
- courseId: z4.string().min(1)
715
- });
716
- var ZCourseGetQuery = z4.object({
717
- slug: z4.string().optional()
718
- });
719
- var ZCourseGetBySlugParam = z4.object({
720
- slug: z4.string().min(1)
721
- });
722
- var ZCourseEnrollParam = z4.object({
723
- courseId: z4.string().min(1)
724
- });
725
- var ZCourseEnrollBody = z4.object({
726
- inviteToken: z4.string().min(1).optional()
727
- });
728
- var ZCourseDownloadParam = z4.object({
729
- courseId: z4.string().min(1)
730
- });
731
- var ZCertificateDownload = z4.object({
732
- theme: z4.string().min(1),
733
- studentName: z4.string().min(1),
734
- courseName: z4.string().min(1),
735
- courseDescription: z4.string().min(1),
736
- orgName: z4.string().min(1),
737
- orgLogoUrl: z4.string().url().optional(),
738
- facilitator: z4.string().optional()
739
- });
740
- var ZCourseDownloadContent = z4.object({
741
- courseTitle: z4.string().min(1),
742
- orgName: z4.string().min(1),
743
- orgTheme: z4.string().min(1),
744
- lessons: z4.array(z4.object({
745
- lessonTitle: z4.string().min(1),
746
- lessonNumber: z4.string().min(1),
747
- lessonNote: z4.string(),
748
- slideUrl: z4.string().url().optional(),
749
- video: z4.array(z4.string().url()).optional()
958
+ import * as z12 from "zod";
959
+ var ZCourseClone = z12.object({
960
+ title: z12.string().min(1),
961
+ description: z12.string().optional(),
962
+ slug: z12.string().min(1),
963
+ organizationId: z12.string().min(1)
964
+ });
965
+ var ZCourseCloneParam = z12.object({
966
+ courseId: z12.string().min(1)
967
+ });
968
+ var ZCourseGetParam = z12.object({
969
+ courseId: z12.string().min(1)
970
+ });
971
+ var ZCourseGetQuery = z12.object({
972
+ slug: z12.string().optional()
973
+ });
974
+ var ZCourseGetBySlugParam = z12.object({
975
+ slug: z12.string().min(1)
976
+ });
977
+ var ZCourseEnrollParam = z12.object({
978
+ courseId: z12.string().min(1)
979
+ });
980
+ var ZCourseEnrollBody = z12.object({
981
+ inviteToken: z12.string().min(1).optional()
982
+ });
983
+ var ZCourseDownloadParam = z12.object({
984
+ courseId: z12.string().min(1)
985
+ });
986
+ var ZCertificateDownload = z12.object({
987
+ theme: z12.string().min(1),
988
+ studentName: z12.string().min(1),
989
+ courseName: z12.string().min(1),
990
+ courseDescription: z12.string().min(1),
991
+ orgName: z12.string().min(1),
992
+ orgLogoUrl: z12.string().url().optional(),
993
+ facilitator: z12.string().optional()
994
+ });
995
+ var ZCourseDownloadContent = z12.object({
996
+ courseTitle: z12.string().min(1),
997
+ orgName: z12.string().min(1),
998
+ orgTheme: z12.string().min(1),
999
+ lessons: z12.array(z12.object({
1000
+ lessonTitle: z12.string().min(1),
1001
+ lessonNumber: z12.string().min(1),
1002
+ lessonNote: z12.string(),
1003
+ slideUrl: z12.string().url().optional(),
1004
+ video: z12.array(z12.string().url()).optional()
750
1005
  }))
751
1006
  });
752
- var ZLessonDownloadContent = z4.object({
753
- title: z4.string().min(1),
754
- number: z4.string().min(1),
755
- orgName: z4.string().min(1),
756
- note: z4.string(),
757
- slideUrl: z4.string().url().optional(),
758
- video: z4.array(z4.string().url()).optional(),
759
- courseTitle: z4.string().min(1)
760
- });
761
- var ZCoursePresignUrlUpload = z4.object({
762
- fileName: z4.string().min(1),
763
- fileType: z4.enum(ALLOWED_CONTENT_TYPES)
764
- });
765
- var ZCourseDocumentPresignUrlUpload = z4.object({
766
- fileName: z4.string().min(1),
767
- fileType: z4.enum(ALLOWED_DOCUMENT_TYPES)
768
- });
769
- var ZCourseDownloadPresignedUrl = z4.object({
770
- keys: z4.array(z4.string().min(1)).min(1)
771
- });
772
- var ZCourseContentUpdateItem = z4.object({
773
- id: z4.string().min(1),
774
- type: z4.enum(["LESSON", "EXERCISE"]),
775
- isUnlocked: z4.boolean().optional(),
776
- order: z4.number().int().min(0).optional(),
777
- sectionId: z4.string().nullable().optional()
778
- });
779
- var ZCourseContentUpdate = z4.object({
780
- items: z4.array(ZCourseContentUpdateItem).min(1)
781
- });
782
- var ZCourseContentDeleteItem = z4.object({
783
- id: z4.string().min(1),
784
- type: z4.enum(["LESSON", "EXERCISE"])
785
- });
786
- var ZCourseContentDelete = z4.object({
787
- sectionId: z4.string().min(1).optional(),
788
- items: z4.array(ZCourseContentDeleteItem).min(1).optional()
1007
+ var ZLessonDownloadContent = z12.object({
1008
+ title: z12.string().min(1),
1009
+ number: z12.string().min(1),
1010
+ orgName: z12.string().min(1),
1011
+ note: z12.string(),
1012
+ slideUrl: z12.string().url().optional(),
1013
+ video: z12.array(z12.string().url()).optional(),
1014
+ courseTitle: z12.string().min(1)
1015
+ });
1016
+ var ZCoursePresignUrlUpload = z12.object({
1017
+ fileName: z12.string().min(1),
1018
+ fileType: z12.enum(ALLOWED_CONTENT_TYPES)
1019
+ });
1020
+ var ZCourseDocumentPresignUrlUpload = z12.object({
1021
+ fileName: z12.string().min(1),
1022
+ fileType: z12.enum(ALLOWED_DOCUMENT_TYPES)
1023
+ });
1024
+ var ZCourseDownloadPresignedUrl = z12.object({
1025
+ keys: z12.array(z12.string().min(1)).min(1)
1026
+ });
1027
+ var ZCourseContentUpdateItem = z12.object({
1028
+ id: z12.string().min(1),
1029
+ type: z12.enum(["LESSON", "EXERCISE"]),
1030
+ isUnlocked: z12.boolean().optional(),
1031
+ order: z12.number().int().min(0).optional(),
1032
+ sectionId: z12.string().nullable().optional()
1033
+ });
1034
+ var ZCourseContentUpdate = z12.object({
1035
+ items: z12.array(ZCourseContentUpdateItem).min(1)
1036
+ });
1037
+ var ZCourseContentDeleteItem = z12.object({
1038
+ id: z12.string().min(1),
1039
+ type: z12.enum(["LESSON", "EXERCISE"])
1040
+ });
1041
+ var ZCourseContentDelete = z12.object({
1042
+ sectionId: z12.string().min(1).optional(),
1043
+ items: z12.array(ZCourseContentDeleteItem).min(1).optional()
789
1044
  }).refine((data) => Boolean(data.sectionId) !== Boolean(data.items), {
790
1045
  message: "Provide either sectionId or items",
791
1046
  path: ["sectionId"]
792
1047
  });
793
- var ZCourseCreate = z4.object({
794
- title: z4.string().min(1),
795
- description: z4.string().min(1),
796
- type: z4.enum(["LIVE_CLASS", "SELF_PACED"]),
797
- organizationId: z4.string().min(1)
798
- });
799
- var ZCourseMetadata = z4.object({
800
- requirements: z4.string().optional(),
801
- description: z4.string().optional(),
802
- goals: z4.string().optional(),
803
- videoUrl: z4.string().optional(),
804
- showDiscount: z4.boolean().optional(),
805
- discount: z4.number().optional(),
806
- paymentLink: z4.string().optional(),
807
- reward: z4.object({
808
- show: z4.boolean(),
809
- description: z4.string()
1048
+ var ZCourseCreate = z12.object({
1049
+ title: z12.string().min(1),
1050
+ description: z12.string().min(1),
1051
+ type: z12.enum(["LIVE_CLASS", "SELF_PACED"]),
1052
+ organizationId: z12.string().min(1)
1053
+ });
1054
+ var ZCourseMetadata = z12.object({
1055
+ requirements: z12.string().optional(),
1056
+ description: z12.string().optional(),
1057
+ goals: z12.string().optional(),
1058
+ videoUrl: z12.string().optional(),
1059
+ showDiscount: z12.boolean().optional(),
1060
+ discount: z12.number().optional(),
1061
+ paymentLink: z12.string().optional(),
1062
+ reward: z12.object({
1063
+ show: z12.boolean(),
1064
+ description: z12.string()
810
1065
  }).optional(),
811
- instructor: z4.object({
812
- name: z4.string(),
813
- role: z4.string(),
814
- coursesNo: z4.number(),
815
- description: z4.string(),
816
- imgUrl: z4.string()
1066
+ instructor: z12.object({
1067
+ name: z12.string(),
1068
+ role: z12.string(),
1069
+ coursesNo: z12.number(),
1070
+ description: z12.string(),
1071
+ imgUrl: z12.string()
817
1072
  }).optional(),
818
- certificate: z4.object({
819
- templateUrl: z4.string()
1073
+ certificate: z12.object({
1074
+ templateUrl: z12.string()
820
1075
  }).optional(),
821
- reviews: z4.array(z4.object({
822
- id: z4.number(),
823
- hide: z4.boolean(),
824
- name: z4.string(),
825
- avatar_url: z4.string(),
826
- rating: z4.number(),
827
- created_at: z4.number(),
828
- description: z4.string()
1076
+ reviews: z12.array(z12.object({
1077
+ id: z12.number(),
1078
+ hide: z12.boolean(),
1079
+ name: z12.string(),
1080
+ avatar_url: z12.string(),
1081
+ rating: z12.number(),
1082
+ created_at: z12.number(),
1083
+ description: z12.string()
829
1084
  })).optional(),
830
- lessonTabsOrder: z4.array(z4.object({
831
- id: z4.union([z4.literal(1), z4.literal(2), z4.literal(3), z4.literal(4)]),
832
- name: z4.string()
1085
+ lessonTabsOrder: z12.array(z12.object({
1086
+ id: z12.union([z12.literal(1), z12.literal(2), z12.literal(3), z12.literal(4)]),
1087
+ name: z12.string()
833
1088
  })).optional(),
834
- grading: z4.boolean().optional(),
835
- lessonDownload: z4.boolean().optional(),
836
- allowNewStudent: z4.boolean(),
837
- sectionDisplay: z4.record(z4.string(), z4.boolean()).optional(),
838
- isContentGroupingEnabled: z4.boolean().optional()
839
- });
840
- var ZCourseUpdate = z4.object({
841
- title: z4.string().min(1).optional(),
842
- description: z4.string().min(1).optional(),
843
- type: z4.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
844
- logo: z4.string().optional(),
845
- slug: z4.string().optional(),
846
- isPublished: z4.boolean().optional(),
847
- overview: z4.string().optional(),
1089
+ grading: z12.boolean().optional(),
1090
+ lessonDownload: z12.boolean().optional(),
1091
+ allowNewStudent: z12.boolean(),
1092
+ sectionDisplay: z12.record(z12.string(), z12.boolean()).optional(),
1093
+ isContentGroupingEnabled: z12.boolean().optional()
1094
+ });
1095
+ var ZCourseUpdate = z12.object({
1096
+ title: z12.string().min(1).optional(),
1097
+ description: z12.string().min(1).optional(),
1098
+ type: z12.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
1099
+ logo: z12.string().optional(),
1100
+ slug: z12.string().optional(),
1101
+ isPublished: z12.boolean().optional(),
1102
+ overview: z12.string().optional(),
848
1103
  metadata: ZCourseMetadata.optional(),
849
- isCertificateDownloadable: z4.boolean().optional(),
850
- certificateTheme: z4.string().optional(),
851
- tagIds: z4.array(z4.uuid()).max(100).optional()
1104
+ isCertificateDownloadable: z12.boolean().optional(),
1105
+ certificateTheme: z12.string().optional(),
1106
+ tagIds: z12.array(z12.uuid()).max(100).optional()
852
1107
  });
853
- var ZCourseUpdateParam = z4.object({
854
- courseId: z4.string().min(1)
1108
+ var ZCourseUpdateParam = z12.object({
1109
+ courseId: z12.string().min(1)
855
1110
  });
856
- var ZCourseDeleteParam = z4.object({
857
- courseId: z4.string().min(1)
1111
+ var ZCourseDeleteParam = z12.object({
1112
+ courseId: z12.string().min(1)
858
1113
  });
859
- var ZCourseProgressParam = z4.object({
860
- courseId: z4.string().min(1)
1114
+ var ZCourseProgressParam = z12.object({
1115
+ courseId: z12.string().min(1)
861
1116
  });
862
- var ZCourseProgressQuery = z4.object({
863
- profileId: z4.string().uuid()
1117
+ var ZCourseProgressQuery = z12.object({
1118
+ profileId: z12.string().uuid()
864
1119
  });
865
- var ZCourseUserAnalyticsParam = z4.object({
866
- courseId: z4.string().min(1),
867
- userId: z4.string().uuid()
1120
+ var ZCourseUserAnalyticsParam = z12.object({
1121
+ courseId: z12.string().min(1),
1122
+ userId: z12.string().uuid()
868
1123
  });
869
1124
 
870
1125
  // ../utils/dist/validation/course-import/course-import.js
871
- var ZSupportedLocale = z5.enum(["en", "hi", "fr", "pt", "de", "vi", "ru", "es", "pl", "da"]);
872
- var ZCourseImportWarning = z5.object({
873
- code: z5.string().min(1),
874
- message: z5.string().min(1),
875
- severity: z5.enum(["info", "warning", "error"])
876
- });
877
- var ZCourseImportSourceReference = z5.object({
878
- type: z5.enum(["prompt", "pdf", "course"]),
879
- label: z5.string().min(1),
880
- pageStart: z5.number().int().min(1).optional(),
881
- pageEnd: z5.number().int().min(1).optional()
882
- });
883
- var ZCourseImportDraftCourse = z5.object({
884
- title: z5.string().min(1),
885
- description: z5.string().min(1),
886
- type: z5.enum(["LIVE_CLASS", "SELF_PACED"]),
1126
+ var ZSupportedLocale = z13.enum(["en", "hi", "fr", "pt", "de", "vi", "ru", "es", "pl", "da"]);
1127
+ var ZCourseImportWarning = z13.object({
1128
+ code: z13.string().min(1),
1129
+ message: z13.string().min(1),
1130
+ severity: z13.enum(["info", "warning", "error"])
1131
+ });
1132
+ var ZCourseImportSourceReference = z13.object({
1133
+ type: z13.enum(["prompt", "pdf", "course"]),
1134
+ label: z13.string().min(1),
1135
+ pageStart: z13.number().int().min(1).optional(),
1136
+ pageEnd: z13.number().int().min(1).optional()
1137
+ });
1138
+ var ZCourseImportDraftCourse = z13.object({
1139
+ title: z13.string().min(1),
1140
+ description: z13.string().min(1),
1141
+ type: z13.enum(["LIVE_CLASS", "SELF_PACED"]),
887
1142
  locale: ZSupportedLocale.default("en"),
888
1143
  metadata: ZCourseMetadata.optional()
889
1144
  });
890
- var ZCourseImportDraftSection = z5.object({
891
- externalId: z5.string().min(1),
892
- title: z5.string().min(1),
893
- order: z5.number().int().min(0)
894
- });
895
- var ZCourseImportDraftLesson = z5.object({
896
- externalId: z5.string().min(1),
897
- sectionExternalId: z5.string().min(1),
898
- title: z5.string().min(1),
899
- order: z5.number().int().min(0),
900
- isUnlocked: z5.boolean().optional(),
901
- public: z5.boolean().optional()
902
- });
903
- var ZCourseImportDraftLessonLanguage = z5.object({
904
- lessonExternalId: z5.string().min(1),
1145
+ var ZCourseImportDraftSection = z13.object({
1146
+ externalId: z13.string().min(1),
1147
+ title: z13.string().min(1),
1148
+ order: z13.number().int().min(0)
1149
+ });
1150
+ var ZCourseImportDraftLesson = z13.object({
1151
+ externalId: z13.string().min(1),
1152
+ sectionExternalId: z13.string().min(1),
1153
+ title: z13.string().min(1),
1154
+ order: z13.number().int().min(0),
1155
+ isUnlocked: z13.boolean().optional(),
1156
+ public: z13.boolean().optional()
1157
+ });
1158
+ var ZCourseImportDraftLessonLanguage = z13.object({
1159
+ lessonExternalId: z13.string().min(1),
905
1160
  locale: ZSupportedLocale,
906
- content: z5.string().min(1)
1161
+ content: z13.string().min(1)
907
1162
  });
908
- var ZCourseImportDraftPayload = z5.object({
1163
+ var ZCourseImportDraftPayload = z13.object({
909
1164
  course: ZCourseImportDraftCourse,
910
- tags: z5.array(z5.string().trim().min(1).max(80)).max(100).default([]),
911
- sections: z5.array(ZCourseImportDraftSection).min(1),
912
- lessons: z5.array(ZCourseImportDraftLesson).min(1),
913
- lessonLanguages: z5.array(ZCourseImportDraftLessonLanguage).min(1),
914
- exercises: z5.array(z5.record(z5.string(), z5.unknown())).optional(),
915
- sourceReferences: z5.array(ZCourseImportSourceReference).optional(),
916
- warnings: z5.array(ZCourseImportWarning).default([])
1165
+ tags: z13.array(z13.string().trim().min(1).max(80)).max(100).default([]),
1166
+ sections: z13.array(ZCourseImportDraftSection).min(1),
1167
+ lessons: z13.array(ZCourseImportDraftLesson).min(1),
1168
+ lessonLanguages: z13.array(ZCourseImportDraftLessonLanguage).min(1),
1169
+ exercises: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
1170
+ sourceReferences: z13.array(ZCourseImportSourceReference).optional(),
1171
+ warnings: z13.array(ZCourseImportWarning).default([])
917
1172
  }).superRefine((value, ctx) => {
918
1173
  const normalizedTags = /* @__PURE__ */ new Set();
919
1174
  value.tags.forEach((tag, index) => {
920
1175
  const tagKey = tag.trim().toLowerCase();
921
1176
  if (normalizedTags.has(tagKey)) {
922
1177
  ctx.addIssue({
923
- code: z5.ZodIssueCode.custom,
1178
+ code: z13.ZodIssueCode.custom,
924
1179
  path: ["tags", index],
925
1180
  message: "Draft tags must be unique"
926
1181
  });
@@ -931,7 +1186,7 @@ var ZCourseImportDraftPayload = z5.object({
931
1186
  value.sections.forEach((section, index) => {
932
1187
  if (sectionIds.has(section.externalId)) {
933
1188
  ctx.addIssue({
934
- code: z5.ZodIssueCode.custom,
1189
+ code: z13.ZodIssueCode.custom,
935
1190
  path: ["sections", index, "externalId"],
936
1191
  message: "Section externalId must be unique"
937
1192
  });
@@ -942,7 +1197,7 @@ var ZCourseImportDraftPayload = z5.object({
942
1197
  value.lessons.forEach((lesson, index) => {
943
1198
  if (lessonIds.has(lesson.externalId)) {
944
1199
  ctx.addIssue({
945
- code: z5.ZodIssueCode.custom,
1200
+ code: z13.ZodIssueCode.custom,
946
1201
  path: ["lessons", index, "externalId"],
947
1202
  message: "Lesson externalId must be unique"
948
1203
  });
@@ -950,7 +1205,7 @@ var ZCourseImportDraftPayload = z5.object({
950
1205
  lessonIds.add(lesson.externalId);
951
1206
  if (!sectionIds.has(lesson.sectionExternalId)) {
952
1207
  ctx.addIssue({
953
- code: z5.ZodIssueCode.custom,
1208
+ code: z13.ZodIssueCode.custom,
954
1209
  path: ["lessons", index, "sectionExternalId"],
955
1210
  message: "Lesson sectionExternalId must reference an existing section"
956
1211
  });
@@ -959,49 +1214,49 @@ var ZCourseImportDraftPayload = z5.object({
959
1214
  value.lessonLanguages.forEach((lessonLanguage, index) => {
960
1215
  if (!lessonIds.has(lessonLanguage.lessonExternalId)) {
961
1216
  ctx.addIssue({
962
- code: z5.ZodIssueCode.custom,
1217
+ code: z13.ZodIssueCode.custom,
963
1218
  path: ["lessonLanguages", index, "lessonExternalId"],
964
1219
  message: "Lesson language must reference an existing lesson"
965
1220
  });
966
1221
  }
967
1222
  });
968
1223
  });
969
- var ZCourseImportDraftCreate = z5.object({
970
- sourceType: z5.enum(["prompt", "pdf", "course"]),
971
- idempotencyKey: z5.string().min(1).optional(),
972
- summary: z5.record(z5.string(), z5.unknown()).optional(),
973
- sourceArtifacts: z5.array(z5.record(z5.string(), z5.unknown())).optional(),
1224
+ var ZCourseImportDraftCreate = z13.object({
1225
+ sourceType: z13.enum(["prompt", "pdf", "course"]),
1226
+ idempotencyKey: z13.string().min(1).optional(),
1227
+ summary: z13.record(z13.string(), z13.unknown()).optional(),
1228
+ sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
974
1229
  draft: ZCourseImportDraftPayload
975
1230
  });
976
- var ZCourseImportCourseParam = z5.object({
977
- courseId: z5.string().min(1)
1231
+ var ZCourseImportCourseParam = z13.object({
1232
+ courseId: z13.string().min(1)
978
1233
  });
979
- var ZCourseImportDraftCreateFromCourse = z5.object({
980
- courseId: z5.string().min(1),
981
- idempotencyKey: z5.string().min(1).optional(),
982
- summary: z5.record(z5.string(), z5.unknown()).optional(),
983
- sourceArtifacts: z5.array(z5.record(z5.string(), z5.unknown())).optional()
1234
+ var ZCourseImportDraftCreateFromCourse = z13.object({
1235
+ courseId: z13.string().min(1),
1236
+ idempotencyKey: z13.string().min(1).optional(),
1237
+ summary: z13.record(z13.string(), z13.unknown()).optional(),
1238
+ sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional()
984
1239
  });
985
- var ZCourseImportDraftGetParam = z5.object({
986
- draftId: z5.string().uuid()
1240
+ var ZCourseImportDraftGetParam = z13.object({
1241
+ draftId: z13.string().uuid()
987
1242
  });
988
- var ZCourseImportDraftUpdate = z5.object({
989
- summary: z5.record(z5.string(), z5.unknown()).optional(),
990
- sourceArtifacts: z5.array(z5.record(z5.string(), z5.unknown())).optional(),
991
- warnings: z5.array(ZCourseImportWarning).optional(),
1243
+ var ZCourseImportDraftUpdate = z13.object({
1244
+ summary: z13.record(z13.string(), z13.unknown()).optional(),
1245
+ sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
1246
+ warnings: z13.array(ZCourseImportWarning).optional(),
992
1247
  draft: ZCourseImportDraftPayload.optional()
993
1248
  });
994
- var ZCourseImportDraftPublish = z5.object({
995
- title: z5.string().min(1).optional(),
996
- description: z5.string().min(1).optional(),
997
- type: z5.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
1249
+ var ZCourseImportDraftPublish = z13.object({
1250
+ title: z13.string().min(1).optional(),
1251
+ description: z13.string().min(1).optional(),
1252
+ type: z13.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
998
1253
  metadata: ZCourseMetadata.optional(),
999
- bannerImageUrl: z5.string().url().optional(),
1000
- bannerImageQuery: z5.string().min(1).max(120).optional(),
1001
- generateBannerImage: z5.boolean().optional()
1254
+ bannerImageUrl: z13.string().url().optional(),
1255
+ bannerImageQuery: z13.string().min(1).max(120).optional(),
1256
+ generateBannerImage: z13.boolean().optional()
1002
1257
  });
1003
1258
  var ZCourseImportDraftPublishToCourse = ZCourseImportDraftPublish.extend({
1004
- courseId: z5.string().min(1)
1259
+ courseId: z13.string().min(1)
1005
1260
  });
1006
1261
 
1007
1262
  // src/tools/course-drafts.ts
@@ -1037,6 +1292,7 @@ var ZPublishCourseDraftToExistingCourseToolInput = ZCourseImportDraftPublishToCo
1037
1292
  });
1038
1293
  var createCourseDraftShape = ZCourseImportDraftCreate.shape;
1039
1294
  var createCourseDraftFromCourseShape = ZCourseImportDraftCreateFromCourse.shape;
1295
+ var listOrganizationCoursesShape = ZGetOrganizationCoursesQuery.shape;
1040
1296
  var getCourseStructureShape = ZCourseImportCourseParam.shape;
1041
1297
  var getCourseDraftShape = ZCourseImportDraftGetParam.shape;
1042
1298
  var updateCourseDraftShape = ZUpdateCourseDraftToolInput.shape;
@@ -1050,6 +1306,16 @@ var publishCourseDraftShape = ZPublishCourseDraftToolInput.shape;
1050
1306
  var publishCourseDraftToExistingCourseShape = ZPublishCourseDraftToExistingCourseToolInput.shape;
1051
1307
  var tagCoursesShape = ZAutomationCourseTagAssignment.shape;
1052
1308
  function registerCourseDraftTools(server, apiClient) {
1309
+ server.tool(
1310
+ "list_org_courses",
1311
+ "List all courses in the authenticated organization. Use this when the user refers to a course by name and you need to discover the available course IDs first.",
1312
+ listOrganizationCoursesShape,
1313
+ async (args) => {
1314
+ const query = ZGetOrganizationCoursesQuery.parse(args);
1315
+ const result = await apiClient.listOrganizationCourses(query);
1316
+ return jsonContent(result);
1317
+ }
1318
+ );
1053
1319
  server.tool(
1054
1320
  "get_course_structure",
1055
1321
  "Read the current live course structure. Use this before creating a fresh draft for post-publish edits.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classroomio/mcp",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",