@doist/todoist-ai 5.0.2 → 5.1.0

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 (55) hide show
  1. package/dist/index.d.ts +23 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -2
  4. package/dist/main.js +1 -1
  5. package/dist/mcp-helpers.d.ts.map +1 -1
  6. package/dist/{mcp-server-CfGS_wEm.js → mcp-server-BHGnG8l8.js} +307 -273
  7. package/dist/todoist-tool.d.ts +15 -1
  8. package/dist/todoist-tool.d.ts.map +1 -1
  9. package/dist/tools/add-comments.d.ts +1 -0
  10. package/dist/tools/add-comments.d.ts.map +1 -1
  11. package/dist/tools/add-projects.d.ts +1 -0
  12. package/dist/tools/add-projects.d.ts.map +1 -1
  13. package/dist/tools/add-sections.d.ts +1 -0
  14. package/dist/tools/add-sections.d.ts.map +1 -1
  15. package/dist/tools/add-tasks.d.ts +1 -0
  16. package/dist/tools/add-tasks.d.ts.map +1 -1
  17. package/dist/tools/complete-tasks.d.ts +1 -0
  18. package/dist/tools/complete-tasks.d.ts.map +1 -1
  19. package/dist/tools/delete-object.d.ts +1 -0
  20. package/dist/tools/delete-object.d.ts.map +1 -1
  21. package/dist/tools/fetch.d.ts +1 -0
  22. package/dist/tools/fetch.d.ts.map +1 -1
  23. package/dist/tools/find-activity.d.ts +1 -0
  24. package/dist/tools/find-activity.d.ts.map +1 -1
  25. package/dist/tools/find-comments.d.ts +1 -0
  26. package/dist/tools/find-comments.d.ts.map +1 -1
  27. package/dist/tools/find-completed-tasks.d.ts +1 -0
  28. package/dist/tools/find-completed-tasks.d.ts.map +1 -1
  29. package/dist/tools/find-project-collaborators.d.ts +1 -0
  30. package/dist/tools/find-project-collaborators.d.ts.map +1 -1
  31. package/dist/tools/find-projects.d.ts +1 -0
  32. package/dist/tools/find-projects.d.ts.map +1 -1
  33. package/dist/tools/find-sections.d.ts +1 -0
  34. package/dist/tools/find-sections.d.ts.map +1 -1
  35. package/dist/tools/find-tasks-by-date.d.ts +1 -0
  36. package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
  37. package/dist/tools/find-tasks.d.ts +1 -0
  38. package/dist/tools/find-tasks.d.ts.map +1 -1
  39. package/dist/tools/get-overview.d.ts +1 -0
  40. package/dist/tools/get-overview.d.ts.map +1 -1
  41. package/dist/tools/manage-assignments.d.ts +1 -0
  42. package/dist/tools/manage-assignments.d.ts.map +1 -1
  43. package/dist/tools/search.d.ts +1 -0
  44. package/dist/tools/search.d.ts.map +1 -1
  45. package/dist/tools/update-comments.d.ts +1 -0
  46. package/dist/tools/update-comments.d.ts.map +1 -1
  47. package/dist/tools/update-projects.d.ts +1 -0
  48. package/dist/tools/update-projects.d.ts.map +1 -1
  49. package/dist/tools/update-sections.d.ts +1 -0
  50. package/dist/tools/update-sections.d.ts.map +1 -1
  51. package/dist/tools/update-tasks.d.ts +1 -0
  52. package/dist/tools/update-tasks.d.ts.map +1 -1
  53. package/dist/tools/user-info.d.ts +1 -0
  54. package/dist/tools/user-info.d.ts.map +1 -1
  55. package/package.json +1 -1
@@ -42,6 +42,16 @@ function _e(e) {
42
42
  isError: !0
43
43
  };
44
44
  }
