@classroomio/mcp 0.0.3 → 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 +104 -6
  2. package/dist/index.js +922 -252
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -41,11 +41,19 @@ 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`
47
48
  - `get_course_draft`
49
+ - `list_course_exercises`
50
+ - `get_course_exercise`
51
+ - `create_course_exercise`
52
+ - `create_course_exercise_from_template`
53
+ - `update_course_exercise`
48
54
  - `update_course_draft`
55
+ - `tag_course_draft`
56
+ - `tag_courses`
49
57
  - `publish_course_draft`
50
58
  - `publish_course_draft_to_existing_course`
51
59
 
@@ -139,6 +147,7 @@ Draft payload shape:
139
147
  ```text
140
148
  draft
141
149
  course
150
+ tags[]
142
151
  sections[]
143
152
  lessons[]
144
153
  lessonLanguages[]
@@ -154,6 +163,31 @@ Drafts support:
154
163
  - safer updates to existing courses
155
164
  - auditability of AI-generated structure
156
165
 
166
+ ## After Publish
167
+
168
+ Once a draft has been published, the live course becomes the safer source of truth.
169
+
170
+ Recommended agent rule:
171
+
172
+ - if the draft is still `DRAFT`, continue editing that draft
173
+ - if the draft is `PUBLISHED`, do not keep reusing it for major follow-up edits
174
+ - instead, read the live course and create a fresh draft from that course
175
+
176
+ Recommended post-publish sequence:
177
+
178
+ 1. `get_course_structure`
179
+ 2. `create_course_draft_from_course`
180
+ 3. `update_course_draft`
181
+ 4. `publish_course_draft_to_existing_course`
182
+
183
+ Why:
184
+
185
+ - teachers may edit the live course in the UI after publish
186
+ - another agent session may have changed the course
187
+ - reusing an old published draft can overwrite newer live changes
188
+
189
+ For exercises on an already-published course, prefer the direct exercise tools instead of creating a whole new draft when the user only wants to add or revise exercises.
190
+
157
191
  ## User Flows
158
192
 
159
193
  ### Flow 1: Create a new course from a prompt
@@ -178,6 +212,8 @@ Result:
178
212
  - a new course is created
179
213
  - sections and lessons are created
180
214
  - localized lesson content is written
215
+ - publish returns the live `courseId` and public `courseUrl`
216
+ - publish can optionally set a random Unsplash-derived course cover
181
217
 
182
218
  ### Flow 2: Create a draft from a PDF
183
219
 
@@ -202,7 +238,27 @@ Important:
202
238
  - the PDF does not need to be uploaded to MCP
203
239
  - the MCP package only receives structured JSON
204
240
 
205
- ### Flow 3: Update an existing course safely
241
+ ### Flow 3: Tag a draft before publish
242
+
243
+ User says:
244
+
245
+ ```text
246
+ Add tags for algebra, beginner, and exponential growth to this draft.
247
+ ```
248
+
249
+ Expected tool sequence:
250
+
251
+ 1. Agent calls `tag_course_draft`.
252
+ 2. User reviews the updated draft tags.
253
+ 3. Agent later calls `publish_course_draft`.
254
+
255
+ Result:
256
+
257
+ - the draft stores tag names
258
+ - publish ensures the tags exist in ClassroomIO
259
+ - publish assigns those tags to the live course
260
+
261
+ ### Flow 4: Update an existing course safely
206
262
 
207
263
  User says:
208
264
 
@@ -212,19 +268,39 @@ Take my existing Algebra course, reorganize it, and rewrite the lesson content f
212
268
 
213
269
  Expected tool sequence:
214
270
 
215
- 1. Agent calls `get_course_structure` with the existing `courseId`.
216
- 2. Agent optionally calls `create_course_draft_from_course` to persist a seeded draft.
217
- 3. Agent updates the draft with the new structure and content using `update_course_draft`.
218
- 4. User reviews the changes.
219
- 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`.
220
277
 
221
278
  What this publish does today:
222
279
 
223
280
  - updates the existing course title, description, type, and metadata
281
+ - can set a generated course cover from Unsplash
282
+ - returns the public `courseUrl`
224
283
  - updates existing sections when the draft keeps their IDs
225
284
  - updates existing lessons when the draft keeps their IDs
226
285
  - creates new sections and lessons for draft items without matching live IDs
227
286
  - upserts lesson language content
287
+ - merges draft tags into the existing course
288
+
289
+ ### Flow 5: Add exercises to a live course
290
+
291
+ User says:
292
+
293
+ ```text
294
+ Add a 5-question multiple-choice exercise to lesson 3.
295
+ ```
296
+
297
+ Expected tool sequence:
298
+
299
+ 1. Agent calls `list_course_exercises` if it needs current context.
300
+ 2. Agent calls `create_course_exercise` for a brand new exercise.
301
+ 3. Agent calls `update_course_exercise` for later revisions.
302
+
303
+ Use this direct path when the course is already live and the change is exercise-specific.
228
304
 
229
305
  What it does not do today:
230
306
 
@@ -253,6 +329,28 @@ For large updates, the agent should:
253
329
  3. only generate new `externalId` values for new records
254
330
  4. avoid deleting records from the draft unless the user explicitly wants omitted content to remain untouched
255
331
 
332
+ Publish input also supports:
333
+
334
+ - `bannerImageUrl`: use this exact course cover
335
+ - `bannerImageQuery`: search Unsplash with this query
336
+ - `generateBannerImage`: fetch a random Unsplash image using the course title or query
337
+
338
+ Tagging tools use:
339
+
340
+ - `tagNames`: human-readable tag names, not tag IDs
341
+ - `mode: "merge" | "replace"`
342
+ - `groupName` optional, defaults to `Automation`
343
+
344
+ The API creates missing tags automatically when needed.
345
+
346
+ Exercise tools use the live course directly:
347
+
348
+ - `list_course_exercises`
349
+ - `get_course_exercise`
350
+ - `create_course_exercise`
351
+ - `create_course_exercise_from_template`
352
+ - `update_course_exercise`
353
+
256
354
  ## Operational Notes
257
355
 
258
356
  - `create_course_draft_from_course` may add warnings if a live course uses legacy lesson notes instead of localized lesson content