@edubase/mcp 1.0.23

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.
@@ -0,0 +1,611 @@
1
+ /* Tool definitions */
2
+ export const EDUBASE_API_TOOLS_USERS = [
3
+ // GET /users - List managed, non-generated users
4
+ {
5
+ name: 'edubase_get_users',
6
+ description: "List managed, non-generated users.",
7
+ inputSchema: {
8
+ type: 'object',
9
+ properties: {
10
+ search: {
11
+ type: 'string',
12
+ description: 'search string to filter results',
13
+ },
14
+ limit: {
15
+ type: 'number',
16
+ description: 'limit number of results (default: 16)',
17
+ },
18
+ page: {
19
+ type: 'number',
20
+ description: 'page number (default: 1), not used in search mode!',
21
+ },
22
+ },
23
+ required: [],
24
+ },
25
+ },
26
+ // GET /user:me - Get/check current user
27
+ {
28
+ name: 'edubase_get_user_me',
29
+ description: "Get/check current user.",
30
+ inputSchema: {
31
+ type: 'object',
32
+ properties: {
33
+ user: {
34
+ type: 'string',
35
+ description: "User identification string.\n" +
36
+ "- Use 'me' to get the current user."
37
+ },
38
+ },
39
+ required: ['user'],
40
+ },
41
+ },
42
+ // GET /user - Get/check user
43
+ {
44
+ name: 'edubase_get_user',
45
+ description: "Get/check user.",
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: {
49
+ user: {
50
+ type: 'string',
51
+ description: "User identification string.\n" +
52
+ "- Use 'me' to get the current user, but prefer /user:me endpoint instead."
53
+ },
54
+ },
55
+ required: ['user'],
56
+ },
57
+ },
58
+ // POST /user - Create new user account
59
+ {
60
+ name: 'edubase_post_user',
61
+ description: "Create new EduBase user account.",
62
+ inputSchema: {
63
+ type: 'object',
64
+ properties: {
65
+ username: {
66
+ type: 'string',
67
+ description: 'username (4-64 characters)',
68
+ },
69
+ password: {
70
+ type: 'string',
71
+ description: 'password (4-64 characters) (default: initial random password is automatically generated)',
72
+ },
73
+ first_name: {
74
+ type: 'string',
75
+ description: 'first name (1-64 characters)',
76
+ },
77
+ last_name: {
78
+ type: 'string',
79
+ description: 'last name (1-64 characters)',
80
+ },
81
+ full_name: {
82
+ type: 'string',
83
+ description: 'override automatic full name (1-255 characters)',
84
+ },
85
+ display_name: {
86
+ type: 'string',
87
+ description: 'override automatic display name (1-255 characters)',
88
+ },
89
+ email: {
90
+ type: 'string',
91
+ description: 'valid email address',
92
+ },
93
+ phone: {
94
+ type: 'string',
95
+ description: 'valid phone number in format "+prefix number" without special characters',
96
+ },
97
+ gender: {
98
+ type: 'string',
99
+ description: 'gender ("male", "female", or "other")',
100
+ },
101
+ birthdate: {
102
+ type: 'string',
103
+ description: 'date of birth',
104
+ },
105
+ exam: {
106
+ type: 'boolean',
107
+ description: 'user is only allowed to login when accessing exams (default: false)',
108
+ },
109
+ group: {
110
+ type: 'string',
111
+ description: 'name of the user group',
112
+ },
113
+ template: {
114
+ type: 'string',
115
+ description: 'a template ID for the new account (default: none)',
116
+ },
117
+ language: {
118
+ type: 'string',
119
+ description: 'desired account language (default: API application owner\'s language)',
120
+ },
121
+ timezone: {
122
+ type: 'string',
123
+ description: 'desired timezone (default: API application owner\'s timezone)',
124
+ },
125
+ color: {
126
+ type: 'string',
127
+ description: 'desired favorite color (default/branding/red/blue/yellow/green/purple) (default: default)',
128
+ },
129
+ must_change_password: {
130
+ type: 'boolean',
131
+ description: 'user is forced to change password on first login (default: false)',
132
+ },
133
+ notify: {
134
+ type: 'boolean',
135
+ description: 'notify user via email (or SMS) (default: false)',
136
+ },
137
+ },
138
+ required: ['username', 'first_name', 'last_name', 'email'],
139
+ },
140
+ },
141
+ // PATCH /user - Update user
142
+ {
143
+ name: 'edubase_patch_user',
144
+ description: "Update user.",
145
+ inputSchema: {
146
+ type: 'object',
147
+ properties: {
148
+ user: {
149
+ type: 'string',
150
+ description: 'user identification string',
151
+ },
152
+ active: {
153
+ type: 'boolean',
154
+ description: 'enable or disable user',
155
+ },
156
+ },
157
+ required: ['user'],
158
+ },
159
+ },
160
+ // DELETE /user - Delete user
161
+ {
162
+ name: 'edubase_delete_user',
163
+ description: "Delete user.",
164
+ inputSchema: {
165
+ type: 'object',
166
+ properties: {
167
+ user: {
168
+ type: 'string',
169
+ description: 'user identification string',
170
+ },
171
+ },
172
+ required: ['user'],
173
+ },
174
+ },
175
+ // GET /user:name - Get user's name
176
+ {
177
+ name: 'edubase_get_user_name',
178
+ description: "Get user's name.",
179
+ inputSchema: {
180
+ type: 'object',
181
+ properties: {
182
+ user: {
183
+ type: 'string',
184
+ description: 'user identification string',
185
+ },
186
+ },
187
+ required: ['user'],
188
+ },
189
+ },
190
+ // POST /user:name - Update a user's name
191
+ {
192
+ name: 'edubase_post_user_name',
193
+ description: "Update a user's name.",
194
+ inputSchema: {
195
+ type: 'object',
196
+ properties: {
197
+ user: {
198
+ type: 'string',
199
+ description: 'user identification string',
200
+ },
201
+ first_name: {
202
+ type: 'string',
203
+ description: 'first name (1-64 characters)',
204
+ },
205
+ last_name: {
206
+ type: 'string',
207
+ description: 'last name (1-64 characters)',
208
+ },
209
+ full_name: {
210
+ type: 'string',
211
+ description: 'full name (1-255 characters)',
212
+ },
213
+ display_name: {
214
+ type: 'string',
215
+ description: 'display name (1-255 characters)',
216
+ },
217
+ },
218
+ required: ['user', 'first_name', 'last_name'],
219
+ },
220
+ },
221
+ // GET /user:group - Get user's group
222
+ {
223
+ name: 'edubase_get_user_group',
224
+ description: "Get user's group.",
225
+ inputSchema: {
226
+ type: 'object',
227
+ properties: {
228
+ user: {
229
+ type: 'string',
230
+ description: 'user identification string',
231
+ },
232
+ },
233
+ required: ['user'],
234
+ },
235
+ },
236
+ // POST /user:group - Update a user's group
237
+ {
238
+ name: 'edubase_post_user_group',
239
+ description: "Update a user's group.",
240
+ inputSchema: {
241
+ type: 'object',
242
+ properties: {
243
+ user: {
244
+ type: 'string',
245
+ description: 'user identification string',
246
+ },
247
+ group: {
248
+ type: 'string',
249
+ description: 'user group code',
250
+ },
251
+ },
252
+ required: ['user', 'group'],
253
+ },
254
+ },
255
+ // GET /user:login - Get latest valid login link for user
256
+ {
257
+ name: 'edubase_get_user_login',
258
+ description: "Get latest valid login link for user.",
259
+ inputSchema: {
260
+ type: 'object',
261
+ properties: {
262
+ user: {
263
+ type: 'string',
264
+ description: 'user identification string',
265
+ },
266
+ },
267
+ required: ['user'],
268
+ },
269
+ },
270
+ // POST /user:login - Generate login link
271
+ {
272
+ name: 'edubase_post_user_login',
273
+ description: "Generate login link. If a valid link with the same settings exists, it will be returned instead of creating a new one.",
274
+ inputSchema: {
275
+ type: 'object',
276
+ properties: {
277
+ user: {
278
+ type: 'string',
279
+ description: 'user identification string',
280
+ },
281
+ redirect: {
282
+ type: 'string',
283
+ description: 'redirect after a successful login (URI path or [{content_type}:{tag}])',
284
+ },
285
+ expires: {
286
+ type: 'string',
287
+ description: 'expiry in days (1-30) or YYYY-MM-DD (default: 1 day)',
288
+ },
289
+ logins: {
290
+ type: 'number',
291
+ description: 'total count the link can be used to login users (default: 1)',
292
+ },
293
+ template: {
294
+ type: 'string',
295
+ description: 'a template ID for the login link',
296
+ },
297
+ short: {
298
+ type: 'boolean',
299
+ description: 'generate shortened (eduba.se) link (only if feature is enabled on EduBase) (default: false)',
300
+ },
301
+ },
302
+ required: ['user'],
303
+ },
304
+ },
305
+ // DELETE /user:login - Delete a previously generated login link
306
+ {
307
+ name: 'edubase_delete_user_login',
308
+ description: "Delete a previously generated login link.",
309
+ inputSchema: {
310
+ type: 'object',
311
+ properties: {
312
+ user: {
313
+ type: 'string',
314
+ description: 'user identification string',
315
+ },
316
+ url: {
317
+ type: 'string',
318
+ description: 'generated login link to be invalidated',
319
+ },
320
+ },
321
+ required: ['user', 'url'],
322
+ },
323
+ },
324
+ // GET /user:search - Lookup user by email, username or code
325
+ {
326
+ name: 'edubase_get_user_search',
327
+ description: "Lookup user by email, username or code.",
328
+ inputSchema: {
329
+ type: 'object',
330
+ properties: {
331
+ query: {
332
+ type: 'string',
333
+ description: 'query string',
334
+ },
335
+ },
336
+ required: ['query'],
337
+ },
338
+ },
339
+ // POST /user:assume - Assume user for next requests with assume token
340
+ {
341
+ name: 'edubase_post_user_assume',
342
+ description: "Assume user for next requests with assume token.",
343
+ inputSchema: {
344
+ type: 'object',
345
+ properties: {
346
+ user: {
347
+ type: 'string',
348
+ description: 'user identification string, username or email address',
349
+ },
350
+ password: {
351
+ type: 'string',
352
+ description: 'password or user secret',
353
+ },
354
+ },
355
+ required: ['user'],
356
+ },
357
+ },
358
+ // DELETE /user:assume - Revoke assume token
359
+ {
360
+ name: 'edubase_delete_user_assume',
361
+ description: "Revoke assume token.",
362
+ inputSchema: {
363
+ type: 'object',
364
+ properties: {
365
+ token: {
366
+ type: 'string',
367
+ description: 'assume token',
368
+ },
369
+ },
370
+ required: ['token'],
371
+ },
372
+ },
373
+ ];
374
+ /* Output schema definitions */
375
+ export const EDUBASE_API_TOOLS_USERS_OUTPUT_SCHEMA = {
376
+ // GET /users - List managed, non-generated users
377
+ edubase_get_users: {
378
+ type: 'array',
379
+ items: {
380
+ type: 'object',
381
+ properties: {
382
+ user: {
383
+ type: 'string',
384
+ description: 'user identification string',
385
+ },
386
+ name: {
387
+ type: 'string',
388
+ description: 'full name of the user',
389
+ },
390
+ },
391
+ },
392
+ },
393
+ // GET /user:me - Get/check current user
394
+ edubase_get_user_me: {
395
+ type: 'object',
396
+ properties: {
397
+ user: {
398
+ type: 'string',
399
+ description: 'user identification string',
400
+ },
401
+ name: {
402
+ type: 'string',
403
+ description: 'full name',
404
+ },
405
+ status: {
406
+ type: 'boolean',
407
+ description: 'user is enabled',
408
+ },
409
+ exam: {
410
+ type: 'boolean',
411
+ description: 'exam (generated) account',
412
+ },
413
+ },
414
+ },
415
+ // GET /user - Get/check user
416
+ edubase_get_user: {
417
+ type: 'object',
418
+ properties: {
419
+ user: {
420
+ type: 'string',
421
+ description: 'user identification string',
422
+ },
423
+ name: {
424
+ type: 'string',
425
+ description: 'full name',
426
+ },
427
+ status: {
428
+ type: 'boolean',
429
+ description: 'user is enabled',
430
+ },
431
+ exam: {
432
+ type: 'boolean',
433
+ description: 'exam (generated) account',
434
+ },
435
+ },
436
+ },
437
+ // POST /user - Create new user account
438
+ edubase_post_user: {
439
+ type: 'object',
440
+ properties: {
441
+ user: {
442
+ type: 'string',
443
+ description: 'user identification string',
444
+ },
445
+ username: {
446
+ type: 'string',
447
+ description: 'username, only if exam=false',
448
+ },
449
+ password: {
450
+ type: 'string',
451
+ description: 'password, only if exam=false',
452
+ },
453
+ },
454
+ },
455
+ // PATCH /user - Update user
456
+ edubase_patch_user: {},
457
+ // DELETE /user - Delete user
458
+ edubase_delete_user: {},
459
+ // GET /user:name - Get user's name
460
+ edubase_get_user_name: {
461
+ type: 'object',
462
+ properties: {
463
+ user: {
464
+ type: 'string',
465
+ description: 'the user identification string',
466
+ },
467
+ first_name: {
468
+ type: 'string',
469
+ description: 'first name',
470
+ },
471
+ last_name: {
472
+ type: 'string',
473
+ description: 'last name',
474
+ },
475
+ full_name: {
476
+ type: 'string',
477
+ description: 'full name',
478
+ },
479
+ display_name: {
480
+ type: 'string',
481
+ description: 'display name',
482
+ },
483
+ },
484
+ },
485
+ // POST /user:name - Update a user's name
486
+ edubase_post_user_name: {
487
+ type: 'object',
488
+ properties: {
489
+ user: {
490
+ type: 'string',
491
+ description: 'the user identification string',
492
+ },
493
+ success: {
494
+ type: 'boolean',
495
+ description: 'operation is successful',
496
+ },
497
+ changed: {
498
+ type: 'boolean',
499
+ description: 'name has been changed',
500
+ },
501
+ },
502
+ },
503
+ // GET /user:group - Get user's group
504
+ edubase_get_user_group: {
505
+ type: 'object',
506
+ properties: {
507
+ user: {
508
+ type: 'string',
509
+ description: 'the user identification string',
510
+ },
511
+ group: {
512
+ type: 'string',
513
+ description: 'user group code',
514
+ },
515
+ },
516
+ },
517
+ // POST /user:group - Update a user's group
518
+ edubase_post_user_group: {
519
+ type: 'object',
520
+ properties: {
521
+ user: {
522
+ type: 'string',
523
+ description: 'the user identification string',
524
+ },
525
+ success: {
526
+ type: 'boolean',
527
+ description: 'operation is successful',
528
+ },
529
+ changed: {
530
+ type: 'boolean',
531
+ description: 'name has been changed',
532
+ },
533
+ },
534
+ },
535
+ // GET /user:login - Get latest valid login link for user
536
+ edubase_get_user_login: {
537
+ type: 'object',
538
+ properties: {
539
+ user: {
540
+ type: 'string',
541
+ description: 'the user identification string',
542
+ },
543
+ url: {
544
+ type: 'string',
545
+ description: 'the login link',
546
+ },
547
+ valid: {
548
+ type: 'string',
549
+ description: 'validity (end of day) of the generated link',
550
+ },
551
+ },
552
+ },
553
+ // POST /user:login - Generate login link
554
+ edubase_post_user_login: {
555
+ type: 'object',
556
+ properties: {
557
+ user: {
558
+ type: 'string',
559
+ description: 'the user identification string',
560
+ },
561
+ url: {
562
+ type: 'string',
563
+ description: 'the login link',
564
+ },
565
+ valid: {
566
+ type: 'string',
567
+ description: 'validity of the generated link',
568
+ },
569
+ count: {
570
+ type: 'number',
571
+ description: 'maximum number the link can be used to login',
572
+ },
573
+ },
574
+ },
575
+ // DELETE /user:login - Delete a previously generated login link
576
+ edubase_delete_user_login: {},
577
+ // GET /user:search - Lookup user by email, username or code
578
+ edubase_get_user_search: {
579
+ type: 'object',
580
+ properties: {
581
+ user: {
582
+ type: 'string',
583
+ description: 'user identification string',
584
+ },
585
+ exam: {
586
+ type: 'boolean',
587
+ description: 'exam (generated) account',
588
+ },
589
+ },
590
+ },
591
+ // POST /user:assume - Assume user for next requests with assume token
592
+ edubase_post_user_assume: {
593
+ type: 'object',
594
+ properties: {
595
+ user: {
596
+ type: 'string',
597
+ description: 'user identification string',
598
+ },
599
+ token: {
600
+ type: 'string',
601
+ description: 'assume token',
602
+ },
603
+ valid: {
604
+ type: 'string',
605
+ description: 'validity of the generated token',
606
+ },
607
+ },
608
+ },
609
+ // DELETE /user:assume - Revoke assume token
610
+ edubase_delete_user_assume: {},
611
+ };
package/dist/tools.js ADDED
@@ -0,0 +1,68 @@
1
+ /*
2
+ # EduBase Quiz Hierarchical Structure
3
+
4
+ EduBase Quiz follows a clear three-level hierarchical structure that AI models should understand when generating content:
5
+
6
+ 1. **Questions** (lowest level):
7
+ - Basic building blocks of the Quiz system
8
+ - Multiple question types (choice, numerical, expression, text, etc.)
9
+ - Can be parametrized for dynamic content generation
10
+ - Questions are stored in QuestionBase or directly in Quiz sets
11
+
12
+ 2. **Quiz sets** (middle level):
13
+ - Collections of questions and/or question groups
14
+ - Can have various settings (time limits, scoring rules, etc.)
15
+ - Quiz sets can be used for practice or converted to exams
16
+ - Questions from one Quiz set can be used in multiple exams with different configurations
17
+
18
+ 3. **Exams** (highest level):
19
+ - Time-limited, secure instances of Quiz sets
20
+ - Have specific start and end times
21
+ - Include additional security features (cheating detection, prevention of simultaneous account access during exam)
22
+ - Usually restrict access to hints/solutions
23
+ - Limited to one attempt per user (typically)
24
+ - Draw their questions from existing Quiz sets
25
+
26
+ The relationship is strictly hierarchical: Exams contain Quiz sets, which contain Questions. Questions cannot exist directly in Exams without being part of a Quiz set.
27
+
28
+ When generating content for EduBase, maintain awareness of which level you're operating at and respect the constraints of each level in the hierarchy.
29
+ */
30
+ import { EDUBASE_API_TOOLS_QUESTIONS, EDUBASE_API_TOOLS_QUESTIONS_OUTPUT_SCHEMA } from "./tools/questions.js";
31
+ import { EDUBASE_API_TOOLS_EXAMS, EDUBASE_API_TOOLS_EXAMS_OUTPUT_SCHEMA } from "./tools/exams.js";
32
+ import { EDUBASE_API_TOOLS_QUIZES, EDUBASE_API_TOOLS_QUIZES_OUTPUT_SCHEMA } from "./tools/quizes.js";
33
+ import { EDUBASE_API_TOOLS_PLAYS, EDUBASE_API_TOOLS_PLAYS_OUTPUT_SCHEMA } from "./tools/plays.js";
34
+ import { EDUBASE_API_TOOLS_USERS, EDUBASE_API_TOOLS_USERS_OUTPUT_SCHEMA } from "./tools/users.js";
35
+ import { EDUBASE_API_TOOLS_CLASSES, EDUBASE_API_TOOLS_CLASSES_OUTPUT_SCHEMA } from "./tools/classes.js";
36
+ import { EDUBASE_API_TOOLS_ORGANIZATIONS, EDUBASE_API_TOOLS_ORGANIZATIONS_OUTPUT_SCHEMA } from "./tools/organizations.js";
37
+ import { EDUBASE_API_TOOLS_INTEGRATIONS, EDUBASE_API_TOOLS_INTEGRATIONS_OUTPUT_SCHEMA } from "./tools/integrations.js";
38
+ import { EDUBASE_API_TOOLS_TAGS, EDUBASE_API_TOOLS_TAGS_OUTPUT_SCHEMA } from "./tools/tags.js";
39
+ import { EDUBASE_API_TOOLS_PERMISSIONS, EDUBASE_API_TOOLS_PERMISSIONS_OUTPUT_SCHEMA } from "./tools/permissions.js";
40
+ import { EDUBASE_API_TOOLS_METRICS, EDUBASE_API_TOOLS_METRICS_OUTPUT_SCHEMA } from "./tools/metrics.js";
41
+ /* Tool definitions */
42
+ export const EDUBASE_API_TOOLS = [
43
+ ...EDUBASE_API_TOOLS_QUESTIONS,
44
+ ...EDUBASE_API_TOOLS_EXAMS,
45
+ ...EDUBASE_API_TOOLS_PLAYS,
46
+ ...EDUBASE_API_TOOLS_QUIZES,
47
+ ...EDUBASE_API_TOOLS_USERS,
48
+ ...EDUBASE_API_TOOLS_CLASSES,
49
+ ...EDUBASE_API_TOOLS_ORGANIZATIONS,
50
+ ...EDUBASE_API_TOOLS_INTEGRATIONS,
51
+ ...EDUBASE_API_TOOLS_TAGS,
52
+ ...EDUBASE_API_TOOLS_PERMISSIONS,
53
+ ...EDUBASE_API_TOOLS_METRICS
54
+ ];
55
+ /* Output schema definitions */
56
+ export const EDUBASE_API_TOOLS_OUTPUT_SCHEMA = {
57
+ ...EDUBASE_API_TOOLS_QUESTIONS_OUTPUT_SCHEMA,
58
+ ...EDUBASE_API_TOOLS_EXAMS_OUTPUT_SCHEMA,
59
+ ...EDUBASE_API_TOOLS_QUIZES_OUTPUT_SCHEMA,
60
+ ...EDUBASE_API_TOOLS_PLAYS_OUTPUT_SCHEMA,
61
+ ...EDUBASE_API_TOOLS_USERS_OUTPUT_SCHEMA,
62
+ ...EDUBASE_API_TOOLS_CLASSES_OUTPUT_SCHEMA,
63
+ ...EDUBASE_API_TOOLS_ORGANIZATIONS_OUTPUT_SCHEMA,
64
+ ...EDUBASE_API_TOOLS_INTEGRATIONS_OUTPUT_SCHEMA,
65
+ ...EDUBASE_API_TOOLS_TAGS_OUTPUT_SCHEMA,
66
+ ...EDUBASE_API_TOOLS_PERMISSIONS_OUTPUT_SCHEMA,
67
+ ...EDUBASE_API_TOOLS_METRICS_OUTPUT_SCHEMA
68
+ };