45
+ function Ne(e) {
46
+ switch (e) {
47
+ case "readonly":
48
+ return { readOnlyHint: !0, destructiveHint: !1 };
49
+ case "additive":
50
+ return { readOnlyHint: !1, destructiveHint: !1 };
51
+ case "mutating":
52
+ return { readOnlyHint: !1, destructiveHint: !0 };
53
+ }
54
+ }
45
55
  function I(e, t, o) {
46
56
  const n = async (r, i) => {
47
57
  try {
@@ -61,7 +71,8 @@ function I(e, t, o) {
61
71
  {
62
72
  description: e.description,
63
73
  inputSchema: e.parameters,
64
- outputSchema: e.outputSchema
74
+ outputSchema: e.outputSchema,
75
+ annotations: Ne(e.mutability)
65
76
  },
66
77
  n
67
78
  );
@@ -134,22 +145,22 @@ function ge(e) {
134
145
  throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
135
146
  return { minutes: n };
136
147
  }
137
- function Ne(e) {
148
+ function Me(e) {
138
149
  if (e <= 0) return "0m";
139
150
  const t = Math.floor(e / 60), o = e % 60;
140
151
  return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
141
152
  }
142
- const Me = ["p1", "p2", "p3", "p4"], Q = s.enum(Me, {
153
+ const Fe = ["p1", "p2", "p3", "p4"], Q = s.enum(Fe, {
143
154
  description: "Task priority: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)"
144
155
  });
145
156
  function Te(e) {
146
157
  return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
147
158
  }
148
- function Fe(e) {
159
+ function Re(e) {
149
160
  return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
150
161
  }
151
162
  const A = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), q = 300 * 1e3;
152
- class Re {
163
+ class Le {
153
164
  /**
154
165
  * Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
155
166
  * Supports exact name matches, partial matches, and email matches.
@@ -254,25 +265,25 @@ class Re {
254
265
  A.clear(), R.clear();
255
266
  }
256
267
  }
257
- const _ = new Re();
258
- async function Le(e, t) {
268
+ const _ = new Le();
269
+ async function Be(e, t) {
259
270
  return _.resolveUser(e, t);
260
271
  }
261
272
  const ye = ["assigned", "unassignedOrMe", "all"];
262
273
  async function ee(e, t) {
263
274
  if (!t)
264
275
  return;
265
- const o = await Le(e, t);
276
+ const o = await Be(e, t);
266
277
  if (!o)
267
278
  throw new Error(
268
279
  `Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
269
280
  );
270
281
  return { userId: o.userId, email: o.email };
271
282
  }
272
- function K(e, t) {
283
+ function z(e, t) {
273
284
  return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
274
285
  }
275
- function Be({
286
+ function We({
276
287
  resolvedAssigneeId: e,
277
288
  assigneeEmail: t,
278
289
  responsibleUserFiltering: o = "unassignedOrMe"
@@ -309,14 +320,14 @@ async function ke(e) {
309
320
  limit: S.PROJECTS_MAX
310
321
  });
311
322
  }
312
- async function We(e, t) {
323
+ async function Ye(e, t) {
313
324
  return Ie({
314
325
  apiMethod: (o) => e.getSections(o),
315
326
  args: t ? { projectId: t } : {},
316
327
  limit: S.SECTIONS_MAX
317
328
  });
318
329
  }
319
- function Ye(e, t, o, n) {
330
+ function He(e, t, o, n) {
320
331
  const r = [t, o, n].filter(Boolean);
321
332
  if (r.length > 1)
322
333
  throw new Error(
@@ -339,12 +350,12 @@ function O(e) {
339
350
  dueDate: e.due?.date,
340
351
  recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
341
352
  deadlineDate: e.deadline?.date,
342
- priority: Fe(e.priority) ?? "p4",
353
+ priority: Re(e.priority) ?? "p4",
343
354
  projectId: e.projectId,
344
355
  sectionId: e.sectionId ?? void 0,
345
356
  parentId: e.parentId ?? void 0,
346
357
  labels: e.labels,
347
- duration: e.duration ? Ne(e.duration.amount) : void 0,
358
+ duration: e.duration ? Me(e.duration.amount) : void 0,
348
359
  responsibleUid: e.responsibleUid ?? void 0,
349
360
  assignedByUid: e.assignedByUid ?? void 0,
350
361
  checked: e.checked,
@@ -458,7 +469,7 @@ const W = s.object({
458
469
  }), ne = s.object({
459
470
  id: s.string().describe("The unique ID of the section."),
460
471
  name: s.string().describe("The name of the section.")
461
- }), He = s.object({
472
+ }), Ve = s.object({
462
473
  resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
463
474
  fileName: s.string().optional().describe("The name of the file."),
464
475
  fileSize: s.number().optional().describe("The size of the file in bytes."),
@@ -478,8 +489,8 @@ const W = s.object({
478
489
  content: s.string().describe("The content of the comment."),
479
490
  postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
480
491
  postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
481
- fileAttachment: He.optional().describe("File attachment information, if any.")
482
- }), Ve = s.object({
492
+ fileAttachment: Ve.optional().describe("File attachment information, if any.")
493
+ }), Ge = s.object({
483
494
  id: s.string().optional().describe("The unique ID of the activity event."),
484
495
  objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
485
496
  objectId: s.string().describe("The ID of the object this event relates to."),
@@ -489,11 +500,11 @@ const W = s.object({
489
500
  parentItemId: s.string().optional().describe("The ID of the parent item."),
490
501
  initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
491
502
  extraData: s.record(s.unknown()).optional().describe("Additional event data.")
492
- }), Ge = s.object({
503
+ }), qe = s.object({
493
504
  id: s.string().describe("The unique ID of the user."),
494
505
  name: s.string().describe("The full name of the user."),
495
506
  email: s.string().describe("The email address of the user.")
496
- }), qe = s.object({
507
+ }), Je = s.object({
497
508
  item: s.string().describe("The item that failed (usually an ID or identifier)."),
498
509
  error: s.string().describe("The error message."),
499
510
  code: s.string().optional().describe("The error code, if available.")
@@ -529,23 +540,24 @@ const W = s.object({
529
540
  // OpenAI MCP tools
530
541
  SEARCH: "search",
531
542
  FETCH: "fetch"
532
- }, Je = s.object({
543
+ }, Xe = s.object({
533
544
  taskId: s.string().optional().describe("The ID of the task to comment on."),
534
545
  projectId: s.string().optional().describe(
535
546
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
536
547
  ),
537
548
  content: s.string().min(1).describe("The content of the comment.")
538
- }), Xe = {
539
- comments: s.array(Je).min(1).describe("The array of comments to add.")
540
- }, Ze = {
549
+ }), Ze = {
550
+ comments: s.array(Xe).min(1).describe("The array of comments to add.")
551
+ }, Qe = {
541
552
  comments: s.array(re).describe("The created comments."),
542
553
  totalCount: s.number().describe("The total number of comments created."),
543
554
  addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
544
- }, Qe = {
555
+ }, et = {
545
556
  name: g.ADD_COMMENTS,
546
557
  description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
547
- parameters: Xe,
548
- outputSchema: Ze,
558
+ parameters: Ze,
559
+ outputSchema: Qe,
560
+ mutability: "additive",
549
561
  async execute(e, t) {
550
562
  const { comments: o } = e;
551
563
  for (const [l, u] of o.entries()) {
@@ -566,7 +578,7 @@ const W = s.object({
566
578
  });
567
579
  }), a = (await Promise.all(i)).map(te);
568
580
  return {
569
- textContent: et({ comments: a }),
581
+ textContent: tt({ comments: a }),
570
582
  structuredContent: {
571
583
  comments: a,
572
584
  totalCount: a.length,
@@ -575,7 +587,7 @@ const W = s.object({
575
587
  };
576
588
  }
577
589
  };
578
- function et({ comments: e }) {
590
+ function tt({ comments: e }) {
579
591
  const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, n = [];
580
592
  if (t > 0) {
581
593
  const i = t > 1 ? "comments" : "comment";
@@ -587,23 +599,24 @@ function et({ comments: e }) {
587
599
  }
588
600
  return n.length > 0 ? `Added ${n.join(" and ")}` : "No comments added";
589
601
  }
590
- const tt = s.object({
602
+ const st = s.object({
591
603
  name: s.string().min(1).describe("The name of the project."),
592
604
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
593
605
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
594
606
  viewStyle: s.enum(["list", "board", "calendar"]).optional().describe('The project view style. Defaults to "list".')
595
- }), st = {
596
- projects: s.array(tt).min(1).describe("The array of projects to add.")
597
- }, ot = {
607
+ }), ot = {
608
+ projects: s.array(st).min(1).describe("The array of projects to add.")
609
+ }, nt = {
598
610
  projects: s.array(oe).describe("The created projects."),
599
611
  totalCount: s.number().describe("The total number of projects created.")
600
- }, nt = {
612
+ }, rt = {
601
613
  name: g.ADD_PROJECTS,
602
614
  description: "Add one or more new projects.",
603
- parameters: st,
604
- outputSchema: ot,
615
+ parameters: ot,
616
+ outputSchema: nt,
617
+ mutability: "additive",
605
618
  async execute({ projects: e }, t) {
606
- const o = await Promise.all(e.map((i) => t.addProject(i))), n = rt({ projects: o }), r = o.map((i) => ({
619
+ const o = await Promise.all(e.map((i) => t.addProject(i))), n = it({ projects: o }), r = o.map((i) => ({
607
620
  ...i,
608
621
  parentId: "parentId" in i ? i.parentId ?? void 0 : void 0,
609
622
  inboxProject: "inboxProject" in i ? i.inboxProject : !1
@@ -617,27 +630,28 @@ const tt = s.object({
617
630
  };
618
631
  }
619
632
  };
620
- function rt({ projects: e }) {
633
+ function it({ projects: e }) {
621
634
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
622
635
  `);
623
636
  return `Added ${t} project${t === 1 ? "" : "s"}:
624
637
  ${o}`;
625
638
  }
626
- const it = s.object({
639
+ const at = s.object({
627
640
  name: s.string().min(1).describe("The name of the section."),
628
641
  projectId: s.string().min(1).describe(
629
642
  'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
630
643
  )
631
- }), at = {
632
- sections: s.array(it).min(1).describe("The array of sections to add.")
633
- }, ct = {
644
+ }), ct = {
645
+ sections: s.array(at).min(1).describe("The array of sections to add.")
646
+ }, dt = {
634
647
  sections: s.array(ne).describe("The created sections."),
635
648
  totalCount: s.number().describe("The total number of sections created.")
636
- }, dt = {
649
+ }, lt = {
637
650
  name: g.ADD_SECTIONS,
638
651
  description: "Add one or more new sections to projects.",
639
- parameters: at,
640
- outputSchema: ct,
652
+ parameters: ct,
653
+ outputSchema: dt,
654
+ mutability: "additive",
641
655
  async execute({ sections: e }, t) {
642
656
  const n = e.some((a) => a.projectId === "inbox") ? await t.getUser() : null, r = e.map((a) => ({
643
657
  ...a,
@@ -646,7 +660,7 @@ const it = s.object({
646
660
  r.map((a) => t.addSection(a))
647
661
  );
648
662
  return {
649
- textContent: lt({ sections: i }),
663
+ textContent: ut({ sections: i }),
650
664
  structuredContent: {
651
665
  sections: i,
652
666
  totalCount: i.length
@@ -654,7 +668,7 @@ const it = s.object({
654
668
  };
655
669
  }
656
670
  };
657
- function lt({ sections: e }) {
671
+ function ut({ sections: e }) {
658
672
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id}, projectId=${r.projectId})`).join(`
659
673
  `);
660
674
  return `Added ${t} section${t === 1 ? "" : "s"}:
@@ -669,7 +683,7 @@ const L = {
669
683
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
670
684
  TASK_NOT_FOUND: "TASK_NOT_FOUND"
671
685
  };
672
- class ut {
686
+ class pt {
673
687
  /**
674
688
  * Validate a single assignment operation
675
689
  */
@@ -878,8 +892,8 @@ class ut {
878
892
  };
879
893
  }
880
894
  }
881
- const ie = new ut();
882
- function pt(e = /* @__PURE__ */ new Date()) {
895
+ const ie = new pt();
896
+ function ht(e = /* @__PURE__ */ new Date()) {
883
897
  return e.toISOString().split("T")[0] ?? "";
884
898
  }
885
899
  function je(e, t, o = {}) {
@@ -887,7 +901,7 @@ function je(e, t, o = {}) {
887
901
  c.push(d);
888
902
  const l = 5;
889
903
  if (r || i <= l) {
890
- const u = H(t, l);
904
+ const u = K(t, l);
891
905
  if (u.length > 0) {
892
906
  const p = i > l ? `, +${i - l} more` : "";
893
907
  c.push(`Tasks:
@@ -897,7 +911,7 @@ ${u}${p}.`);
897
911
  return c.join(`
898
912
  `);
899
913
  }
900
- function ht(e) {
914
+ function mt(e) {
901
915
  const { action: t, success: o, total: n, successItems: r, failures: i } = e, c = [], a = `${t}: ${o}/${n} successful.`;
902
916
  if (c.push(a), r?.length && r.length <= 5 && c.push(`Completed:
903
917
  ${r.map((d) => ` ${d}`).join(`
@@ -912,16 +926,16 @@ ${i.slice(0, G.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}$
912
926
  return c.join(`
913
927
  `);
914
928
  }
915
- function mt(e) {
929
+ function ft(e) {
916
930
  const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", n = e.priority ? ` • ${e.priority.toUpperCase()}` : "", r = e.projectName ? ` • ${e.projectName}` : "", i = e.id ? ` • id=${e.id}` : "";
917
931
  return ` ${t}${o}${n}${r}${i}`;
918
932
  }
919
- function ft(e) {
933
+ function bt(e) {
920
934
  const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", n = e.isShared ? " • Shared" : "", r = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
921
935
  return ` ${e.name}${t}${o}${n}${r}${i}`;
922
936
  }
923
- function H(e, t = 5) {
924
- const n = e.slice(0, t).map(mt).join(`
937
+ function K(e, t = 5) {
938
+ const n = e.slice(0, t).map(ft).join(`
925
939
  `);
926
940
  if (e.length > t) {
927
941
  const r = e.length - t;
@@ -951,7 +965,7 @@ function ve(e, t) {
951
965
  ${o.map((r) => `- ${r}`).join(`
952
966
  `)}`;
953
967
  }
954
- const bt = s.object({
968
+ const gt = s.object({
955
969
  content: s.string().min(1).describe(
956
970
  'The task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
957
971
  ),
@@ -977,20 +991,21 @@ const bt = s.object({
977
991
  responsibleUser: s.string().optional().describe(
978
992
  "Assign task to this user. Can be a user ID, name, or email address. User must be a collaborator on the target project."
979
993
  )
980
- }), gt = {
981
- tasks: s.array(bt).min(1).describe("The array of tasks to add.")
982
- }, Tt = {
994
+ }), Tt = {
995
+ tasks: s.array(gt).min(1).describe("The array of tasks to add.")
996
+ }, yt = {
983
997
  tasks: s.array(W).describe("The created tasks."),
984
998
  totalCount: s.number().describe("The total number of tasks created.")
985
- }, yt = {
999
+ }, It = {
986
1000
  name: g.ADD_TASKS,
987
1001
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
988
- parameters: gt,
989
- outputSchema: Tt,
1002
+ parameters: Tt,
1003
+ outputSchema: yt,
1004
+ mutability: "additive",
990
1005
  async execute({ tasks: e }, t) {
991
- const o = e.map((c) => It(c, t)), r = (await Promise.all(o)).map(O);
1006
+ const o = e.map((c) => kt(c, t)), r = (await Promise.all(o)).map(O);
992
1007
  return {
993
- textContent: kt({
1008
+ textContent: wt({
994
1009
  tasks: r,
995
1010
  args: { tasks: e }
996
1011
  }),
@@ -1001,7 +1016,7 @@ const bt = s.object({
1001
1016
  };
1002
1017
  }
1003
1018
  };
1004
- async function It(e, t) {
1019
+ async function kt(e, t) {
1005
1020
  const {
1006
1021
  duration: o,
1007
1022
  projectId: n,
@@ -1069,7 +1084,7 @@ async function It(e, t) {
1069
1084
  }
1070
1085
  return await t.addTask(b);
1071
1086
  }
1072
- function kt({
1087
+ function wt({
1073
1088
  tasks: e,
1074
1089
  args: t
1075
1090
  }) {
@@ -1086,19 +1101,20 @@ function kt({
1086
1101
  showDetails: !0
1087
1102
  });
1088
1103
  }
1089
- const wt = {
1104
+ const jt = {
1090
1105
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
1091
- }, jt = {
1106
+ }, vt = {
1092
1107
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
1093
- failures: s.array(qe).describe("Failed task completions with error details."),
1108
+ failures: s.array(Je).describe("Failed task completions with error details."),
1094
1109
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
1095
1110
  successCount: s.number().describe("The number of successfully completed tasks."),
1096
1111
  failureCount: s.number().describe("The number of failed task completions.")
1097
- }, vt = {
1112
+ }, Ct = {
1098
1113
  name: g.COMPLETE_TASKS,
1099
1114
  description: "Complete one or more tasks by their IDs.",
1100
- parameters: wt,
1101
- outputSchema: jt,
1115
+ parameters: jt,
1116
+ outputSchema: vt,
1117
+ mutability: "mutating",
1102
1118
  async execute(e, t) {
1103
1119
  const o = [], n = [];
1104
1120
  for (const i of e.ids)
@@ -1112,7 +1128,7 @@ const wt = {
1112
1128
  });
1113
1129
  }
1114
1130
  return {
1115
- textContent: Ct({
1131
+ textContent: St({
1116
1132
  completed: o,
1117
1133
  failures: n,
1118
1134
  args: e
@@ -1127,12 +1143,12 @@ const wt = {
1127
1143
  };
1128
1144
  }
1129
1145
  };
1130
- function Ct({
1146
+ function St({
1131
1147
  completed: e,
1132
1148
  failures: t,
1133
1149
  args: o
1134
1150
  }) {
1135
- return ht({
1151
+ return mt({
1136
1152
  action: "Completed tasks",
1137
1153
  success: e.length,
1138
1154
  total: o.ids.length,
@@ -1140,20 +1156,21 @@ function Ct({
1140
1156
  failures: t
1141
1157
  });
1142
1158
  }
1143
- const St = {
1159
+ const $t = {
1144
1160
  type: s.enum(["project", "section", "task", "comment"]).describe("The type of entity to delete."),
1145
1161
  id: s.string().min(1).describe("The ID of the entity to delete.")
1146
- }, $t = {
1162
+ }, Dt = {
1147
1163
  deletedEntity: s.object({
1148
1164
  type: s.enum(["project", "section", "task", "comment"]).describe("The type of deleted entity."),
1149
1165
  id: s.string().describe("The ID of the deleted entity.")
1150
1166
  }).describe("Information about the deleted entity."),
1151
1167
  success: s.boolean().describe("Whether the deletion was successful.")
1152
- }, Dt = {
1168
+ }, xt = {
1153
1169
  name: g.DELETE_OBJECT,
1154
1170
  description: "Delete a project, section, task, or comment by its ID.",
1155
- parameters: St,
1156
- outputSchema: $t,
1171
+ parameters: $t,
1172
+ outputSchema: Dt,
1173
+ mutability: "mutating",
1157
1174
  async execute(e, t) {
1158
1175
  switch (e.type) {
1159
1176
  case "project":
@@ -1177,21 +1194,22 @@ const St = {
1177
1194
  }
1178
1195
  };
1179
1196
  }
1180
- }, xt = {
1197
+ }, At = {
1181
1198
  id: s.string().min(1).describe(
1182
1199
  'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
1183
1200
  )
1184
- }, At = {
1201
+ }, Ut = {
1185
1202
  id: s.string().describe("The ID of the fetched document."),
1186
1203
  title: s.string().describe("The title of the document."),
1187
1204
  text: s.string().describe("The text content of the document."),
1188
1205
  url: s.string().describe("The URL of the document."),
1189
1206
  metadata: s.record(s.unknown()).optional().describe("Additional metadata about the document.")
1190
- }, Ut = {
1207
+ }, Pt = {
1191
1208
  name: g.FETCH,
1192
1209
  description: 'Fetch the full contents of a task or project by its ID. The ID should be in the format "task:{id}" or "project:{id}".',
1193
- parameters: xt,
1194
- outputSchema: At,
1210
+ parameters: At,
1211
+ outputSchema: Ut,
1212
+ mutability: "readonly",
1195
1213
  async execute(e, t) {
1196
1214
  const { id: o } = e, [n, r] = o.split(":", 2);
1197
1215
  if (!r || n !== "task" && n !== "project")
@@ -1245,7 +1263,7 @@ Favorite: Yes`), i = {
1245
1263
  }
1246
1264
  return { textContent: JSON.stringify(i) };
1247
1265
  }
1248
- }, Pt = {
1266
+ }, Et = {
1249
1267
  objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
1250
1268
  objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
1251
1269
  eventType: s.enum([
@@ -1264,17 +1282,18 @@ Favorite: Yes`), i = {
1264
1282
  initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
1265
1283
  limit: s.number().int().min(1).max(S.ACTIVITY_MAX).default(S.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
1266
1284
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
1267
- }, Et = {
1268
- events: s.array(Ve).describe("The activity events."),
1285
+ }, Ot = {
1286
+ events: s.array(Ge).describe("The activity events."),
1269
1287
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
1270
1288
  totalCount: s.number().describe("The total number of events in this page."),
1271
1289
  hasMore: s.boolean().describe("Whether there are more results available."),
1272
1290
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1273
- }, Ot = {
1291
+ }, _t = {
1274
1292
  name: g.FIND_ACTIVITY,
1275
1293
  description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
1276
- parameters: Pt,
1277
- outputSchema: Et,
1294
+ parameters: Et,
1295
+ outputSchema: Ot,
1296
+ mutability: "readonly",
1278
1297
  async execute(e, t) {
1279
1298
  const { objectType: o, objectId: n, eventType: r, projectId: i, taskId: c, initiatorId: a, limit: d, cursor: l } = e, u = {
1280
1299
  limit: d,
@@ -1283,7 +1302,7 @@ Favorite: Yes`), i = {
1283
1302
  o && (u.objectType = o), n && n !== "remove" && (u.objectId = n), r && (u.eventType = r), i && (u.parentProjectId = i), c && (u.parentItemId = c), a && (u.initiatorId = a);
1284
1303
  const { results: p, nextCursor: b } = await t.getActivityLogs(u), m = p.map(ze);
1285
1304
  return {
1286
- textContent: _t({ events: m, args: e, nextCursor: b }),
1305
+ textContent: Nt({ events: m, args: e, nextCursor: b }),
1287
1306
  structuredContent: {
1288
1307
  events: m,
1289
1308
  nextCursor: b ?? void 0,
@@ -1294,7 +1313,7 @@ Favorite: Yes`), i = {
1294
1313
  };
1295
1314
  }
1296
1315
  };
1297
- function _t({
1316
+ function Nt({
1298
1317
  events: e,
1299
1318
  args: t,
1300
1319
  nextCursor: o
@@ -1315,12 +1334,12 @@ function _t({
1315
1334
  limit: t.limit,
1316
1335
  nextCursor: o ?? void 0,
1317
1336
  filterHints: i,
1318
- previewLines: Nt(e, Math.min(e.length, t.limit)),
1337
+ previewLines: Mt(e, Math.min(e.length, t.limit)),
1319
1338
  zeroReasonHints: c
1320
1339
  });
1321
1340
  }
1322
- function Nt(e, t = 10) {
1323
- const n = e.slice(0, t).map(Mt).join(`
1341
+ function Mt(e, t = 10) {
1342
+ const n = e.slice(0, t).map(Ft).join(`
1324
1343
  `);
1325
1344
  if (e.length > t) {
1326
1345
  const r = e.length - t;
@@ -1329,8 +1348,8 @@ function Nt(e, t = 10) {
1329
1348
  }
1330
1349
  return n;
1331
1350
  }
1332
- function Mt(e) {
1333
- const t = Ft(e.eventDate), o = `${e.eventType} ${e.objectType}`;
1351
+ function Ft(e) {
1352
+ const t = Rt(e.eventDate), o = `${e.eventType} ${e.objectType}`;
1334
1353
  let n = "";
1335
1354
  if (e.extraData) {
1336
1355
  const a = e.extraData.content || e.extraData.name || e.extraData.last_content;
@@ -1339,7 +1358,7 @@ function Mt(e) {
1339
1358
  const r = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", c = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
1340
1359
  return ` [${t}] ${o}${n}${r}${i}${c}`;
1341
1360
  }
1342
- function Ft(e) {
1361
+ function Rt(e) {
1343
1362
  try {
1344
1363
  const t = new Date(e), o = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), n = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), r = t.toLocaleTimeString("en-US", {
1345
1364
  hour: "2-digit",
@@ -1352,7 +1371,7 @@ function Ft(e) {
1352
1371
  return e;
1353
1372
  }
1354
1373
  }
1355
- const Rt = {
1374
+ const Lt = {
1356
1375
  taskId: s.string().optional().describe("Find comments for a specific task."),
1357
1376
  projectId: s.string().optional().describe(
1358
1377
  'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -1360,15 +1379,16 @@ const Rt = {
1360
1379
  commentId: s.string().optional().describe("Get a specific comment by ID."),
1361
1380
  cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
1362
1381
  limit: s.number().int().min(1).max(S.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
1363
- }, Lt = {
1382
+ }, Bt = {
1364
1383
  comments: s.array(re).describe("The found comments."),
1365
1384
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
1366
1385
  totalCount: s.number().describe("The total number of comments in this page.")
1367
- }, Bt = {
1386
+ }, Wt = {
1368
1387
  name: g.FIND_COMMENTS,
1369
1388
  description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
1370
- parameters: Rt,
1371
- outputSchema: Lt,
1389
+ parameters: Lt,
1390
+ outputSchema: Bt,
1391
+ mutability: "readonly",
1372
1392
  async execute(e, t) {
1373
1393
  const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
1374
1394
  if (o.length === 0)
@@ -1399,7 +1419,7 @@ const Rt = {
1399
1419
  throw new Error("Invalid state: no search parameter provided");
1400
1420
  const a = c.map(te);
1401
1421
  return {
1402
- textContent: Wt({
1422
+ textContent: Yt({
1403
1423
  comments: a,
1404
1424
  searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
1405
1425
  searchId: e.commentId || e.taskId || e.projectId || "",
@@ -1417,7 +1437,7 @@ const Rt = {
1417
1437
  };
1418
1438
  }
1419
1439
  };
1420
- function Wt({
1440
+ function Yt({
1421
1441
  comments: e,
1422
1442
  searchType: t,
1423
1443
  searchId: o,
@@ -1443,9 +1463,9 @@ ${c}`;
1443
1463
  }
1444
1464
  return i;
1445
1465
  }
1446
- const Yt = ["and", "or"], ae = {
1466
+ const Ht = ["and", "or"], ae = {
1447
1467
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
1448
- labelsOperator: s.enum(Yt).optional().describe(
1468
+ labelsOperator: s.enum(Ht).optional().describe(
1449
1469
  'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
1450
1470
  )
1451
1471
  };
@@ -1480,15 +1500,16 @@ const zt = {
1480
1500
  totalCount: s.number().describe("The total number of tasks in this page."),
1481
1501
  hasMore: s.boolean().describe("Whether there are more results available."),
1482
1502
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1483
- }, Ht = {
1503
+ }, Vt = {
1484
1504
  name: g.FIND_COMPLETED_TASKS,
1485
1505
  description: "Get completed tasks (includes all collaborators by default—use responsibleUser to narrow).",
1486
1506
  parameters: zt,
1487
1507
  outputSchema: Kt,
1508
+ mutability: "readonly",
1488
1509
  async execute(e, t) {
1489
1510
  const { getBy: o, labels: n, labelsOperator: r, since: i, until: c, responsibleUser: a, projectId: d, ...l } = e, u = await ee(t, a), p = u?.email;
1490
1511
  let m = ce(n, r);
1491
- u && p && (m = K(m, `assigned to: ${p}`));
1512
+ u && p && (m = z(m, `assigned to: ${p}`));
1492
1513
  const y = await t.getUser(), k = y.tzInfo?.gmtString || "+00:00", w = d === "inbox" ? y.inboxProjectId : d, D = `${i}T00:00:00${k}`, P = `${c}T23:59:59${k}`, h = new Date(D).toISOString(), T = new Date(P).toISOString(), { items: C, nextCursor: v } = o === "completion" ? await t.getCompletedTasksByCompletionDate({
1493
1514
  ...l,
1494
1515
  projectId: w,
@@ -1503,7 +1524,7 @@ const zt = {
1503
1524
  ...m ? { filterQuery: m, filterLang: "en" } : {}
1504
1525
  }), f = C.map(O);
1505
1526
  return {
1506
- textContent: Vt({
1527
+ textContent: Gt({
1507
1528
  tasks: f,
1508
1529
  args: e,
1509
1530
  nextCursor: v,
@@ -1519,7 +1540,7 @@ const zt = {
1519
1540
  };
1520
1541
  }
1521
1542
  };
1522
- function Vt({
1543
+ function Gt({
1523
1544
  tasks: e,
1524
1545
  args: t,
1525
1546
  nextCursor: o,
@@ -1541,17 +1562,17 @@ function Vt({
1541
1562
  limit: t.limit,
1542
1563
  nextCursor: o ?? void 0,
1543
1564
  filterHints: c,
1544
- previewLines: H(e, Math.min(e.length, t.limit)),
1565
+ previewLines: K(e, Math.min(e.length, t.limit)),
1545
1566
  zeroReasonHints: a
1546
1567
  });
1547
1568
  }
1548
- const { FIND_PROJECTS: Gt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, qt = {
1569
+ const { FIND_PROJECTS: qt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, Jt = {
1549
1570
  projectId: s.string().min(1).describe("The ID of the project to search for collaborators in."),
1550
1571
  searchTerm: s.string().optional().describe(
1551
1572
  "Search for a collaborator by name or email (partial and case insensitive match). If omitted, all collaborators in the project are returned."
1552
1573
  )
1553
- }, Jt = {
1554
- collaborators: s.array(Ge).describe("The found collaborators."),
1574
+ }, Xt = {
1575
+ collaborators: s.array(qe).describe("The found collaborators."),
1555
1576
  projectInfo: s.object({
1556
1577
  id: s.string().describe("The project ID."),
1557
1578
  name: s.string().describe("The project name."),
@@ -1560,11 +1581,12 @@ const { FIND_PROJECTS: Gt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, qt = {
1560
1581
  totalCount: s.number().describe("The total number of collaborators found."),
1561
1582
  totalAvailable: s.number().optional().describe("The total number of available collaborators in the project."),
1562
1583
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1563
- }, Xt = {
1584
+ }, Zt = {
1564
1585
  name: g.FIND_PROJECT_COLLABORATORS,
1565
1586
  description: "Search for collaborators by name or other criteria in a project.",
1566
- parameters: qt,
1567
- outputSchema: Jt,
1587
+ parameters: Jt,
1588
+ outputSchema: Xt,
1589
+ mutability: "readonly",
1568
1590
  async execute(e, t) {
1569
1591
  const { projectId: o, searchTerm: n } = e;
1570
1592
  let r = o, i;
@@ -1622,7 +1644,7 @@ const { FIND_PROJECTS: Gt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, qt = {
1622
1644
  );
1623
1645
  }
1624
1646
  return {
1625
- textContent: Zt({
1647
+ textContent: Qt({
1626
1648
  collaborators: a,
1627
1649
  projectName: r,
1628
1650
  searchTerm: n,
@@ -1642,7 +1664,7 @@ const { FIND_PROJECTS: Gt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, qt = {
1642
1664
  };
1643
1665
  }
1644
1666
  };
1645
- function Zt({
1667
+ function Qt({
1646
1668
  collaborators: e,
1647
1669
  projectName: t,
1648
1670
  searchTerm: o,
@@ -1658,7 +1680,7 @@ function Zt({
1658
1680
  const a = [];
1659
1681
  e.length === 0 && (o ? (a.push(`No collaborators match "${o}"`), a.push("Try a broader search term or check spelling"), n > 0 && a.push(`${n} collaborators available without filter`)) : (a.push("Project has no collaborators"), a.push("Share the project to add collaborators")));
1660
1682
  const d = [];
1661
- return e.length > 0 ? (d.push(`Use ${Ce} with responsibleUser to assign new tasks`), d.push(`Use ${Se} with responsibleUser to reassign existing tasks`), d.push("Use collaborator names, emails, or IDs for assignments")) : (d.push(`Use ${Gt} to find other projects`), o && n > 0 && d.push("Try searching without filters to see all collaborators")), N({
1683
+ return e.length > 0 ? (d.push(`Use ${Ce} with responsibleUser to assign new tasks`), d.push(`Use ${Se} with responsibleUser to reassign existing tasks`), d.push("Use collaborator names, emails, or IDs for assignments")) : (d.push(`Use ${qt} to find other projects`), o && n > 0 && d.push("Try searching without filters to see all collaborators")), N({
1662
1684
  subject: r,
1663
1685
  count: e.length,
1664
1686
  filterHints: i,
@@ -1668,7 +1690,7 @@ function Zt({
1668
1690
  nextSteps: d
1669
1691
  });
1670
1692
  }
1671
- const { ADD_PROJECTS: Qt } = g, es = {
1693
+ const { ADD_PROJECTS: es } = g, ts = {
1672
1694
  search: s.string().optional().describe(
1673
1695
  "Search for a project by name (partial and case insensitive match). If omitted, all projects are returned."
1674
1696
  ),
@@ -1676,17 +1698,18 @@ const { ADD_PROJECTS: Qt } = g, es = {
1676
1698
  cursor: s.string().optional().describe(
1677
1699
  "The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
1678
1700
  )
1679
- }, ts = {
1701
+ }, ss = {
1680
1702
  projects: s.array(oe).describe("The found projects."),
1681
1703
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
1682
1704
  totalCount: s.number().describe("The total number of projects in this page."),
1683
1705
  hasMore: s.boolean().describe("Whether there are more results available."),
1684
1706
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1685
- }, ss = {
1707
+ }, os = {
1686
1708
  name: g.FIND_PROJECTS,
1687
1709
  description: "List all projects or search for projects by name. When searching, all matching projects are returned (pagination is ignored). When not searching, projects are returned with pagination.",
1688
- parameters: es,
1689
- outputSchema: ts,
1710
+ parameters: ts,
1711
+ outputSchema: ss,
1712
+ mutability: "readonly",
1690
1713
  async execute(e, t) {
1691
1714
  let o, n = null;
1692
1715
  if (e.search)
@@ -1700,7 +1723,7 @@ const { ADD_PROJECTS: Qt } = g, es = {
1700
1723
  }
1701
1724
  const r = e.search ? e.search.toLowerCase() : void 0, c = (r ? o.filter((a) => a.name.toLowerCase().includes(r)) : o).map(we);
1702
1725
  return {
1703
- textContent: os({ projects: c, args: e, nextCursor: n }),
1726
+ textContent: ns({ projects: c, args: e, nextCursor: n }),
1704
1727
  structuredContent: {
1705
1728
  projects: c,
1706
1729
  nextCursor: n ?? void 0,
@@ -1711,17 +1734,17 @@ const { ADD_PROJECTS: Qt } = g, es = {
1711
1734
  };
1712
1735
  }
1713
1736
  };
1714
- function os({
1737
+ function ns({
1715
1738
  projects: e,
1716
1739
  args: t,
1717
1740
  nextCursor: o
1718
1741
  }) {
1719
1742
  const n = t.search ? `All projects matching "${t.search}"` : "Projects", r = [];
1720
1743
  t.search && r.push(`search: "${t.search}"`);
1721
- const i = 10, a = e.slice(0, i).map(ft).join(`
1744
+ const i = 10, a = e.slice(0, i).map(bt).join(`
1722
1745
  `), d = e.length - i, l = d > 0 ? `${a}
1723
1746
  …and ${d} more` : a, u = [];
1724
- return e.length === 0 && (t.search ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove search to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${Qt} to create a project`))), N({
1747
+ return e.length === 0 && (t.search ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove search to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${es} to create a project`))), N({
1725
1748
  subject: n,
1726
1749
  count: e.length,
1727
1750
  limit: t.limit,
@@ -1731,31 +1754,32 @@ function os({
1731
1754
  zeroReasonHints: u
1732
1755
  });
1733
1756
  }
1734
- const { ADD_SECTIONS: ns } = g, rs = {
1757
+ const { ADD_SECTIONS: rs } = g, is = {
1735
1758
  projectId: s.string().min(1).describe(
1736
1759
  'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
1737
1760
  ),
1738
1761
  search: s.string().optional().describe(
1739
1762
  "Search for a section by name (partial and case insensitive match). If omitted, all sections in the project are returned."
1740
1763
  )
1741
- }, is = {
1764
+ }, as = {
1742
1765
  sections: s.array(ne).describe("The found sections."),
1743
1766
  totalCount: s.number().describe("The total number of sections found."),
1744
1767
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1745
- }, as = {
1768
+ }, cs = {
1746
1769
  name: g.FIND_SECTIONS,
1747
1770
  description: "Search for sections by name or other criteria in a project. When searching, all sections in the project are fetched to ensure complete results.",
1748
- parameters: rs,
1749
- outputSchema: is,
1771
+ parameters: is,
1772
+ outputSchema: as,
1773
+ mutability: "readonly",
1750
1774
  async execute(e, t) {
1751
1775
  const o = e.projectId === "inbox" ? (await t.getUser()).inboxProjectId : e.projectId;
1752
1776
  let n;
1753
- e.search ? n = await We(t, o) : n = (await t.getSections({
1777
+ e.search ? n = await Ye(t, o) : n = (await t.getSections({
1754
1778
  projectId: o
1755
1779
  })).results;
1756
1780
  const r = e.search ? e.search.toLowerCase() : void 0, c = (r ? n.filter((d) => d.name.toLowerCase().includes(r)) : n).map(({ id: d, name: l }) => ({ id: d, name: l }));
1757
1781
  return {
1758
- textContent: cs({
1782
+ textContent: ds({
1759
1783
  sections: c,
1760
1784
  projectId: e.projectId,
1761
1785
  search: e.search
@@ -1768,13 +1792,13 @@ const { ADD_SECTIONS: ns } = g, rs = {
1768
1792
  };
1769
1793
  }
1770
1794
  };
1771
- function cs({
1795
+ function ds({
1772
1796
  sections: e,
1773
1797
  projectId: t,
1774
1798
  search: o
1775
1799
  }) {
1776
1800
  const n = [];
1777
- o ? (n.push("Try broader search terms"), n.push("Check spelling"), n.push("Remove search to see all sections")) : (n.push("Project has no sections yet"), n.push(`Use ${ns} to create sections`));
1801
+ o ? (n.push("Try broader search terms"), n.push("Check spelling"), n.push("Remove search to see all sections")) : (n.push("Project has no sections yet"), n.push(`Use ${rs} to create sections`));
1778
1802
  const r = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((c) => ` ${c.name} • id=${c.id}`).join(`
1779
1803
  `) : void 0;
1780
1804
  return N({
@@ -1784,7 +1808,7 @@ function cs({
1784
1808
  zeroReasonHints: n
1785
1809
  });
1786
1810
  }
1787
- const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ds = {
1811
+ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ls = {
1788
1812
  searchText: s.string().optional().describe("The text to search for in tasks."),
1789
1813
  projectId: s.string().optional().describe(
1790
1814
  'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -1800,17 +1824,18 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ds = {
1800
1824
  "The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
1801
1825
  ),
1802
1826
  ...ae
1803
- }, ls = {
1827
+ }, us = {
1804
1828
  tasks: s.array(W).describe("The found tasks."),
1805
1829
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
1806
1830
  totalCount: s.number().describe("The total number of tasks in this page."),
1807
1831
  hasMore: s.boolean().describe("Whether there are more results available."),
1808
1832
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
1809
- }, us = {
1833
+ }, ps = {
1810
1834
  name: g.FIND_TASKS,
1811
1835
  description: "Find tasks by text search, or by project/section/parent container/responsible user. At least one filter must be provided.",
1812
- parameters: ds,
1813
- outputSchema: ls,
1836
+ parameters: ls,
1837
+ outputSchema: us,
1838
+ mutability: "readonly",
1814
1839
  async execute(e, t) {
1815
1840
  const {
1816
1841
  searchText: o,
@@ -1892,7 +1917,7 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ds = {
1892
1917
  let D = "";
1893
1918
  o && (D = `search: ${o}`);
1894
1919
  const P = ce(u, p);
1895
- D = K(D, P);
1920
+ D = z(D, P);
1896
1921
  const { tasks: h, nextCursor: T } = await se({
1897
1922
  client: t,
1898
1923
  query: D,
@@ -1922,7 +1947,7 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ds = {
1922
1947
  };
1923
1948
  }
1924
1949
  };
1925
- function ps(e) {
1950
+ function hs(e) {
1926
1951
  if (e.projectId) {
1927
1952
  const t = [
1928
1953
  e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
@@ -1957,7 +1982,7 @@ function J({
1957
1982
  const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
1958
1983
  c.push(`labels: ${d}`);
1959
1984
  }
1960
- e.length === 0 && a.push(...ps(t));
1985
+ e.length === 0 && a.push(...hs(t));
1961
1986
  } else {
1962
1987
  const d = r || t.responsibleUser, l = [];
1963
1988
  if (t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${d}`), t.labels && t.labels.length > 0) {
@@ -1982,11 +2007,11 @@ function J({
1982
2007
  limit: t.limit,
1983
2008
  nextCursor: o ?? void 0,
1984
2009
  filterHints: c,
1985
- previewLines: H(e, Math.min(e.length, t.limit)),
2010
+ previewLines: K(e, Math.min(e.length, t.limit)),
1986
2011
  zeroReasonHints: a
1987
2012
  });
1988
2013
  }
1989
- const hs = {
2014
+ const ms = {
1990
2015
  startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
1991
2016
  overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
1992
2017
  "How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
@@ -2003,17 +2028,18 @@ const hs = {
2003
2028
  'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default is "unassignedOrMe".'
2004
2029
  ),
2005
2030
  ...ae
2006
- }, ms = {
2031
+ }, fs = {
2007
2032
  tasks: s.array(W).describe("The found tasks."),
2008
2033
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
2009
2034
  totalCount: s.number().describe("The total number of tasks in this page."),
2010
2035
  hasMore: s.boolean().describe("Whether there are more results available."),
2011
2036
  appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
2012
- }, fs = {
2037
+ }, bs = {
2013
2038
  name: g.FIND_TASKS_BY_DATE,
2014
2039
  description: "Get tasks by date range. Use startDate 'today' to get today's tasks including overdue items, or provide a specific date/date range.",
2015
- parameters: hs,
2016
- outputSchema: ms,
2040
+ parameters: ms,
2041
+ outputSchema: fs,
2042
+ mutability: "readonly",
2017
2043
  async execute(e, t) {
2018
2044
  if (!e.startDate && e.overdueOption !== "overdue-only")
2019
2045
  throw new Error(
@@ -2030,13 +2056,13 @@ const hs = {
2030
2056
  i = `(due after: ${p} | due: ${p}) & due before: ${m}`;
2031
2057
  }
2032
2058
  const c = ce(e.labels, e.labelsOperator);
2033
- c.length > 0 && (i = K(i, `(${c})`));
2034
- const a = Be({
2059
+ c.length > 0 && (i = z(i, `(${c})`));
2060
+ const a = We({
2035
2061
  resolvedAssigneeId: n,
2036
2062
  assigneeEmail: r,
2037
2063
  responsibleUserFiltering: e.responsibleUserFiltering
2038
2064
  });
2039
- i = K(i, a);
2065
+ i = z(i, a);
2040
2066
  const { tasks: d, nextCursor: l } = await se({
2041
2067
  client: t,
2042
2068
  query: i,
@@ -2044,7 +2070,7 @@ const hs = {
2044
2070
  limit: e.limit
2045
2071
  });
2046
2072
  return {
2047
- textContent: bs({ tasks: d, args: e, nextCursor: l, assigneeEmail: r }),
2073
+ textContent: gs({ tasks: d, args: e, nextCursor: l, assigneeEmail: r }),
2048
2074
  structuredContent: {
2049
2075
  tasks: d,
2050
2076
  nextCursor: l ?? void 0,
@@ -2055,7 +2081,7 @@ const hs = {
2055
2081
  };
2056
2082
  }
2057
2083
  };
2058
- function bs({
2084
+ function gs({
2059
2085
  tasks: e,
2060
2086
  args: t,
2061
2087
  nextCursor: o,
@@ -2070,7 +2096,7 @@ function bs({
2070
2096
  `today${a}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
2071
2097
  );
2072
2098
  } else if (t.startDate) {
2073
- const a = t.daysCount > 1 ? ` to ${pt(be(t.startDate, t.daysCount))}` : "";
2099
+ const a = t.daysCount > 1 ? ` to ${ht(be(t.startDate, t.daysCount))}` : "";
2074
2100
  r.push(`${t.startDate}${a}`);
2075
2101
  }
2076
2102
  if (t.labels && t.labels.length > 0) {
@@ -2101,15 +2127,15 @@ function bs({
2101
2127
  limit: t.limit,
2102
2128
  nextCursor: o ?? void 0,
2103
2129
  filterHints: r,
2104
- previewLines: H(e, Math.min(e.length, t.limit)),
2130
+ previewLines: K(e, Math.min(e.length, t.limit)),
2105
2131
  zeroReasonHints: c
2106
2132
  });
2107
2133
  }
2108
- const gs = {
2134
+ const Ts = {
2109
2135
  projectId: s.string().min(1).optional().describe(
2110
2136
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
2111
2137
  )
2112
- }, Ts = {
2138
+ }, ys = {
2113
2139
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
2114
2140
  totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
2115
2141
  totalTasks: s.number().optional().describe("Total number of tasks."),
@@ -2130,7 +2156,7 @@ const gs = {
2130
2156
  tasks: s.array(s.any()).optional().describe("List of tasks (project overview only)."),
2131
2157
  stats: s.any().optional().describe("Statistics object (project overview only).")
2132
2158
  };
2133
- function ys(e) {
2159
+ function Is(e) {
2134
2160
  const t = {};
2135
2161
  for (const r of e)
2136
2162
  t[r.id] = {
@@ -2155,7 +2181,7 @@ function ys(e) {
2155
2181
  }
2156
2182
  return n(o), o;
2157
2183
  }
2158
- async function Is(e, t) {
2184
+ async function ks(e, t) {
2159
2185
  const o = {};
2160
2186
  return await Promise.all(
2161
2187
  t.map(async (n) => {
@@ -2208,7 +2234,7 @@ function De(e, t) {
2208
2234
  children: e.children.map((o) => De(o, t))
2209
2235
  };
2210
2236
  }
2211
- async function ks(e, t) {
2237
+ async function ws(e, t) {
2212
2238
  let o = [], n;
2213
2239
  do {
2214
2240
  const { results: r, nextCursor: i } = await e.getTasks({
@@ -2220,12 +2246,12 @@ async function ks(e, t) {
2220
2246
  } while (n);
2221
2247
  return o;
2222
2248
  }
2223
- async function ws(e, t) {
2249
+ async function js(e, t) {
2224
2250
  const { results: o } = await e.getSections({ projectId: t });
2225
2251
  return o;
2226
2252
  }
2227
- async function js(e) {
2228
- const { results: t } = await e.getProjects({}), o = t.find((p) => B(p) && p.inboxProject === !0), n = t.filter((p) => !B(p) || p.inboxProject !== !0), r = ys(n), i = t.map((p) => p.id), c = await Is(e, i), a = ["# Personal Projects", ""];
2253
+ async function vs(e) {
2254
+ const { results: t } = await e.getProjects({}), o = t.find((p) => B(p) && p.inboxProject === !0), n = t.filter((p) => !B(p) || p.inboxProject !== !0), r = Is(n), i = t.map((p) => p.id), c = await ks(e, i), a = ["# Personal Projects", ""];
2229
2255
  if (o) {
2230
2256
  a.push(`- Inbox Project: ${o.name} (id=${o.id})`);
2231
2257
  for (const p of c[o.id] || [])
@@ -2262,8 +2288,8 @@ async function js(e) {
2262
2288
  };
2263
2289
  return { textContent: l, structuredContent: u };
2264
2290
  }
2265
- async function vs(e, t) {
2266
- const o = await e.getProject(t), n = await ws(e, t), r = await ks(e, t), i = {};
2291
+ async function Cs(e, t) {
2292
+ const o = await e.getProject(t), n = await js(e, t), r = await ws(e, t), i = {};
2267
2293
  for (const u of n)
2268
2294
  i[u.id] = [];
2269
2295
  const c = [];
@@ -2304,21 +2330,22 @@ async function vs(e, t) {
2304
2330
  };
2305
2331
  return { textContent: d, structuredContent: l };
2306
2332
  }
2307
- const Cs = {
2333
+ const Ss = {
2308
2334
  name: g.GET_OVERVIEW,
2309
2335
  description: "Get a Markdown overview. If no projectId is provided, shows all projects with hierarchy and sections (useful for navigation). If projectId is provided, shows detailed overview of that specific project including all tasks grouped by sections.",
2310
- parameters: gs,
2311
- outputSchema: Ts,
2336
+ parameters: Ts,
2337
+ outputSchema: ys,
2338
+ mutability: "readonly",
2312
2339
  async execute(e, t) {
2313
- const o = e.projectId ? await vs(t, e.projectId) : await js(t);
2340
+ const o = e.projectId ? await Cs(t, e.projectId) : await vs(t);
2314
2341
  return {
2315
2342
  textContent: o.textContent,
2316
2343
  structuredContent: o.structuredContent
2317
2344
  };
2318
2345
  }
2319
- }, { FIND_TASKS: Ss, FIND_PROJECT_COLLABORATORS: he, UPDATE_TASKS: $s } = g, Ds = 50, xs = {
2346
+ }, { FIND_TASKS: $s, FIND_PROJECT_COLLABORATORS: he, UPDATE_TASKS: Ds } = g, xs = 50, As = {
2320
2347
  operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
2321
- taskIds: s.array(s.string()).min(1).max(Ds).describe("The IDs of the tasks to operate on (max 50)."),
2348
+ taskIds: s.array(s.string()).min(1).max(xs).describe("The IDs of the tasks to operate on (max 50)."),
2322
2349
  responsibleUser: s.string().optional().describe(
2323
2350
  "The user to assign tasks to. Can be user ID, name, or email. Required for assign and reassign operations."
2324
2351
  ),
@@ -2326,7 +2353,7 @@ const Cs = {
2326
2353
  "For reassign operations: the current assignee to reassign from. Can be user ID, name, or email. Optional - if not provided, reassigns from any current assignee."
2327
2354
  ),
2328
2355
  dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
2329
- }, As = {
2356
+ }, Us = {
2330
2357
  results: s.array(
2331
2358
  s.object({
2332
2359
  taskId: s.string().describe("The ID of the task."),
@@ -2342,11 +2369,12 @@ const Cs = {
2342
2369
  failed: s.number().describe("Number of failed operations."),
2343
2370
  dryRun: s.boolean().describe("Whether this was a dry run.")
2344
2371
  }).optional().describe("Summary of the operation.")
2345
- }, Us = {
2372
+ }, Ps = {
2346
2373
  name: g.MANAGE_ASSIGNMENTS,
2347
2374
  description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
2348
- parameters: xs,
2349
- outputSchema: As,
2375
+ parameters: As,
2376
+ outputSchema: Us,
2377
+ mutability: "mutating",
2350
2378
  async execute(e, t) {
2351
2379
  const { operation: o, taskIds: n, responsibleUser: r, fromAssigneeUser: i, dryRun: c } = e;
2352
2380
  if ((o === "assign" || o === "reassign") && !r)
@@ -2572,8 +2600,8 @@ function Y({
2572
2600
  `;
2573
2601
  }
2574
2602
  return !o && n.length > 0 ? (a += `**Next steps:**
2575
- `, a += `• Use ${Ss} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
2576
- `, a += `• Use ${$s} for individual assignment changes
2603
+ `, a += `• Use ${$s} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
2604
+ `, a += `• Use ${Ds} for individual assignment changes
2577
2605
  `, r.length > 0 && (a += `• Check failed tasks and use ${he} to verify collaborator access
2578
2606
  `)) : o ? (a += `**To execute:**
2579
2607
  `, a += `• Remove dryRun parameter and run again to execute changes
@@ -2585,9 +2613,9 @@ function Y({
2585
2613
  `, a += `• Use dryRun=true to validate before executing
2586
2614
  `), a;
2587
2615
  }
2588
- const Ps = {
2616
+ const Es = {
2589
2617
  query: s.string().min(1).describe("The search query string to find tasks and projects.")
2590
- }, Es = {
2618
+ }, Os = {
2591
2619
  results: s.array(
2592
2620
  s.object({
2593
2621
  id: s.string().describe("The ID of the result."),
@@ -2596,11 +2624,12 @@ const Ps = {
2596
2624
  })
2597
2625
  ).describe("The search results."),
2598
2626
  totalCount: s.number().describe("Total number of results found.")
2599
- }, Os = {
2627
+ }, _s = {
2600
2628
  name: g.SEARCH,
2601
2629
  description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
2602
- parameters: Ps,
2603
- outputSchema: Es,
2630
+ parameters: Es,
2631
+ outputSchema: Os,
2632
+ mutability: "readonly",
2604
2633
  async execute(e, t) {
2605
2634
  const { query: o } = e, [n, r] = await Promise.all([
2606
2635
  se({
@@ -2630,27 +2659,28 @@ const Ps = {
2630
2659
  structuredContent: { results: a, totalCount: a.length }
2631
2660
  };
2632
2661
  }
2633
- }, _s = s.object({
2662
+ }, Ns = s.object({
2634
2663
  id: s.string().min(1).describe("The ID of the comment to update."),
2635
2664
  content: s.string().min(1).describe("The new content for the comment.")
2636
- }), Ns = {
2637
- comments: s.array(_s).min(1).describe("The comments to update.")
2638
- }, Ms = {
2665
+ }), Ms = {
2666
+ comments: s.array(Ns).min(1).describe("The comments to update.")
2667
+ }, Fs = {
2639
2668
  comments: s.array(re).describe("The updated comments."),
2640
2669
  totalCount: s.number().describe("The total number of comments updated."),
2641
2670
  updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
2642
2671
  appliedOperations: s.object({
2643
2672
  updateCount: s.number().describe("The number of comments updated.")
2644
2673
  }).describe("Summary of operations performed.")
2645
- }, Fs = {
2674
+ }, Rs = {
2646
2675
  name: g.UPDATE_COMMENTS,
2647
2676
  description: "Update multiple existing comments with new content.",
2648
- parameters: Ns,
2649
- outputSchema: Ms,
2677
+ parameters: Ms,
2678
+ outputSchema: Fs,
2679
+ mutability: "mutating",
2650
2680
  async execute(e, t) {
2651
2681
  const { comments: o } = e, n = o.map(async (a) => await t.updateComment(a.id, { content: a.content })), i = (await Promise.all(n)).map(te);
2652
2682
  return {
2653
- textContent: Rs({
2683
+ textContent: Ls({
2654
2684
  comments: i
2655
2685
  }),
2656
2686
  structuredContent: {
@@ -2664,7 +2694,7 @@ const Ps = {
2664
2694
  };
2665
2695
  }
2666
2696
  };
2667
- function Rs({ comments: e }) {
2697
+ function Ls({ comments: e }) {
2668
2698
  const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, n = [];
2669
2699
  if (t > 0) {
2670
2700
  const i = t > 1 ? "comments" : "comment";
@@ -2676,14 +2706,14 @@ function Rs({ comments: e }) {
2676
2706
  }
2677
2707
  return n.length > 0 ? `Updated ${n.join(" and ")}` : "No comments updated";
2678
2708
  }
2679
- const Ls = s.object({
2709
+ const Bs = s.object({
2680
2710
  id: s.string().min(1).describe("The ID of the project to update."),
2681
2711
  name: s.string().min(1).optional().describe("The new name of the project."),
2682
2712
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
2683
2713
  viewStyle: s.enum(["list", "board", "calendar"]).optional().describe("The project view style.")
2684
- }), Bs = {
2685
- projects: s.array(Ls).min(1).describe("The projects to update.")
2686
- }, Ws = {
2714
+ }), Ws = {
2715
+ projects: s.array(Bs).min(1).describe("The projects to update.")
2716
+ }, Ys = {
2687
2717
  projects: s.array(oe).describe("The updated projects."),
2688
2718
  totalCount: s.number().describe("The total number of projects updated."),
2689
2719
  updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
@@ -2691,11 +2721,12 @@ const Ls = s.object({
2691
2721
  updateCount: s.number().describe("The number of projects actually updated."),
2692
2722
  skippedCount: s.number().describe("The number of projects skipped (no changes).")
2693
2723
  }).describe("Summary of operations performed.")
2694
- }, Ys = {
2724
+ }, Hs = {
2695
2725
  name: g.UPDATE_PROJECTS,
2696
2726
  description: "Update multiple existing projects with new values.",
2697
- parameters: Bs,
2698
- outputSchema: Ws,
2727
+ parameters: Ws,
2728
+ outputSchema: Ys,
2729
+ mutability: "mutating",
2699
2730
  async execute(e, t) {
2700
2731
  const { projects: o } = e, n = o.map(async (c) => {
2701
2732
  if (!Ks(c))
@@ -2739,26 +2770,27 @@ ${c}`), a;
2739
2770
  function Ks({ id: e, ...t }) {
2740
2771
  return Object.keys(t).length > 0;
2741
2772
  }
2742
- const Hs = s.object({
2773
+ const Vs = s.object({
2743
2774
  id: s.string().min(1).describe("The ID of the section to update."),
2744
2775
  name: s.string().min(1).describe("The new name of the section.")
2745
- }), Vs = {
2746
- sections: s.array(Hs).min(1).describe("The sections to update.")
2747
- }, Gs = {
2776
+ }), Gs = {
2777
+ sections: s.array(Vs).min(1).describe("The sections to update.")
2778
+ }, qs = {
2748
2779
  sections: s.array(ne).describe("The updated sections."),
2749
2780
  totalCount: s.number().describe("The total number of sections updated."),
2750
2781
  updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
2751
- }, qs = {
2782
+ }, Js = {
2752
2783
  name: g.UPDATE_SECTIONS,
2753
2784
  description: "Update multiple existing sections with new values.",
2754
- parameters: Vs,
2755
- outputSchema: Gs,
2785
+ parameters: Gs,
2786
+ outputSchema: qs,
2787
+ mutability: "mutating",
2756
2788
  async execute({ sections: e }, t) {
2757
2789
  const o = await Promise.all(
2758
2790
  e.map((r) => t.updateSection(r.id, { name: r.name }))
2759
2791
  );
2760
2792
  return {
2761
- textContent: Js({
2793
+ textContent: Xs({
2762
2794
  sections: o
2763
2795
  }),
2764
2796
  structuredContent: {
@@ -2769,13 +2801,13 @@ const Hs = s.object({
2769
2801
  };
2770
2802
  }
2771
2803
  };
2772
- function Js({ sections: e }) {
2804
+ function Xs({ sections: e }) {
2773
2805
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id}, projectId=${r.projectId})`).join(`
2774
2806
  `);
2775
2807
  return `Updated ${t} section${t === 1 ? "" : "s"}:
2776
2808
  ${o}`;
2777
2809
  }
2778
- const Xs = s.object({
2810
+ const Zs = s.object({
2779
2811
  id: s.string().min(1).describe("The ID of the task to update."),
2780
2812
  content: s.string().optional().describe(
2781
2813
  'The new task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
@@ -2803,9 +2835,9 @@ const Xs = s.object({
2803
2835
  'Change task assignment. Use "unassign" to remove assignment. Can be user ID, name, or email. User must be a project collaborator.'
2804
2836
  ),
2805
2837
  labels: s.array(s.string()).optional().describe("The new labels for the task. Replaces all existing labels.")
2806
- }), Zs = {
2807
- tasks: s.array(Xs).min(1).describe("The tasks to update.")
2808
- }, Qs = {
2838
+ }), Qs = {
2839
+ tasks: s.array(Zs).min(1).describe("The tasks to update.")
2840
+ }, eo = {
2809
2841
  tasks: s.array(W).describe("The updated tasks."),
2810
2842
  totalCount: s.number().describe("The total number of tasks updated."),
2811
2843
  updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
@@ -2813,14 +2845,15 @@ const Xs = s.object({
2813
2845
  updateCount: s.number().describe("The number of tasks actually updated."),
2814
2846
  skippedCount: s.number().describe("The number of tasks skipped (no changes).")
2815
2847
  }).describe("Summary of operations performed.")
2816
- }, eo = {
2848
+ }, to = {
2817
2849
  name: g.UPDATE_TASKS,
2818
2850
  description: "Update existing tasks including content, dates, priorities, and assignments.",
2819
- parameters: Zs,
2820
- outputSchema: Qs,
2851
+ parameters: Qs,
2852
+ outputSchema: eo,
2853
+ mutability: "mutating",
2821
2854
  async execute(e, t) {
2822
2855
  const { tasks: o } = e, n = o.map(async (a) => {
2823
- if (!so(a))
2856
+ if (!oo(a))
2824
2857
  return;
2825
2858
  const {
2826
2859
  id: d,
@@ -2870,13 +2903,13 @@ const Xs = s.object({
2870
2903
  }
2871
2904
  if (!P && !u && !p)
2872
2905
  return await t.updateTask(d, h);
2873
- const T = Ye(d, P, u, p), C = await t.moveTask(d, T);
2906
+ const T = He(d, P, u, p), C = await t.moveTask(d, T);
2874
2907
  return Object.keys(h).length > 0 ? await t.updateTask(d, h) : C;
2875
2908
  }), r = (await Promise.all(n)).filter(
2876
2909
  (a) => a !== void 0
2877
2910
  ), i = r.map(O);
2878
2911
  return {
2879
- textContent: to({
2912
+ textContent: so({
2880
2913
  tasks: i,
2881
2914
  args: e
2882
2915
  }),
@@ -2892,7 +2925,7 @@ const Xs = s.object({
2892
2925
  };
2893
2926
  }
2894
2927
  };
2895
- function to({
2928
+ function so({
2896
2929
  tasks: e,
2897
2930
  args: t
2898
2931
  }) {
@@ -2903,10 +2936,10 @@ function to({
2903
2936
  showDetails: e.length <= 5
2904
2937
  });
2905
2938
  }
2906
- function so({ id: e, ...t }) {
2939
+ function oo({ id: e, ...t }) {
2907
2940
  return Object.keys(t).length > 0;
2908
2941
  }
2909
- const oo = {}, no = {
2942
+ const no = {}, ro = {
2910
2943
  type: s.literal("user_info").describe("The type of the response."),
2911
2944
  userId: s.string().describe("The user ID."),
2912
2945
  fullName: s.string().describe("The full name of the user."),
@@ -2923,28 +2956,28 @@ const oo = {}, no = {
2923
2956
  email: s.string().describe("The email address of the user."),
2924
2957
  plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
2925
2958
  };
2926
- function ro(e) {
2959
+ function io(e) {
2927
2960
  return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
2928
2961
  }
2929
- function io(e, t) {
2962
+ function ao(e, t) {
2930
2963
  const n = ((e.getDay() || 7) - t + 7) % 7, r = new Date(e);
2931
2964
  return r.setDate(e.getDate() - n), r;
2932
2965
  }
2933
- function ao(e) {
2966
+ function co(e) {
2934
2967
  const t = new Date(e);
2935
2968
  return t.setDate(e.getDate() + 6), t;
2936
2969
  }
2937
- function co(e) {
2970
+ function lo(e) {
2938
2971
  const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
2939
2972
  return Math.ceil((o + t.getDay() + 1) / 7);
2940
2973
  }
2941
- function lo(e) {
2974
+ function uo(e) {
2942
2975
  return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
2943
2976
  }
2944
- function z(e) {
2977
+ function H(e) {
2945
2978
  return e.toISOString().split("T")[0] ?? "";
2946
2979
  }
2947
- function uo(e) {
2980
+ function po(e) {
2948
2981
  try {
2949
2982
  return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
2950
2983
  } catch {
@@ -2952,9 +2985,9 @@ function uo(e) {
2952
2985
  }
2953
2986
  }
2954
2987
  function xe(e) {
2955
- return uo(e) ? e : "UTC";
2988
+ return po(e) ? e : "UTC";
2956
2989
  }
2957
- function po(e, t) {
2990
+ function ho(e, t) {
2958
2991
  const o = xe(t);
2959
2992
  return e.toLocaleString("en-US", {
2960
2993
  timeZone: o,
@@ -2967,8 +3000,8 @@ function po(e, t) {
2967
3000
  hour12: !1
2968
3001
  });
2969
3002
  }
2970
- async function ho(e) {
2971
- const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", n = xe(o), r = /* @__PURE__ */ new Date(), i = po(r, n), c = t.startDay ?? 1, a = lo(c), d = ro(t), l = new Date(r.toLocaleString("en-US", { timeZone: n })), u = io(l, c), p = ao(u), b = co(l), y = [
3003
+ async function mo(e) {
3004
+ const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", n = xe(o), r = /* @__PURE__ */ new Date(), i = ho(r, n), c = t.startDay ?? 1, a = uo(c), d = io(t), l = new Date(r.toLocaleString("en-US", { timeZone: n })), u = ao(l, c), p = co(u), b = lo(l), y = [
2972
3005
  "# User Information",
2973
3006
  "",
2974
3007
  `**User ID:** ${t.id}`,
@@ -2980,8 +3013,8 @@ async function ho(e) {
2980
3013
  "## Week Settings",
2981
3014
  `**Week Start Day:** ${a} (${c})`,
2982
3015
  `**Current Week:** Week ${b}`,
2983
- `**Week Start Date:** ${z(u)}`,
2984
- `**Week End Date:** ${z(p)}`,
3016
+ `**Week Start Date:** ${H(u)}`,
3017
+ `**Week End Date:** ${H(p)}`,
2985
3018
  "",
2986
3019
  "## Daily Progress",
2987
3020
  `**Completed Today:** ${t.completedToday}`,
@@ -2999,8 +3032,8 @@ async function ho(e) {
2999
3032
  currentLocalTime: i,
3000
3033
  startDay: c,
3001
3034
  startDayName: a,
3002
- weekStartDate: z(u),
3003
- weekEndDate: z(p),
3035
+ weekStartDate: H(u),
3036
+ weekEndDate: H(p),
3004
3037
  currentWeekNumber: b,
3005
3038
  completedToday: t.completedToday,
3006
3039
  dailyGoal: t.dailyGoal,
@@ -3010,19 +3043,20 @@ async function ho(e) {
3010
3043
  };
3011
3044
  return { textContent: y, structuredContent: k };
3012
3045
  }
3013
- const mo = {
3046
+ const fo = {
3014
3047
  name: g.USER_INFO,
3015
3048
  description: "Get comprehensive user information including user ID, full name, email, timezone with current local time, week start day preferences, current week dates, daily/weekly goal progress, and user plan (Free/Pro/Business).",
3016
- parameters: oo,
3017
- outputSchema: no,
3049
+ parameters: no,
3050
+ outputSchema: ro,
3051
+ mutability: "readonly",
3018
3052
  async execute(e, t) {
3019
- const o = await ho(t);
3053
+ const o = await mo(t);
3020
3054
  return {
3021
3055
  textContent: o.textContent,
3022
3056
  structuredContent: o.structuredContent
3023
3057
  };
3024
3058
  }
3025
- }, fo = `
3059
+ }, bo = `
3026
3060
  ## Todoist Task and Project Management Tools
3027
3061
 
3028
3062
  You have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.
@@ -3090,41 +3124,41 @@ You have access to comprehensive Todoist management tools for personal productiv
3090
3124
 
3091
3125
  Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
3092
3126
  `;
3093
- function ko({ todoistApiKey: e, baseUrl: t }) {
3127
+ function wo({ todoistApiKey: e, baseUrl: t }) {
3094
3128
  const o = new Ue(
3095
3129
  { name: "todoist-mcp-server", version: "0.1.0" },
3096
3130
  {
3097
3131
  capabilities: {
3098
3132
  tools: { listChanged: !0 }
3099
3133
  },
3100
- instructions: fo
3134
+ instructions: bo
3101
3135
  }
3102
3136
  ), n = new Ae(e, { baseUrl: t });
3103
- return I(yt, o, n), I(vt, o, n), I(eo, o, n), I(us, o, n), I(fs, o, n), I(Ht, o, n), I(nt, o, n), I(Ys, o, n), I(ss, o, n), I(dt, o, n), I(qs, o, n), I(as, o, n), I(Qe, o, n), I(Bt, o, n), I(Fs, o, n), I(Ot, o, n), I(Cs, o, n), I(Dt, o, n), I(mo, o, n), I(Xt, o, n), I(Us, o, n), I(Os, o, n), I(Ut, o, n), o;
3137
+ return I(It, o, n), I(Ct, o, n), I(to, o, n), I(ps, o, n), I(bs, o, n), I(Vt, o, n), I(rt, o, n), I(Hs, o, n), I(os, o, n), I(lt, o, n), I(Js, o, n), I(cs, o, n), I(et, o, n), I(Wt, o, n), I(Rs, o, n), I(_t, o, n), I(Ss, o, n), I(xt, o, n), I(fo, o, n), I(Zt, o, n), I(Ps, o, n), I(_s, o, n), I(Pt, o, n), o;
3104
3138
  }
3105
3139
  export {
3106
- Xt as a,
3107
- Cs as b,
3108
- Ot as c,
3109
- Dt as d,
3110
- Bt as e,
3111
- Ut as f,
3112
- ko as g,
3113
- Fs as h,
3114
- Qe as i,
3115
- as as j,
3116
- qs as k,
3117
- dt as l,
3118
- Us as m,
3119
- ss as n,
3120
- Ys as o,
3121
- nt as p,
3122
- Ht as q,
3123
- fs as r,
3124
- Os as s,
3125
- us as t,
3126
- mo as u,
3127
- eo as v,
3128
- vt as w,
3129
- yt as x
3140
+ Zt as a,
3141
+ Ss as b,
3142
+ _t as c,
3143
+ xt as d,
3144
+ Wt as e,
3145
+ Pt as f,
3146
+ wo as g,
3147
+ Rs as h,
3148
+ et as i,
3149
+ cs as j,
3150
+ Js as k,
3151
+ lt as l,
3152
+ Ps as m,
3153
+ os as n,
3154
+ Hs as o,
3155
+ rt as p,
3156
+ Vt as q,
3157
+ bs as r,
3158
+ _s as s,
3159
+ ps as t,
3160
+ fo as u,
3161
+ to as v,
3162
+ Ct as w,
3163
+ It as x
3130
3164
  };