@classroomio/mcp 0.0.6 → 0.0.7

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 +6 -0
  2. package/dist/index.js +10 -11
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -164,6 +164,12 @@ Drafts support:
164
164
  - safer updates to existing courses
165
165
  - auditability of AI-generated structure
166
166
 
167
+ Lesson authoring rule:
168
+
169
+ - `lessonLanguages[].content` should contain only the lesson body HTML
170
+ - do not include the lesson title or a top-level heading that repeats `lessons[].title`
171
+ - ClassroomIO already renders the lesson title in the course UI
172
+
167
173
  ## After Publish
168
174
 
169
175
  Once a draft has been published, the live course becomes the safer source of truth.
package/dist/index.js CHANGED
@@ -114,13 +114,10 @@ var ClassroomIoApiClient = class {
114
114
  });
115
115
  }
116
116
  async tagCourses(payload) {
117
- return this.request(
118
- "/organization/tags/courses/assign",
119
- {
120
- method: "PUT",
121
- body: payload
122
- }
123
- );
117
+ return this.request("/organization/tags/courses/assign", {
118
+ method: "PUT",
119
+ body: payload
120
+ });
124
121
  }
125
122
  async request(path, options) {
126
123
  const response = await fetch(new URL(path, this.config.CLASSROOMIO_API_URL), {
@@ -1147,7 +1144,7 @@ var ZCourseLandingPageUpdate = z12.object({
1147
1144
  overview: z12.string().optional(),
1148
1145
  cost: z12.number().int().min(0).optional(),
1149
1146
  currency: z12.enum(["NGN", "USD"]).optional(),
1150
- imageUrl: z12.string().url().optional(),
1147
+ imageUrl: z12.url().optional(),
1151
1148
  generateImage: z12.boolean().optional(),
1152
1149
  imageQuery: z12.string().min(1).max(120).optional(),
1153
1150
  metadata: ZCourseLandingPageMetadataUpdate.optional()
@@ -1168,6 +1165,7 @@ var ZCourseUserAnalyticsParam = z12.object({
1168
1165
 
1169
1166
  // ../utils/dist/validation/course-import/course-import.js
1170
1167
  var ZSupportedLocale = z13.enum(["en", "hi", "fr", "pt", "de", "vi", "ru", "es", "pl", "da"]);
1168
+ var LESSON_BODY_HTML_DESCRIPTION = "Lesson body HTML only. Do not include the lesson title or a top-level heading that repeats lessons[].title because the ClassroomIO UI already renders the lesson title separately.";
1171
1169
  var ZCourseImportWarning = z13.object({
1172
1170
  code: z13.string().min(1),
1173
1171
  message: z13.string().min(1),
@@ -1202,7 +1200,7 @@ var ZCourseImportDraftLesson = z13.object({
1202
1200
  var ZCourseImportDraftLessonLanguage = z13.object({
1203
1201
  lessonExternalId: z13.string().min(1),
1204
1202
  locale: ZSupportedLocale,
1205
- content: z13.string().min(1)
1203
+ content: z13.string().min(1).describe(LESSON_BODY_HTML_DESCRIPTION)
1206
1204
  });
1207
1205
  var ZCourseImportDraftPayload = z13.object({
1208
1206
  course: ZCourseImportDraftCourse,
@@ -1414,6 +1412,7 @@ var publishCourseDraftShape = ZPublishCourseDraftToolInput.shape;
1414
1412
  var publishCourseDraftToExistingCourseShape = ZPublishCourseDraftToExistingCourseToolInput.shape;
1415
1413
  var tagCoursesShape = ZAutomationCourseTagAssignment.shape;
1416
1414
  var SUPPORTED_QUESTION_TYPES_GUIDE = "Supported questionTypeId values: RADIO=1 (Single answer), CHECKBOX=2 (Multiple answers), TEXTAREA=3 (Paragraph), TRUE_FALSE=4 (True/False), SHORT_ANSWER=5 (Short answer), NUMERIC=6 (Numeric answer), FILL_BLANK=7 (Fill in the blank), FILE_UPLOAD=8 (File upload), MATCHING=9 (Matching), ORDERING=10 (Ordering), HOTSPOT=11 (Hotspot), LINK=12 (Links). Use the numeric ids in exercise payloads.";
1415
+ var LESSON_HTML_GUIDE = "For draft lesson HTML, put only the lesson body in lessonLanguages[].content. Do not include the lesson title or a top-level heading that repeats lessons[].title because the ClassroomIO UI already renders the lesson title.";
1417
1416
  function registerCourseDraftTools(server, apiClient) {
1418
1417
  server.tool(
1419
1418
  "list_org_courses",
@@ -1447,7 +1446,7 @@ function registerCourseDraftTools(server, apiClient) {
1447
1446
  );
1448
1447
  server.tool(
1449
1448
  "create_course_draft",
1450
- "Create a new unpublished course draft from structured course JSON. Use this before the first publish.",
1449
+ `Create a new unpublished course draft from structured course JSON. Use this before the first publish. ${LESSON_HTML_GUIDE}`,
1451
1450
  createCourseDraftShape,
1452
1451
  async (args) => {
1453
1452
  const payload = ZCourseImportDraftCreate.parse(args);
@@ -1527,7 +1526,7 @@ function registerCourseDraftTools(server, apiClient) {
1527
1526
  );
1528
1527
  server.tool(
1529
1528
  "update_course_draft",
1530
- "Update an unpublished draft. If the draft is already published, do not keep editing it blindly; create a fresh draft from the live course first.",
1529
+ `Update an unpublished draft. If the draft is already published, do not keep editing it blindly; create a fresh draft from the live course first. ${LESSON_HTML_GUIDE}`,
1531
1530
  updateCourseDraftShape,
1532
1531
  async (args) => {
1533
1532
  const { draftId, ...payload } = ZUpdateCourseDraftToolInput.parse(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classroomio/mcp",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -42,6 +42,7 @@
42
42
  "scripts": {
43
43
  "build": "tsc --noEmit && rm -rf dist tsconfig.tsbuildinfo && node ./scripts/build.mjs",
44
44
  "dev": "tsx src/index.ts",
45
- "start": "node dist/index.js"
45
+ "start": "node dist/index.js",
46
+ "format": "prettier --write \"src/**/*.ts\""
46
47
  }
47
48
  }