gogcli-mcp 2.0.0 → 2.0.2
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.
- package/README.md +3 -0
- package/dist/index.js +864 -8
- package/dist/lib.js +866 -8
- package/manifest.json +229 -1
- package/package.json +18 -1
- package/src/lib.ts +2 -0
- package/src/server.ts +10 -1
- package/src/tools/classroom.ts +696 -0
- package/src/tools/drive.ts +17 -6
- package/src/tools/slides.ts +203 -0
- package/src/tools/utils.ts +9 -1
- package/tests/runner.test.ts +16 -0
- package/tests/server.test.ts +43 -0
- package/tests/tools/classroom.test.ts +875 -0
- package/tests/tools/drive.test.ts +49 -3
- package/tests/tools/slides.test.ts +441 -0
- package/tests/tools/utils.test.ts +65 -0
package/dist/lib.js
CHANGED
|
@@ -30096,7 +30096,9 @@ function toError(err) {
|
|
|
30096
30096
|
return toText(err instanceof Error ? `Error: ${err.message}` : String(err));
|
|
30097
30097
|
}
|
|
30098
30098
|
var AUTH_ERROR_PATTERN = /\b(401|unauthorized|token.*(expired|revoked)|invalid_grant)\b/i;
|
|
30099
|
+
var TRANSIENT_ERROR_PATTERN = /\b429\b|\b5\d\d\b|\bquota\b|rateLimit|\bDEADLINE_EXCEEDED\b/i;
|
|
30099
30100
|
var AUTH_HINT = "\n\nAuthentication may have expired. Use gog_auth_add to re-authorize the account. Ask the user if they would like to re-authenticate.";
|
|
30101
|
+
var TRANSIENT_HINT = "\n\nThis error is often transient. Retry the same call before trying a different approach (do not fall back to smaller writes or row-by-row operations).";
|
|
30100
30102
|
async function runOrDiagnose(args, options) {
|
|
30101
30103
|
try {
|
|
30102
30104
|
return toText(await run(args, options));
|
|
@@ -30104,7 +30106,8 @@ async function runOrDiagnose(args, options) {
|
|
|
30104
30106
|
const base = toError(err);
|
|
30105
30107
|
const errText = base.content[0].text;
|
|
30106
30108
|
const isAuthError = AUTH_ERROR_PATTERN.test(errText);
|
|
30107
|
-
const
|
|
30109
|
+
const isTransientError = !isAuthError && TRANSIENT_ERROR_PATTERN.test(errText);
|
|
30110
|
+
const hint = isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : "";
|
|
30108
30111
|
try {
|
|
30109
30112
|
const accounts = await run(["auth", "list"]);
|
|
30110
30113
|
return toText(`${errText}
|
|
@@ -30303,6 +30306,657 @@ function registerCalendarTools(server) {
|
|
|
30303
30306
|
});
|
|
30304
30307
|
}
|
|
30305
30308
|
|
|
30309
|
+
// src/tools/classroom.ts
|
|
30310
|
+
function registerClassroomTools(server) {
|
|
30311
|
+
server.registerTool("gog_classroom_courses_list", {
|
|
30312
|
+
description: "List Google Classroom courses.",
|
|
30313
|
+
annotations: { readOnlyHint: true },
|
|
30314
|
+
inputSchema: {
|
|
30315
|
+
state: external_exports3.string().optional().describe("Comma-separated course states (ACTIVE, ARCHIVED, PROVISIONED, DECLINED, SUSPENDED)"),
|
|
30316
|
+
teacher: external_exports3.string().optional().describe("Filter by teacher user ID"),
|
|
30317
|
+
student: external_exports3.string().optional().describe("Filter by student user ID"),
|
|
30318
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30319
|
+
page: external_exports3.string().optional().describe("Page token for pagination"),
|
|
30320
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30321
|
+
account: accountParam
|
|
30322
|
+
}
|
|
30323
|
+
}, async ({ state, teacher, student, max, page, all, account }) => {
|
|
30324
|
+
const args = ["classroom", "courses", "list"];
|
|
30325
|
+
if (state) args.push(`--state=${state}`);
|
|
30326
|
+
if (teacher) args.push(`--teacher=${teacher}`);
|
|
30327
|
+
if (student) args.push(`--student=${student}`);
|
|
30328
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30329
|
+
if (page) args.push(`--page=${page}`);
|
|
30330
|
+
if (all) args.push("--all");
|
|
30331
|
+
return runOrDiagnose(args, { account });
|
|
30332
|
+
});
|
|
30333
|
+
server.registerTool("gog_classroom_courses_get", {
|
|
30334
|
+
description: "Get a single Google Classroom course by ID.",
|
|
30335
|
+
annotations: { readOnlyHint: true },
|
|
30336
|
+
inputSchema: {
|
|
30337
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30338
|
+
account: accountParam
|
|
30339
|
+
}
|
|
30340
|
+
}, async ({ courseId, account }) => {
|
|
30341
|
+
return runOrDiagnose(["classroom", "courses", "get", courseId], { account });
|
|
30342
|
+
});
|
|
30343
|
+
server.registerTool("gog_classroom_courses_create", {
|
|
30344
|
+
description: "Create a new Google Classroom course.",
|
|
30345
|
+
inputSchema: {
|
|
30346
|
+
name: external_exports3.string().describe("Course name"),
|
|
30347
|
+
owner: external_exports3.string().optional().describe('Owner user ID (default: "me")'),
|
|
30348
|
+
section: external_exports3.string().optional().describe("Section"),
|
|
30349
|
+
descriptionHeading: external_exports3.string().optional().describe("Description heading"),
|
|
30350
|
+
description: external_exports3.string().optional().describe("Description"),
|
|
30351
|
+
room: external_exports3.string().optional().describe("Room"),
|
|
30352
|
+
state: external_exports3.string().optional().describe("Course state: ACTIVE, ARCHIVED, PROVISIONED, DECLINED, SUSPENDED"),
|
|
30353
|
+
account: accountParam
|
|
30354
|
+
}
|
|
30355
|
+
}, async ({ name, owner, section, descriptionHeading, description, room, state, account }) => {
|
|
30356
|
+
const args = ["classroom", "courses", "create", `--name=${name}`];
|
|
30357
|
+
if (owner) args.push(`--owner=${owner}`);
|
|
30358
|
+
if (section) args.push(`--section=${section}`);
|
|
30359
|
+
if (descriptionHeading) args.push(`--description-heading=${descriptionHeading}`);
|
|
30360
|
+
if (description) args.push(`--description=${description}`);
|
|
30361
|
+
if (room) args.push(`--room=${room}`);
|
|
30362
|
+
if (state) args.push(`--state=${state}`);
|
|
30363
|
+
return runOrDiagnose(args, { account });
|
|
30364
|
+
});
|
|
30365
|
+
server.registerTool("gog_classroom_courses_update", {
|
|
30366
|
+
description: "Update an existing Google Classroom course.",
|
|
30367
|
+
annotations: { destructiveHint: true },
|
|
30368
|
+
inputSchema: {
|
|
30369
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30370
|
+
name: external_exports3.string().optional().describe("Course name"),
|
|
30371
|
+
owner: external_exports3.string().optional().describe("Owner user ID"),
|
|
30372
|
+
section: external_exports3.string().optional().describe("Section"),
|
|
30373
|
+
descriptionHeading: external_exports3.string().optional().describe("Description heading"),
|
|
30374
|
+
description: external_exports3.string().optional().describe("Description"),
|
|
30375
|
+
room: external_exports3.string().optional().describe("Room"),
|
|
30376
|
+
state: external_exports3.string().optional().describe("Course state: ACTIVE, ARCHIVED, PROVISIONED, DECLINED, SUSPENDED"),
|
|
30377
|
+
account: accountParam
|
|
30378
|
+
}
|
|
30379
|
+
}, async ({ courseId, name, owner, section, descriptionHeading, description, room, state, account }) => {
|
|
30380
|
+
const args = ["classroom", "courses", "update", courseId];
|
|
30381
|
+
if (name) args.push(`--name=${name}`);
|
|
30382
|
+
if (owner) args.push(`--owner=${owner}`);
|
|
30383
|
+
if (section) args.push(`--section=${section}`);
|
|
30384
|
+
if (descriptionHeading) args.push(`--description-heading=${descriptionHeading}`);
|
|
30385
|
+
if (description) args.push(`--description=${description}`);
|
|
30386
|
+
if (room) args.push(`--room=${room}`);
|
|
30387
|
+
if (state) args.push(`--state=${state}`);
|
|
30388
|
+
return runOrDiagnose(args, { account });
|
|
30389
|
+
});
|
|
30390
|
+
server.registerTool("gog_classroom_courses_delete", {
|
|
30391
|
+
description: "Delete a Google Classroom course.",
|
|
30392
|
+
annotations: { destructiveHint: true },
|
|
30393
|
+
inputSchema: {
|
|
30394
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30395
|
+
account: accountParam
|
|
30396
|
+
}
|
|
30397
|
+
}, async ({ courseId, account }) => {
|
|
30398
|
+
return runOrDiagnose(["classroom", "courses", "delete", courseId], { account });
|
|
30399
|
+
});
|
|
30400
|
+
server.registerTool("gog_classroom_courses_archive", {
|
|
30401
|
+
description: "Archive a Google Classroom course.",
|
|
30402
|
+
annotations: { destructiveHint: true },
|
|
30403
|
+
inputSchema: {
|
|
30404
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30405
|
+
account: accountParam
|
|
30406
|
+
}
|
|
30407
|
+
}, async ({ courseId, account }) => {
|
|
30408
|
+
return runOrDiagnose(["classroom", "courses", "archive", courseId], { account });
|
|
30409
|
+
});
|
|
30410
|
+
server.registerTool("gog_classroom_courses_unarchive", {
|
|
30411
|
+
description: "Unarchive a Google Classroom course (restore to ACTIVE).",
|
|
30412
|
+
annotations: { destructiveHint: true },
|
|
30413
|
+
inputSchema: {
|
|
30414
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30415
|
+
account: accountParam
|
|
30416
|
+
}
|
|
30417
|
+
}, async ({ courseId, account }) => {
|
|
30418
|
+
return runOrDiagnose(["classroom", "courses", "unarchive", courseId], { account });
|
|
30419
|
+
});
|
|
30420
|
+
server.registerTool("gog_classroom_students_list", {
|
|
30421
|
+
description: "List students enrolled in a Google Classroom course.",
|
|
30422
|
+
annotations: { readOnlyHint: true },
|
|
30423
|
+
inputSchema: {
|
|
30424
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30425
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30426
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30427
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30428
|
+
account: accountParam
|
|
30429
|
+
}
|
|
30430
|
+
}, async ({ courseId, max, page, all, account }) => {
|
|
30431
|
+
const args = ["classroom", "students", "list", courseId];
|
|
30432
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30433
|
+
if (page) args.push(`--page=${page}`);
|
|
30434
|
+
if (all) args.push("--all");
|
|
30435
|
+
return runOrDiagnose(args, { account });
|
|
30436
|
+
});
|
|
30437
|
+
server.registerTool("gog_classroom_students_get", {
|
|
30438
|
+
description: "Get a specific student enrolled in a course.",
|
|
30439
|
+
annotations: { readOnlyHint: true },
|
|
30440
|
+
inputSchema: {
|
|
30441
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30442
|
+
userId: external_exports3.string().describe("Student user ID"),
|
|
30443
|
+
account: accountParam
|
|
30444
|
+
}
|
|
30445
|
+
}, async ({ courseId, userId, account }) => {
|
|
30446
|
+
return runOrDiagnose(["classroom", "students", "get", courseId, userId], { account });
|
|
30447
|
+
});
|
|
30448
|
+
server.registerTool("gog_classroom_students_add", {
|
|
30449
|
+
description: "Add a student to a Google Classroom course.",
|
|
30450
|
+
inputSchema: {
|
|
30451
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30452
|
+
userId: external_exports3.string().describe('Student user ID (or "me")'),
|
|
30453
|
+
enrollmentCode: external_exports3.string().optional().describe("Enrollment code (required if adding self via code)"),
|
|
30454
|
+
account: accountParam
|
|
30455
|
+
}
|
|
30456
|
+
}, async ({ courseId, userId, enrollmentCode, account }) => {
|
|
30457
|
+
const args = ["classroom", "students", "add", courseId, userId];
|
|
30458
|
+
if (enrollmentCode) args.push(`--enrollment-code=${enrollmentCode}`);
|
|
30459
|
+
return runOrDiagnose(args, { account });
|
|
30460
|
+
});
|
|
30461
|
+
server.registerTool("gog_classroom_students_remove", {
|
|
30462
|
+
description: "Remove a student from a Google Classroom course.",
|
|
30463
|
+
annotations: { destructiveHint: true },
|
|
30464
|
+
inputSchema: {
|
|
30465
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30466
|
+
userId: external_exports3.string().describe("Student user ID"),
|
|
30467
|
+
account: accountParam
|
|
30468
|
+
}
|
|
30469
|
+
}, async ({ courseId, userId, account }) => {
|
|
30470
|
+
return runOrDiagnose(["classroom", "students", "remove", courseId, userId], { account });
|
|
30471
|
+
});
|
|
30472
|
+
server.registerTool("gog_classroom_teachers_list", {
|
|
30473
|
+
description: "List teachers in a Google Classroom course.",
|
|
30474
|
+
annotations: { readOnlyHint: true },
|
|
30475
|
+
inputSchema: {
|
|
30476
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30477
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30478
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30479
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30480
|
+
account: accountParam
|
|
30481
|
+
}
|
|
30482
|
+
}, async ({ courseId, max, page, all, account }) => {
|
|
30483
|
+
const args = ["classroom", "teachers", "list", courseId];
|
|
30484
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30485
|
+
if (page) args.push(`--page=${page}`);
|
|
30486
|
+
if (all) args.push("--all");
|
|
30487
|
+
return runOrDiagnose(args, { account });
|
|
30488
|
+
});
|
|
30489
|
+
server.registerTool("gog_classroom_teachers_get", {
|
|
30490
|
+
description: "Get a specific teacher in a course.",
|
|
30491
|
+
annotations: { readOnlyHint: true },
|
|
30492
|
+
inputSchema: {
|
|
30493
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30494
|
+
userId: external_exports3.string().describe("Teacher user ID"),
|
|
30495
|
+
account: accountParam
|
|
30496
|
+
}
|
|
30497
|
+
}, async ({ courseId, userId, account }) => {
|
|
30498
|
+
return runOrDiagnose(["classroom", "teachers", "get", courseId, userId], { account });
|
|
30499
|
+
});
|
|
30500
|
+
server.registerTool("gog_classroom_teachers_add", {
|
|
30501
|
+
description: "Add a teacher to a Google Classroom course.",
|
|
30502
|
+
inputSchema: {
|
|
30503
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30504
|
+
userId: external_exports3.string().describe("Teacher user ID"),
|
|
30505
|
+
account: accountParam
|
|
30506
|
+
}
|
|
30507
|
+
}, async ({ courseId, userId, account }) => {
|
|
30508
|
+
return runOrDiagnose(["classroom", "teachers", "add", courseId, userId], { account });
|
|
30509
|
+
});
|
|
30510
|
+
server.registerTool("gog_classroom_teachers_remove", {
|
|
30511
|
+
description: "Remove a teacher from a Google Classroom course.",
|
|
30512
|
+
annotations: { destructiveHint: true },
|
|
30513
|
+
inputSchema: {
|
|
30514
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30515
|
+
userId: external_exports3.string().describe("Teacher user ID"),
|
|
30516
|
+
account: accountParam
|
|
30517
|
+
}
|
|
30518
|
+
}, async ({ courseId, userId, account }) => {
|
|
30519
|
+
return runOrDiagnose(["classroom", "teachers", "remove", courseId, userId], { account });
|
|
30520
|
+
});
|
|
30521
|
+
server.registerTool("gog_classroom_roster", {
|
|
30522
|
+
description: "List the full roster (students and/or teachers) of a Google Classroom course. Omit both flags to return both groups.",
|
|
30523
|
+
annotations: { readOnlyHint: true },
|
|
30524
|
+
inputSchema: {
|
|
30525
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30526
|
+
students: external_exports3.boolean().optional().describe("Include students only"),
|
|
30527
|
+
teachers: external_exports3.boolean().optional().describe("Include teachers only"),
|
|
30528
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30529
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30530
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30531
|
+
account: accountParam
|
|
30532
|
+
}
|
|
30533
|
+
}, async ({ courseId, students, teachers, max, page, all, account }) => {
|
|
30534
|
+
const args = ["classroom", "roster", courseId];
|
|
30535
|
+
if (students) args.push("--students");
|
|
30536
|
+
if (teachers) args.push("--teachers");
|
|
30537
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30538
|
+
if (page) args.push(`--page=${page}`);
|
|
30539
|
+
if (all) args.push("--all");
|
|
30540
|
+
return runOrDiagnose(args, { account });
|
|
30541
|
+
});
|
|
30542
|
+
server.registerTool("gog_classroom_coursework_list", {
|
|
30543
|
+
description: "List coursework (assignments, questions, materials) for a course.",
|
|
30544
|
+
annotations: { readOnlyHint: true },
|
|
30545
|
+
inputSchema: {
|
|
30546
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30547
|
+
state: external_exports3.string().optional().describe("Filter by coursework state (PUBLISHED, DRAFT, DELETED)"),
|
|
30548
|
+
topic: external_exports3.string().optional().describe("Filter by topic ID"),
|
|
30549
|
+
orderBy: external_exports3.string().optional().describe('Sort order (e.g. "updateTime desc")'),
|
|
30550
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30551
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30552
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30553
|
+
scanPages: external_exports3.number().optional().describe("Max pages to scan when filtering"),
|
|
30554
|
+
account: accountParam
|
|
30555
|
+
}
|
|
30556
|
+
}, async ({ courseId, state, topic, orderBy, max, page, all, scanPages, account }) => {
|
|
30557
|
+
const args = ["classroom", "coursework", "list", courseId];
|
|
30558
|
+
if (state) args.push(`--state=${state}`);
|
|
30559
|
+
if (topic) args.push(`--topic=${topic}`);
|
|
30560
|
+
if (orderBy) args.push(`--order-by=${orderBy}`);
|
|
30561
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30562
|
+
if (page) args.push(`--page=${page}`);
|
|
30563
|
+
if (all) args.push("--all");
|
|
30564
|
+
if (scanPages !== void 0) args.push(`--scan-pages=${scanPages}`);
|
|
30565
|
+
return runOrDiagnose(args, { account });
|
|
30566
|
+
});
|
|
30567
|
+
server.registerTool("gog_classroom_coursework_get", {
|
|
30568
|
+
description: "Get a single coursework item by ID.",
|
|
30569
|
+
annotations: { readOnlyHint: true },
|
|
30570
|
+
inputSchema: {
|
|
30571
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30572
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30573
|
+
account: accountParam
|
|
30574
|
+
}
|
|
30575
|
+
}, async ({ courseId, courseworkId, account }) => {
|
|
30576
|
+
return runOrDiagnose(["classroom", "coursework", "get", courseId, courseworkId], { account });
|
|
30577
|
+
});
|
|
30578
|
+
server.registerTool("gog_classroom_coursework_create", {
|
|
30579
|
+
description: "Create a new coursework item (assignment, question, etc.) in a course.",
|
|
30580
|
+
inputSchema: {
|
|
30581
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30582
|
+
title: external_exports3.string().describe("Coursework title"),
|
|
30583
|
+
description: external_exports3.string().optional().describe("Description"),
|
|
30584
|
+
type: external_exports3.string().optional().describe("Work type (ASSIGNMENT, SHORT_ANSWER_QUESTION, MULTIPLE_CHOICE_QUESTION). Default: ASSIGNMENT"),
|
|
30585
|
+
state: external_exports3.string().optional().describe("State: PUBLISHED or DRAFT"),
|
|
30586
|
+
maxPoints: external_exports3.number().optional().describe("Max points"),
|
|
30587
|
+
due: external_exports3.string().optional().describe("Due datetime (combined date+time)"),
|
|
30588
|
+
dueDate: external_exports3.string().optional().describe("Due date (YYYY-MM-DD)"),
|
|
30589
|
+
dueTime: external_exports3.string().optional().describe("Due time (HH:MM)"),
|
|
30590
|
+
scheduled: external_exports3.string().optional().describe("Scheduled publish time"),
|
|
30591
|
+
topic: external_exports3.string().optional().describe("Topic ID"),
|
|
30592
|
+
account: accountParam
|
|
30593
|
+
}
|
|
30594
|
+
}, async ({ courseId, title, description, type, state, maxPoints, due, dueDate, dueTime, scheduled, topic, account }) => {
|
|
30595
|
+
const args = ["classroom", "coursework", "create", courseId, `--title=${title}`];
|
|
30596
|
+
if (description) args.push(`--description=${description}`);
|
|
30597
|
+
if (type) args.push(`--type=${type}`);
|
|
30598
|
+
if (state) args.push(`--state=${state}`);
|
|
30599
|
+
if (maxPoints !== void 0) args.push(`--max-points=${maxPoints}`);
|
|
30600
|
+
if (due) args.push(`--due=${due}`);
|
|
30601
|
+
if (dueDate) args.push(`--due-date=${dueDate}`);
|
|
30602
|
+
if (dueTime) args.push(`--due-time=${dueTime}`);
|
|
30603
|
+
if (scheduled) args.push(`--scheduled=${scheduled}`);
|
|
30604
|
+
if (topic) args.push(`--topic=${topic}`);
|
|
30605
|
+
return runOrDiagnose(args, { account });
|
|
30606
|
+
});
|
|
30607
|
+
server.registerTool("gog_classroom_coursework_update", {
|
|
30608
|
+
description: "Update an existing coursework item.",
|
|
30609
|
+
annotations: { destructiveHint: true },
|
|
30610
|
+
inputSchema: {
|
|
30611
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30612
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30613
|
+
title: external_exports3.string().optional().describe("New title"),
|
|
30614
|
+
description: external_exports3.string().optional().describe("New description"),
|
|
30615
|
+
type: external_exports3.string().optional().describe("Work type"),
|
|
30616
|
+
state: external_exports3.string().optional().describe("State: PUBLISHED or DRAFT"),
|
|
30617
|
+
maxPoints: external_exports3.number().optional().describe("Max points"),
|
|
30618
|
+
due: external_exports3.string().optional().describe("Due datetime"),
|
|
30619
|
+
dueDate: external_exports3.string().optional().describe("Due date (YYYY-MM-DD)"),
|
|
30620
|
+
dueTime: external_exports3.string().optional().describe("Due time (HH:MM)"),
|
|
30621
|
+
scheduled: external_exports3.string().optional().describe("Scheduled publish time"),
|
|
30622
|
+
topic: external_exports3.string().optional().describe("Topic ID"),
|
|
30623
|
+
account: accountParam
|
|
30624
|
+
}
|
|
30625
|
+
}, async ({ courseId, courseworkId, title, description, type, state, maxPoints, due, dueDate, dueTime, scheduled, topic, account }) => {
|
|
30626
|
+
const args = ["classroom", "coursework", "update", courseId, courseworkId];
|
|
30627
|
+
if (title) args.push(`--title=${title}`);
|
|
30628
|
+
if (description) args.push(`--description=${description}`);
|
|
30629
|
+
if (type) args.push(`--type=${type}`);
|
|
30630
|
+
if (state) args.push(`--state=${state}`);
|
|
30631
|
+
if (maxPoints !== void 0) args.push(`--max-points=${maxPoints}`);
|
|
30632
|
+
if (due) args.push(`--due=${due}`);
|
|
30633
|
+
if (dueDate) args.push(`--due-date=${dueDate}`);
|
|
30634
|
+
if (dueTime) args.push(`--due-time=${dueTime}`);
|
|
30635
|
+
if (scheduled) args.push(`--scheduled=${scheduled}`);
|
|
30636
|
+
if (topic) args.push(`--topic=${topic}`);
|
|
30637
|
+
return runOrDiagnose(args, { account });
|
|
30638
|
+
});
|
|
30639
|
+
server.registerTool("gog_classroom_coursework_delete", {
|
|
30640
|
+
description: "Delete a coursework item.",
|
|
30641
|
+
annotations: { destructiveHint: true },
|
|
30642
|
+
inputSchema: {
|
|
30643
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30644
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30645
|
+
account: accountParam
|
|
30646
|
+
}
|
|
30647
|
+
}, async ({ courseId, courseworkId, account }) => {
|
|
30648
|
+
return runOrDiagnose(["classroom", "coursework", "delete", courseId, courseworkId], { account });
|
|
30649
|
+
});
|
|
30650
|
+
server.registerTool("gog_classroom_submissions_list", {
|
|
30651
|
+
description: "List student submissions for a coursework item.",
|
|
30652
|
+
annotations: { readOnlyHint: true },
|
|
30653
|
+
inputSchema: {
|
|
30654
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30655
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30656
|
+
state: external_exports3.string().optional().describe("Filter by submission state"),
|
|
30657
|
+
late: external_exports3.enum(["late", "not-late"]).optional().describe("Filter by late status"),
|
|
30658
|
+
user: external_exports3.string().optional().describe("Filter by student user ID"),
|
|
30659
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30660
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30661
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30662
|
+
account: accountParam
|
|
30663
|
+
}
|
|
30664
|
+
}, async ({ courseId, courseworkId, state, late: late2, user, max, page, all, account }) => {
|
|
30665
|
+
const args = ["classroom", "submissions", "list", courseId, courseworkId];
|
|
30666
|
+
if (state) args.push(`--state=${state}`);
|
|
30667
|
+
if (late2) args.push(`--late=${late2}`);
|
|
30668
|
+
if (user) args.push(`--user=${user}`);
|
|
30669
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30670
|
+
if (page) args.push(`--page=${page}`);
|
|
30671
|
+
if (all) args.push("--all");
|
|
30672
|
+
return runOrDiagnose(args, { account });
|
|
30673
|
+
});
|
|
30674
|
+
server.registerTool("gog_classroom_submissions_get", {
|
|
30675
|
+
description: "Get a single submission by ID.",
|
|
30676
|
+
annotations: { readOnlyHint: true },
|
|
30677
|
+
inputSchema: {
|
|
30678
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30679
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30680
|
+
submissionId: external_exports3.string().describe("Submission ID"),
|
|
30681
|
+
account: accountParam
|
|
30682
|
+
}
|
|
30683
|
+
}, async ({ courseId, courseworkId, submissionId, account }) => {
|
|
30684
|
+
return runOrDiagnose(["classroom", "submissions", "get", courseId, courseworkId, submissionId], { account });
|
|
30685
|
+
});
|
|
30686
|
+
server.registerTool("gog_classroom_submissions_grade", {
|
|
30687
|
+
description: "Grade a student submission. Set draft and/or assigned grade values.",
|
|
30688
|
+
annotations: { destructiveHint: true },
|
|
30689
|
+
inputSchema: {
|
|
30690
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30691
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30692
|
+
submissionId: external_exports3.string().describe("Submission ID"),
|
|
30693
|
+
draft: external_exports3.string().optional().describe("Draft grade value"),
|
|
30694
|
+
assigned: external_exports3.string().optional().describe("Assigned (final) grade value"),
|
|
30695
|
+
account: accountParam
|
|
30696
|
+
}
|
|
30697
|
+
}, async ({ courseId, courseworkId, submissionId, draft, assigned, account }) => {
|
|
30698
|
+
const args = ["classroom", "submissions", "grade", courseId, courseworkId, submissionId];
|
|
30699
|
+
if (draft) args.push(`--draft=${draft}`);
|
|
30700
|
+
if (assigned) args.push(`--assigned=${assigned}`);
|
|
30701
|
+
return runOrDiagnose(args, { account });
|
|
30702
|
+
});
|
|
30703
|
+
server.registerTool("gog_classroom_submissions_return", {
|
|
30704
|
+
description: "Return a graded submission to the student.",
|
|
30705
|
+
annotations: { destructiveHint: true },
|
|
30706
|
+
inputSchema: {
|
|
30707
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30708
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30709
|
+
submissionId: external_exports3.string().describe("Submission ID"),
|
|
30710
|
+
account: accountParam
|
|
30711
|
+
}
|
|
30712
|
+
}, async ({ courseId, courseworkId, submissionId, account }) => {
|
|
30713
|
+
return runOrDiagnose(["classroom", "submissions", "return", courseId, courseworkId, submissionId], { account });
|
|
30714
|
+
});
|
|
30715
|
+
server.registerTool("gog_classroom_submissions_turn_in", {
|
|
30716
|
+
description: "Turn in a student submission (student action).",
|
|
30717
|
+
annotations: { destructiveHint: true },
|
|
30718
|
+
inputSchema: {
|
|
30719
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30720
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30721
|
+
submissionId: external_exports3.string().describe("Submission ID"),
|
|
30722
|
+
account: accountParam
|
|
30723
|
+
}
|
|
30724
|
+
}, async ({ courseId, courseworkId, submissionId, account }) => {
|
|
30725
|
+
return runOrDiagnose(["classroom", "submissions", "turn-in", courseId, courseworkId, submissionId], { account });
|
|
30726
|
+
});
|
|
30727
|
+
server.registerTool("gog_classroom_submissions_reclaim", {
|
|
30728
|
+
description: "Reclaim a turned-in submission (student action to edit a submission).",
|
|
30729
|
+
annotations: { destructiveHint: true },
|
|
30730
|
+
inputSchema: {
|
|
30731
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30732
|
+
courseworkId: external_exports3.string().describe("Coursework ID"),
|
|
30733
|
+
submissionId: external_exports3.string().describe("Submission ID"),
|
|
30734
|
+
account: accountParam
|
|
30735
|
+
}
|
|
30736
|
+
}, async ({ courseId, courseworkId, submissionId, account }) => {
|
|
30737
|
+
return runOrDiagnose(["classroom", "submissions", "reclaim", courseId, courseworkId, submissionId], { account });
|
|
30738
|
+
});
|
|
30739
|
+
server.registerTool("gog_classroom_announcements_list", {
|
|
30740
|
+
description: "List announcements in a Google Classroom course.",
|
|
30741
|
+
annotations: { readOnlyHint: true },
|
|
30742
|
+
inputSchema: {
|
|
30743
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30744
|
+
state: external_exports3.string().optional().describe("Filter by announcement state"),
|
|
30745
|
+
orderBy: external_exports3.string().optional().describe("Sort order"),
|
|
30746
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30747
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30748
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30749
|
+
account: accountParam
|
|
30750
|
+
}
|
|
30751
|
+
}, async ({ courseId, state, orderBy, max, page, all, account }) => {
|
|
30752
|
+
const args = ["classroom", "announcements", "list", courseId];
|
|
30753
|
+
if (state) args.push(`--state=${state}`);
|
|
30754
|
+
if (orderBy) args.push(`--order-by=${orderBy}`);
|
|
30755
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30756
|
+
if (page) args.push(`--page=${page}`);
|
|
30757
|
+
if (all) args.push("--all");
|
|
30758
|
+
return runOrDiagnose(args, { account });
|
|
30759
|
+
});
|
|
30760
|
+
server.registerTool("gog_classroom_announcements_get", {
|
|
30761
|
+
description: "Get a single announcement by ID.",
|
|
30762
|
+
annotations: { readOnlyHint: true },
|
|
30763
|
+
inputSchema: {
|
|
30764
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30765
|
+
announcementId: external_exports3.string().describe("Announcement ID"),
|
|
30766
|
+
account: accountParam
|
|
30767
|
+
}
|
|
30768
|
+
}, async ({ courseId, announcementId, account }) => {
|
|
30769
|
+
return runOrDiagnose(["classroom", "announcements", "get", courseId, announcementId], { account });
|
|
30770
|
+
});
|
|
30771
|
+
server.registerTool("gog_classroom_announcements_create", {
|
|
30772
|
+
description: "Create an announcement in a Google Classroom course.",
|
|
30773
|
+
inputSchema: {
|
|
30774
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30775
|
+
text: external_exports3.string().describe("Announcement text"),
|
|
30776
|
+
state: external_exports3.string().optional().describe("State: PUBLISHED or DRAFT"),
|
|
30777
|
+
scheduled: external_exports3.string().optional().describe("Scheduled publish time"),
|
|
30778
|
+
account: accountParam
|
|
30779
|
+
}
|
|
30780
|
+
}, async ({ courseId, text, state, scheduled, account }) => {
|
|
30781
|
+
const args = ["classroom", "announcements", "create", courseId, `--text=${text}`];
|
|
30782
|
+
if (state) args.push(`--state=${state}`);
|
|
30783
|
+
if (scheduled) args.push(`--scheduled=${scheduled}`);
|
|
30784
|
+
return runOrDiagnose(args, { account });
|
|
30785
|
+
});
|
|
30786
|
+
server.registerTool("gog_classroom_announcements_update", {
|
|
30787
|
+
description: "Update an existing announcement.",
|
|
30788
|
+
annotations: { destructiveHint: true },
|
|
30789
|
+
inputSchema: {
|
|
30790
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30791
|
+
announcementId: external_exports3.string().describe("Announcement ID"),
|
|
30792
|
+
text: external_exports3.string().optional().describe("New text"),
|
|
30793
|
+
state: external_exports3.string().optional().describe("State: PUBLISHED or DRAFT"),
|
|
30794
|
+
scheduled: external_exports3.string().optional().describe("Scheduled publish time"),
|
|
30795
|
+
account: accountParam
|
|
30796
|
+
}
|
|
30797
|
+
}, async ({ courseId, announcementId, text, state, scheduled, account }) => {
|
|
30798
|
+
const args = ["classroom", "announcements", "update", courseId, announcementId];
|
|
30799
|
+
if (text) args.push(`--text=${text}`);
|
|
30800
|
+
if (state) args.push(`--state=${state}`);
|
|
30801
|
+
if (scheduled) args.push(`--scheduled=${scheduled}`);
|
|
30802
|
+
return runOrDiagnose(args, { account });
|
|
30803
|
+
});
|
|
30804
|
+
server.registerTool("gog_classroom_announcements_delete", {
|
|
30805
|
+
description: "Delete an announcement.",
|
|
30806
|
+
annotations: { destructiveHint: true },
|
|
30807
|
+
inputSchema: {
|
|
30808
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30809
|
+
announcementId: external_exports3.string().describe("Announcement ID"),
|
|
30810
|
+
account: accountParam
|
|
30811
|
+
}
|
|
30812
|
+
}, async ({ courseId, announcementId, account }) => {
|
|
30813
|
+
return runOrDiagnose(["classroom", "announcements", "delete", courseId, announcementId], { account });
|
|
30814
|
+
});
|
|
30815
|
+
server.registerTool("gog_classroom_topics_list", {
|
|
30816
|
+
description: "List topics in a Google Classroom course.",
|
|
30817
|
+
annotations: { readOnlyHint: true },
|
|
30818
|
+
inputSchema: {
|
|
30819
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30820
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30821
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30822
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30823
|
+
account: accountParam
|
|
30824
|
+
}
|
|
30825
|
+
}, async ({ courseId, max, page, all, account }) => {
|
|
30826
|
+
const args = ["classroom", "topics", "list", courseId];
|
|
30827
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30828
|
+
if (page) args.push(`--page=${page}`);
|
|
30829
|
+
if (all) args.push("--all");
|
|
30830
|
+
return runOrDiagnose(args, { account });
|
|
30831
|
+
});
|
|
30832
|
+
server.registerTool("gog_classroom_topics_get", {
|
|
30833
|
+
description: "Get a single topic by ID.",
|
|
30834
|
+
annotations: { readOnlyHint: true },
|
|
30835
|
+
inputSchema: {
|
|
30836
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30837
|
+
topicId: external_exports3.string().describe("Topic ID"),
|
|
30838
|
+
account: accountParam
|
|
30839
|
+
}
|
|
30840
|
+
}, async ({ courseId, topicId, account }) => {
|
|
30841
|
+
return runOrDiagnose(["classroom", "topics", "get", courseId, topicId], { account });
|
|
30842
|
+
});
|
|
30843
|
+
server.registerTool("gog_classroom_topics_create", {
|
|
30844
|
+
description: "Create a topic in a Google Classroom course.",
|
|
30845
|
+
inputSchema: {
|
|
30846
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30847
|
+
name: external_exports3.string().describe("Topic name"),
|
|
30848
|
+
account: accountParam
|
|
30849
|
+
}
|
|
30850
|
+
}, async ({ courseId, name, account }) => {
|
|
30851
|
+
return runOrDiagnose(["classroom", "topics", "create", courseId, `--name=${name}`], { account });
|
|
30852
|
+
});
|
|
30853
|
+
server.registerTool("gog_classroom_topics_update", {
|
|
30854
|
+
description: "Rename an existing topic.",
|
|
30855
|
+
annotations: { destructiveHint: true },
|
|
30856
|
+
inputSchema: {
|
|
30857
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30858
|
+
topicId: external_exports3.string().describe("Topic ID"),
|
|
30859
|
+
name: external_exports3.string().describe("New topic name"),
|
|
30860
|
+
account: accountParam
|
|
30861
|
+
}
|
|
30862
|
+
}, async ({ courseId, topicId, name, account }) => {
|
|
30863
|
+
return runOrDiagnose(["classroom", "topics", "update", courseId, topicId, `--name=${name}`], { account });
|
|
30864
|
+
});
|
|
30865
|
+
server.registerTool("gog_classroom_topics_delete", {
|
|
30866
|
+
description: "Delete a topic.",
|
|
30867
|
+
annotations: { destructiveHint: true },
|
|
30868
|
+
inputSchema: {
|
|
30869
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30870
|
+
topicId: external_exports3.string().describe("Topic ID"),
|
|
30871
|
+
account: accountParam
|
|
30872
|
+
}
|
|
30873
|
+
}, async ({ courseId, topicId, account }) => {
|
|
30874
|
+
return runOrDiagnose(["classroom", "topics", "delete", courseId, topicId], { account });
|
|
30875
|
+
});
|
|
30876
|
+
server.registerTool("gog_classroom_invitations_list", {
|
|
30877
|
+
description: "List Google Classroom invitations.",
|
|
30878
|
+
annotations: { readOnlyHint: true },
|
|
30879
|
+
inputSchema: {
|
|
30880
|
+
course: external_exports3.string().optional().describe("Filter by course ID"),
|
|
30881
|
+
user: external_exports3.string().optional().describe("Filter by user ID"),
|
|
30882
|
+
max: external_exports3.number().optional().describe("Max results per page"),
|
|
30883
|
+
page: external_exports3.string().optional().describe("Page token"),
|
|
30884
|
+
all: external_exports3.boolean().optional().describe("Fetch all pages"),
|
|
30885
|
+
account: accountParam
|
|
30886
|
+
}
|
|
30887
|
+
}, async ({ course, user, max, page, all, account }) => {
|
|
30888
|
+
const args = ["classroom", "invitations", "list"];
|
|
30889
|
+
if (course) args.push(`--course=${course}`);
|
|
30890
|
+
if (user) args.push(`--user=${user}`);
|
|
30891
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
30892
|
+
if (page) args.push(`--page=${page}`);
|
|
30893
|
+
if (all) args.push("--all");
|
|
30894
|
+
return runOrDiagnose(args, { account });
|
|
30895
|
+
});
|
|
30896
|
+
server.registerTool("gog_classroom_invitations_get", {
|
|
30897
|
+
description: "Get a single invitation by ID.",
|
|
30898
|
+
annotations: { readOnlyHint: true },
|
|
30899
|
+
inputSchema: {
|
|
30900
|
+
invitationId: external_exports3.string().describe("Invitation ID"),
|
|
30901
|
+
account: accountParam
|
|
30902
|
+
}
|
|
30903
|
+
}, async ({ invitationId, account }) => {
|
|
30904
|
+
return runOrDiagnose(["classroom", "invitations", "get", invitationId], { account });
|
|
30905
|
+
});
|
|
30906
|
+
server.registerTool("gog_classroom_invitations_create", {
|
|
30907
|
+
description: "Create an invitation to a Google Classroom course.",
|
|
30908
|
+
inputSchema: {
|
|
30909
|
+
courseId: external_exports3.string().describe("Course ID"),
|
|
30910
|
+
userId: external_exports3.string().describe("User ID to invite"),
|
|
30911
|
+
role: external_exports3.enum(["STUDENT", "TEACHER", "OWNER"]).describe("Role for the invited user"),
|
|
30912
|
+
account: accountParam
|
|
30913
|
+
}
|
|
30914
|
+
}, async ({ courseId, userId, role, account }) => {
|
|
30915
|
+
return runOrDiagnose(["classroom", "invitations", "create", courseId, userId, `--role=${role}`], { account });
|
|
30916
|
+
});
|
|
30917
|
+
server.registerTool("gog_classroom_invitations_accept", {
|
|
30918
|
+
description: "Accept a Google Classroom invitation.",
|
|
30919
|
+
inputSchema: {
|
|
30920
|
+
invitationId: external_exports3.string().describe("Invitation ID"),
|
|
30921
|
+
account: accountParam
|
|
30922
|
+
}
|
|
30923
|
+
}, async ({ invitationId, account }) => {
|
|
30924
|
+
return runOrDiagnose(["classroom", "invitations", "accept", invitationId], { account });
|
|
30925
|
+
});
|
|
30926
|
+
server.registerTool("gog_classroom_invitations_delete", {
|
|
30927
|
+
description: "Delete (revoke) a Google Classroom invitation.",
|
|
30928
|
+
annotations: { destructiveHint: true },
|
|
30929
|
+
inputSchema: {
|
|
30930
|
+
invitationId: external_exports3.string().describe("Invitation ID"),
|
|
30931
|
+
account: accountParam
|
|
30932
|
+
}
|
|
30933
|
+
}, async ({ invitationId, account }) => {
|
|
30934
|
+
return runOrDiagnose(["classroom", "invitations", "delete", invitationId], { account });
|
|
30935
|
+
});
|
|
30936
|
+
server.registerTool("gog_classroom_profile_get", {
|
|
30937
|
+
description: "Get a Google Classroom user profile. Omit userId to fetch the authenticated user.",
|
|
30938
|
+
annotations: { readOnlyHint: true },
|
|
30939
|
+
inputSchema: {
|
|
30940
|
+
userId: external_exports3.string().optional().describe("User ID (omit for self)"),
|
|
30941
|
+
account: accountParam
|
|
30942
|
+
}
|
|
30943
|
+
}, async ({ userId, account }) => {
|
|
30944
|
+
const args = ["classroom", "profile", "get"];
|
|
30945
|
+
if (userId) args.push(userId);
|
|
30946
|
+
return runOrDiagnose(args, { account });
|
|
30947
|
+
});
|
|
30948
|
+
server.registerTool("gog_classroom_run", {
|
|
30949
|
+
description: "Run any gog classroom subcommand not covered by the other tools (guardians, guardian-invitations, materials, coursework assignees, announcement assignees, etc.). Run `gog classroom --help` for the full list, or `gog classroom <subcommand> --help` for flags.",
|
|
30950
|
+
inputSchema: {
|
|
30951
|
+
subcommand: external_exports3.string().describe('The gog classroom subcommand to run, e.g. "guardians", "materials", "guardian-invitations"'),
|
|
30952
|
+
args: external_exports3.array(external_exports3.string()).describe("Additional positional args and flags"),
|
|
30953
|
+
account: accountParam
|
|
30954
|
+
}
|
|
30955
|
+
}, async ({ subcommand, args, account }) => {
|
|
30956
|
+
return runOrDiagnose(["classroom", subcommand, ...args], { account });
|
|
30957
|
+
});
|
|
30958
|
+
}
|
|
30959
|
+
|
|
30306
30960
|
// src/tools/contacts.ts
|
|
30307
30961
|
function registerContactsTools(server) {
|
|
30308
30962
|
server.registerTool("gog_contacts_search", {
|
|
@@ -30455,11 +31109,19 @@ function registerDriveTools(server) {
|
|
|
30455
31109
|
annotations: { readOnlyHint: true },
|
|
30456
31110
|
inputSchema: {
|
|
30457
31111
|
folderId: external_exports3.string().optional().describe("Folder ID to list (default: root)"),
|
|
31112
|
+
max: external_exports3.number().optional().describe("Max results (default: 20)"),
|
|
31113
|
+
page: external_exports3.string().optional().describe("Page token for pagination"),
|
|
31114
|
+
query: external_exports3.string().optional().describe(`Drive query filter (e.g. "name contains 'budget'")`),
|
|
31115
|
+
allDrives: external_exports3.boolean().optional().describe("Include shared drives (default: true). Set false for My Drive only."),
|
|
30458
31116
|
account: accountParam
|
|
30459
31117
|
}
|
|
30460
|
-
}, async ({ folderId, account }) => {
|
|
31118
|
+
}, async ({ folderId, max, page, query, allDrives, account }) => {
|
|
30461
31119
|
const args = ["drive", "ls"];
|
|
30462
|
-
if (folderId) args.push(folderId);
|
|
31120
|
+
if (folderId) args.push(`--parent=${folderId}`);
|
|
31121
|
+
if (max !== void 0) args.push(`--max=${max}`);
|
|
31122
|
+
if (page) args.push(`--page=${page}`);
|
|
31123
|
+
if (query) args.push(`--query=${query}`);
|
|
31124
|
+
if (allDrives === false) args.push("--no-all-drives");
|
|
30463
31125
|
return runOrDiagnose(args, { account });
|
|
30464
31126
|
});
|
|
30465
31127
|
server.registerTool("gog_drive_search", {
|
|
@@ -30515,14 +31177,17 @@ function registerDriveTools(server) {
|
|
|
30515
31177
|
return runOrDiagnose(["drive", "move", fileId, `--parent=${parentId}`], { account });
|
|
30516
31178
|
});
|
|
30517
31179
|
server.registerTool("gog_drive_delete", {
|
|
30518
|
-
description: "Move a Google Drive file to trash.",
|
|
31180
|
+
description: "Move a Google Drive file to trash, or permanently delete it with permanent=true (irreversible).",
|
|
30519
31181
|
annotations: { destructiveHint: true },
|
|
30520
31182
|
inputSchema: {
|
|
30521
|
-
fileId: external_exports3.string().describe("File ID to
|
|
31183
|
+
fileId: external_exports3.string().describe("File ID to delete"),
|
|
31184
|
+
permanent: external_exports3.boolean().optional().describe("Permanently delete instead of moving to trash (irreversible)"),
|
|
30522
31185
|
account: accountParam
|
|
30523
31186
|
}
|
|
30524
|
-
}, async ({ fileId, account }) => {
|
|
30525
|
-
|
|
31187
|
+
}, async ({ fileId, permanent, account }) => {
|
|
31188
|
+
const args = ["drive", "delete", fileId];
|
|
31189
|
+
if (permanent) args.push("--permanent");
|
|
31190
|
+
return runOrDiagnose(args, { account });
|
|
30526
31191
|
});
|
|
30527
31192
|
server.registerTool("gog_drive_share", {
|
|
30528
31193
|
description: "Share a Google Drive file or folder.",
|
|
@@ -30716,6 +31381,195 @@ function registerSheetsTools(server) {
|
|
|
30716
31381
|
});
|
|
30717
31382
|
}
|
|
30718
31383
|
|
|
31384
|
+
// src/tools/slides.ts
|
|
31385
|
+
function registerSlidesTools(server) {
|
|
31386
|
+
server.registerTool("gog_slides_export", {
|
|
31387
|
+
description: "Export a Google Slides presentation to a local file (pdf or pptx).",
|
|
31388
|
+
annotations: { readOnlyHint: true },
|
|
31389
|
+
inputSchema: {
|
|
31390
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31391
|
+
out: external_exports3.string().optional().describe("Output file path"),
|
|
31392
|
+
format: external_exports3.enum(["pdf", "pptx"]).optional().describe("Export format (default: pptx)"),
|
|
31393
|
+
account: accountParam
|
|
31394
|
+
}
|
|
31395
|
+
}, async ({ presentationId, out, format, account }) => {
|
|
31396
|
+
const args = ["slides", "export", presentationId];
|
|
31397
|
+
if (out) args.push(`--out=${out}`);
|
|
31398
|
+
if (format) args.push(`--format=${format}`);
|
|
31399
|
+
return runOrDiagnose(args, { account });
|
|
31400
|
+
});
|
|
31401
|
+
server.registerTool("gog_slides_info", {
|
|
31402
|
+
description: "Get metadata for a Google Slides presentation (title, ID, slide count, etc.).",
|
|
31403
|
+
annotations: { readOnlyHint: true },
|
|
31404
|
+
inputSchema: {
|
|
31405
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31406
|
+
account: accountParam
|
|
31407
|
+
}
|
|
31408
|
+
}, async ({ presentationId, account }) => {
|
|
31409
|
+
return runOrDiagnose(["slides", "info", presentationId], { account });
|
|
31410
|
+
});
|
|
31411
|
+
server.registerTool("gog_slides_create", {
|
|
31412
|
+
description: "Create a new Google Slides presentation, optionally in a folder or copying from a template.",
|
|
31413
|
+
inputSchema: {
|
|
31414
|
+
title: external_exports3.string().describe("Presentation title"),
|
|
31415
|
+
parent: external_exports3.string().optional().describe("Destination folder ID"),
|
|
31416
|
+
template: external_exports3.string().optional().describe("Template presentation ID to copy from"),
|
|
31417
|
+
account: accountParam
|
|
31418
|
+
}
|
|
31419
|
+
}, async ({ title, parent, template, account }) => {
|
|
31420
|
+
const args = ["slides", "create", title];
|
|
31421
|
+
if (parent) args.push(`--parent=${parent}`);
|
|
31422
|
+
if (template) args.push(`--template=${template}`);
|
|
31423
|
+
return runOrDiagnose(args, { account });
|
|
31424
|
+
});
|
|
31425
|
+
server.registerTool("gog_slides_create_from_markdown", {
|
|
31426
|
+
description: "Create a new Google Slides presentation from markdown content (inline or from a file).",
|
|
31427
|
+
inputSchema: {
|
|
31428
|
+
title: external_exports3.string().describe("Presentation title"),
|
|
31429
|
+
content: external_exports3.string().optional().describe("Inline markdown content"),
|
|
31430
|
+
contentFile: external_exports3.string().optional().describe("Path to a markdown file"),
|
|
31431
|
+
parent: external_exports3.string().optional().describe("Destination folder ID"),
|
|
31432
|
+
debug: external_exports3.boolean().optional().describe("Enable debug output"),
|
|
31433
|
+
account: accountParam
|
|
31434
|
+
}
|
|
31435
|
+
}, async ({ title, content, contentFile, parent, debug, account }) => {
|
|
31436
|
+
const args = ["slides", "create-from-markdown", title];
|
|
31437
|
+
if (content) args.push(`--content=${content}`);
|
|
31438
|
+
if (contentFile) args.push(`--content-file=${contentFile}`);
|
|
31439
|
+
if (parent) args.push(`--parent=${parent}`);
|
|
31440
|
+
if (debug) args.push("--debug");
|
|
31441
|
+
return runOrDiagnose(args, { account });
|
|
31442
|
+
});
|
|
31443
|
+
server.registerTool("gog_slides_create_from_template", {
|
|
31444
|
+
description: "Create a new Google Slides presentation from a template, with optional placeholder replacements.",
|
|
31445
|
+
inputSchema: {
|
|
31446
|
+
templateId: external_exports3.string().describe("Template presentation ID"),
|
|
31447
|
+
title: external_exports3.string().describe("New presentation title"),
|
|
31448
|
+
replacements: external_exports3.record(external_exports3.string(), external_exports3.string()).optional().describe("Placeholder replacements as a key/value object (emitted as --replace=k=v for each entry)"),
|
|
31449
|
+
replacementsFile: external_exports3.string().optional().describe("Path to a JSON file containing replacements"),
|
|
31450
|
+
parent: external_exports3.string().optional().describe("Destination folder ID"),
|
|
31451
|
+
exact: external_exports3.boolean().optional().describe("Require exact placeholder matches"),
|
|
31452
|
+
account: accountParam
|
|
31453
|
+
}
|
|
31454
|
+
}, async ({ templateId, title, replacements, replacementsFile, parent, exact, account }) => {
|
|
31455
|
+
const args = ["slides", "create-from-template", templateId, title];
|
|
31456
|
+
if (replacements) {
|
|
31457
|
+
for (const [k, v] of Object.entries(replacements)) {
|
|
31458
|
+
args.push(`--replace=${k}=${v}`);
|
|
31459
|
+
}
|
|
31460
|
+
}
|
|
31461
|
+
if (replacementsFile) args.push(`--replacements=${replacementsFile}`);
|
|
31462
|
+
if (parent) args.push(`--parent=${parent}`);
|
|
31463
|
+
if (exact) args.push("--exact");
|
|
31464
|
+
return runOrDiagnose(args, { account });
|
|
31465
|
+
});
|
|
31466
|
+
server.registerTool("gog_slides_copy", {
|
|
31467
|
+
description: "Copy a Google Slides presentation to a new presentation with the given title.",
|
|
31468
|
+
inputSchema: {
|
|
31469
|
+
presentationId: external_exports3.string().describe("Presentation ID to copy"),
|
|
31470
|
+
title: external_exports3.string().describe("Title for the new copy"),
|
|
31471
|
+
parent: external_exports3.string().optional().describe("Destination folder ID"),
|
|
31472
|
+
account: accountParam
|
|
31473
|
+
}
|
|
31474
|
+
}, async ({ presentationId, title, parent, account }) => {
|
|
31475
|
+
const args = ["slides", "copy", presentationId, title];
|
|
31476
|
+
if (parent) args.push(`--parent=${parent}`);
|
|
31477
|
+
return runOrDiagnose(args, { account });
|
|
31478
|
+
});
|
|
31479
|
+
server.registerTool("gog_slides_add_slide", {
|
|
31480
|
+
description: "Add a new slide to a presentation from a local image, with optional speaker notes.",
|
|
31481
|
+
inputSchema: {
|
|
31482
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31483
|
+
image: external_exports3.string().describe("Path to the local image file"),
|
|
31484
|
+
notes: external_exports3.string().optional().describe("Speaker notes text"),
|
|
31485
|
+
notesFile: external_exports3.string().optional().describe("Path to a file containing speaker notes"),
|
|
31486
|
+
before: external_exports3.string().optional().describe("Insert before this slide ID (default: append at end)"),
|
|
31487
|
+
account: accountParam
|
|
31488
|
+
}
|
|
31489
|
+
}, async ({ presentationId, image, notes, notesFile, before, account }) => {
|
|
31490
|
+
const args = ["slides", "add-slide", presentationId, image];
|
|
31491
|
+
if (notes) args.push(`--notes=${notes}`);
|
|
31492
|
+
if (notesFile) args.push(`--notes-file=${notesFile}`);
|
|
31493
|
+
if (before) args.push(`--before=${before}`);
|
|
31494
|
+
return runOrDiagnose(args, { account });
|
|
31495
|
+
});
|
|
31496
|
+
server.registerTool("gog_slides_list_slides", {
|
|
31497
|
+
description: "List slides in a Google Slides presentation.",
|
|
31498
|
+
annotations: { readOnlyHint: true },
|
|
31499
|
+
inputSchema: {
|
|
31500
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31501
|
+
account: accountParam
|
|
31502
|
+
}
|
|
31503
|
+
}, async ({ presentationId, account }) => {
|
|
31504
|
+
return runOrDiagnose(["slides", "list-slides", presentationId], { account });
|
|
31505
|
+
});
|
|
31506
|
+
server.registerTool("gog_slides_delete_slide", {
|
|
31507
|
+
description: "Delete a slide from a Google Slides presentation.",
|
|
31508
|
+
annotations: { destructiveHint: true },
|
|
31509
|
+
inputSchema: {
|
|
31510
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31511
|
+
slideId: external_exports3.string().describe("Slide ID to delete"),
|
|
31512
|
+
account: accountParam
|
|
31513
|
+
}
|
|
31514
|
+
}, async ({ presentationId, slideId, account }) => {
|
|
31515
|
+
return runOrDiagnose(["slides", "delete-slide", presentationId, slideId], { account });
|
|
31516
|
+
});
|
|
31517
|
+
server.registerTool("gog_slides_read_slide", {
|
|
31518
|
+
description: "Read the content of a slide (text, shapes, speaker notes).",
|
|
31519
|
+
annotations: { readOnlyHint: true },
|
|
31520
|
+
inputSchema: {
|
|
31521
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31522
|
+
slideId: external_exports3.string().describe("Slide ID to read"),
|
|
31523
|
+
account: accountParam
|
|
31524
|
+
}
|
|
31525
|
+
}, async ({ presentationId, slideId, account }) => {
|
|
31526
|
+
return runOrDiagnose(["slides", "read-slide", presentationId, slideId], { account });
|
|
31527
|
+
});
|
|
31528
|
+
server.registerTool("gog_slides_update_notes", {
|
|
31529
|
+
description: "Update the speaker notes on a slide (inline text or from a file).",
|
|
31530
|
+
annotations: { destructiveHint: true },
|
|
31531
|
+
inputSchema: {
|
|
31532
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31533
|
+
slideId: external_exports3.string().describe("Slide ID"),
|
|
31534
|
+
notes: external_exports3.string().optional().describe("New speaker notes text"),
|
|
31535
|
+
notesFile: external_exports3.string().optional().describe("Path to a file containing new speaker notes"),
|
|
31536
|
+
account: accountParam
|
|
31537
|
+
}
|
|
31538
|
+
}, async ({ presentationId, slideId, notes, notesFile, account }) => {
|
|
31539
|
+
const args = ["slides", "update-notes", presentationId, slideId];
|
|
31540
|
+
if (notes) args.push(`--notes=${notes}`);
|
|
31541
|
+
if (notesFile) args.push(`--notes-file=${notesFile}`);
|
|
31542
|
+
return runOrDiagnose(args, { account });
|
|
31543
|
+
});
|
|
31544
|
+
server.registerTool("gog_slides_replace_slide", {
|
|
31545
|
+
description: "Replace the image content of an existing slide, with optional speaker notes.",
|
|
31546
|
+
annotations: { destructiveHint: true },
|
|
31547
|
+
inputSchema: {
|
|
31548
|
+
presentationId: external_exports3.string().describe("Presentation ID"),
|
|
31549
|
+
slideId: external_exports3.string().describe("Slide ID to replace"),
|
|
31550
|
+
image: external_exports3.string().describe("Path to the new local image file"),
|
|
31551
|
+
notes: external_exports3.string().optional().describe("Speaker notes text"),
|
|
31552
|
+
notesFile: external_exports3.string().optional().describe("Path to a file containing speaker notes"),
|
|
31553
|
+
account: accountParam
|
|
31554
|
+
}
|
|
31555
|
+
}, async ({ presentationId, slideId, image, notes, notesFile, account }) => {
|
|
31556
|
+
const args = ["slides", "replace-slide", presentationId, slideId, image];
|
|
31557
|
+
if (notes) args.push(`--notes=${notes}`);
|
|
31558
|
+
if (notesFile) args.push(`--notes-file=${notesFile}`);
|
|
31559
|
+
return runOrDiagnose(args, { account });
|
|
31560
|
+
});
|
|
31561
|
+
server.registerTool("gog_slides_run", {
|
|
31562
|
+
description: "Run any gog slides subcommand not covered by the other tools. Run `gog slides --help` for the full list of subcommands, or `gog slides <subcommand> --help` for flags on a specific subcommand.",
|
|
31563
|
+
inputSchema: {
|
|
31564
|
+
subcommand: external_exports3.string().describe("The gog slides subcommand to run"),
|
|
31565
|
+
args: external_exports3.array(external_exports3.string()).describe("Additional positional args and flags"),
|
|
31566
|
+
account: accountParam
|
|
31567
|
+
}
|
|
31568
|
+
}, async ({ subcommand, args, account }) => {
|
|
31569
|
+
return runOrDiagnose(["slides", subcommand, ...args], { account });
|
|
31570
|
+
});
|
|
31571
|
+
}
|
|
31572
|
+
|
|
30719
31573
|
// src/tools/tasks.ts
|
|
30720
31574
|
function registerTasksTools(server) {
|
|
30721
31575
|
server.registerTool("gog_tasks_lists", {
|
|
@@ -30800,7 +31654,7 @@ function registerTasksTools(server) {
|
|
|
30800
31654
|
}
|
|
30801
31655
|
|
|
30802
31656
|
// src/server.ts
|
|
30803
|
-
var VERSION = true ? "2.0.
|
|
31657
|
+
var VERSION = true ? "2.0.2" : "0.0.0";
|
|
30804
31658
|
function createServer(options) {
|
|
30805
31659
|
return new McpServer({
|
|
30806
31660
|
name: options?.name ?? "gogcli",
|
|
@@ -30811,11 +31665,13 @@ function createBaseServer(options) {
|
|
|
30811
31665
|
const server = createServer(options);
|
|
30812
31666
|
registerAuthTools(server);
|
|
30813
31667
|
registerCalendarTools(server);
|
|
31668
|
+
registerClassroomTools(server);
|
|
30814
31669
|
registerContactsTools(server);
|
|
30815
31670
|
registerDocsTools(server);
|
|
30816
31671
|
registerDriveTools(server);
|
|
30817
31672
|
registerGmailTools(server);
|
|
30818
31673
|
registerSheetsTools(server);
|
|
31674
|
+
registerSlidesTools(server);
|
|
30819
31675
|
registerTasksTools(server);
|
|
30820
31676
|
return server;
|
|
30821
31677
|
}
|
|
@@ -30826,11 +31682,13 @@ export {
|
|
|
30826
31682
|
createServer,
|
|
30827
31683
|
registerAuthTools,
|
|
30828
31684
|
registerCalendarTools,
|
|
31685
|
+
registerClassroomTools,
|
|
30829
31686
|
registerContactsTools,
|
|
30830
31687
|
registerDocsTools,
|
|
30831
31688
|
registerDriveTools,
|
|
30832
31689
|
registerGmailTools,
|
|
30833
31690
|
registerSheetsTools,
|
|
31691
|
+
registerSlidesTools,
|
|
30834
31692
|
registerTasksTools,
|
|
30835
31693
|
run,
|
|
30836
31694
|
runOrDiagnose,
|