@softeria/ms-365-mcp-server 0.175.0 → 0.176.1

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/PRESETS.md CHANGED
@@ -6,28 +6,28 @@
6
6
 
7
7
  | Preset | Tools | Org mode | Description |
8
8
  | ----------------------------- | ----: | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
9
- | [`all`](#all) | 364 | | All available tools |
9
+ | [`all`](#all) | 369 | | All available tools |
10
10
  | [`calendar`](#calendar) | 47 | | Calendar and event management |
11
11
  | [`contacts`](#contacts) | 15 | | Outlook contacts management |
12
12
  | [`excel`](#excel) | 25 | | Excel spreadsheet operations |
13
13
  | [`files`](#files) | 25 | | OneDrive file and folder operations |
14
14
  | [`mail`](#mail) | 49 | | Email operations (read, send, manage folders, attachments) |
15
15
  | [`onedrive`](#onedrive) | 23 | | OneDrive app only: drive and file operations, excluding Excel |
16
- | [`onenote`](#onenote) | 28 | | OneNote notebook operations |
16
+ | [`onenote`](#onenote) | 29 | | OneNote notebook operations |
17
17
  | [`outlook`](#outlook) | 96 | | Outlook app only: mail, calendar and contacts |
18
- | [`personal`](#personal) | 175 | | Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search) |
18
+ | [`personal`](#personal) | 177 | | Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search) |
19
19
  | [`search`](#search) | 7 | | Microsoft Search capabilities |
20
- | [`tasks`](#tasks) | 34 | | Task and planning tools (To Do, Planner) |
20
+ | [`tasks`](#tasks) | 35 | | Task and planning tools (To Do, Planner) |
21
21
  | [`teams`](#teams) | 73 | required | Teams app only: chats, channels, meetings and presence |
22
22
  | [`teams-write`](#teams-write) | 11 | required | Teams send-only: send/reply in chats and channels, list chats/teams/channels by name, activity notifications - no message reading |
23
23
  | [`users`](#users) | 11 | required | User directory access |
24
- | [`work`](#work) | 187 | required | Organization/work tools (Teams, SharePoint, shared mailboxes, search) |
24
+ | [`work`](#work) | 190 | required | Organization/work tools (Teams, SharePoint, shared mailboxes, search) |
25
25
 
26
26
  ## `all`
27
27
 
28
28
  All available tools
29
29
 
30
- Tools (364):
30
+ Tools (369):
31
31
 
32
32
  - `accept-calendar-event`
33
33
  - `add-calendar-event-attachment`
@@ -202,6 +202,7 @@ Tools (364):
202
202
  - `get-sharepoint-site-item`
203
203
  - `get-sharepoint-site-list`
204
204
  - `get-sharepoint-site-list-item`
205
+ - `get-sharepoint-site-list-item-version`
205
206
  - `get-sharepoint-site-onenote-page-content`
206
207
  - `get-sharepoint-sites-delta`
207
208
  - `get-specific-calendar-event`
@@ -294,7 +295,9 @@ Tools (364):
294
295
  - `list-sharepoint-list-columns`
295
296
  - `list-sharepoint-site-drives`
296
297
  - `list-sharepoint-site-items`
298
+ - `list-sharepoint-site-list-item-versions`
297
299
  - `list-sharepoint-site-list-items`
300
+ - `list-sharepoint-site-list-items-delta`
298
301
  - `list-sharepoint-site-lists`
299
302
  - `list-sharepoint-site-onenote-notebook-section-groups`
300
303
  - `list-sharepoint-site-onenote-notebook-sections`
@@ -311,6 +314,7 @@ Tools (364):
311
314
  - `list-todo-checklist-items`
312
315
  - `list-todo-linked-resources`
313
316
  - `list-todo-task-lists`
317
+ - `list-todo-task-lists-delta`
314
318
  - `list-todo-tasks`
315
319
  - `list-trending-insights`
316
320
  - `list-user-direct-reports`
@@ -372,6 +376,7 @@ Tools (364):
372
376
  - `update-mail-rule`
373
377
  - `update-mailbox-settings`
374
378
  - `update-my-calendar-permission`
379
+ - `update-onenote-page-content`
375
380
  - `update-online-meeting`
376
381
  - `update-outlook-contact`
377
382
  - `update-place`
@@ -624,7 +629,7 @@ Tools (23):
624
629
 
625
630
  OneNote notebook operations
626
631
 
627
- Tools (28):
632
+ Tools (29):
628
633
 
629
634
  - `create-onenote-notebook`
630
635
  - `create-onenote-page`
@@ -653,6 +658,7 @@ Tools (28):
653
658
  - `list-sharepoint-site-onenote-section-group-section-groups`
654
659
  - `list-sharepoint-site-onenote-section-group-sections`
655
660
  - `list-sharepoint-site-onenote-section-pages`
661
+ - `update-onenote-page-content`
656
662
  - `update-sharepoint-site-onenote-page-content`
657
663
 
658
664
  ## `outlook`
@@ -762,7 +768,7 @@ Tools (96):
762
768
 
763
769
  Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search)
764
770
 
765
- Tools (175):
771
+ Tools (177):
766
772
 
767
773
  - `accept-calendar-event`
768
774
  - `add-calendar-event-attachment`
@@ -903,6 +909,7 @@ Tools (175):
903
909
  - `list-todo-checklist-items`
904
910
  - `list-todo-linked-resources`
905
911
  - `list-todo-task-lists`
912
+ - `list-todo-task-lists-delta`
906
913
  - `list-todo-tasks`
907
914
  - `list-trending-insights`
908
915
  - `merge-excel-range`
@@ -931,6 +938,7 @@ Tools (175):
931
938
  - `update-mail-rule`
932
939
  - `update-mailbox-settings`
933
940
  - `update-my-calendar-permission`
941
+ - `update-onenote-page-content`
934
942
  - `update-outlook-contact`
935
943
  - `update-specific-calendar-event`
936
944
  - `update-todo-checklist-item`
@@ -958,7 +966,7 @@ Tools (7):
958
966
 
959
967
  Task and planning tools (To Do, Planner)
960
968
 
961
- Tools (34):
969
+ Tools (35):
962
970
 
963
971
  - `create-planner-bucket`
964
972
  - `create-planner-plan`
@@ -986,6 +994,7 @@ Tools (34):
986
994
  - `list-todo-checklist-items`
987
995
  - `list-todo-linked-resources`
988
996
  - `list-todo-task-lists`
997
+ - `list-todo-task-lists-delta`
989
998
  - `list-todo-tasks`
990
999
  - `update-planner-bucket`
991
1000
  - `update-planner-plan`
@@ -1123,7 +1132,7 @@ Organization/work tools (Teams, SharePoint, shared mailboxes, search)
1123
1132
 
1124
1133
  Requires `--org-mode`.
1125
1134
 
1126
- Tools (187):
1135
+ Tools (190):
1127
1136
 
1128
1137
  - `add-group-member`
1129
1138
  - `add-group-owner`
@@ -1204,6 +1213,7 @@ Tools (187):
1204
1213
  - `get-sharepoint-site-item`
1205
1214
  - `get-sharepoint-site-list`
1206
1215
  - `get-sharepoint-site-list-item`
1216
+ - `get-sharepoint-site-list-item-version`
1207
1217
  - `get-sharepoint-site-onenote-page-content`
1208
1218
  - `get-sharepoint-sites-delta`
1209
1219
  - `get-team`
@@ -1255,7 +1265,9 @@ Tools (187):
1255
1265
  - `list-sharepoint-list-columns`
1256
1266
  - `list-sharepoint-site-drives`
1257
1267
  - `list-sharepoint-site-items`
1268
+ - `list-sharepoint-site-list-item-versions`
1258
1269
  - `list-sharepoint-site-list-items`
1270
+ - `list-sharepoint-site-list-items-delta`
1259
1271
  - `list-sharepoint-site-lists`
1260
1272
  - `list-sharepoint-site-onenote-notebook-section-groups`
1261
1273
  - `list-sharepoint-site-onenote-notebook-sections`
@@ -13,6 +13,29 @@ export function fixFunctionStylePaths(clientCode) {
13
13
  return clientCode.replace(/(path:\s*)'(\/[^']*\([^)]*=':[\w]+'[^)]*\)[^']*)'/g, '$1`$2`');
14
14
  }
15
15
 
16
+ /**
17
+ * openapi-zod-client emits zod 3 code. Rewrites the parts zod 4 rejects or treats differently:
18
+ * - `.strict()` and `.passthrough()` become `.loose()`, so unknown Graph properties pass
19
+ * through (#248).
20
+ * - one-argument `z.record(x)` gets the string key schema zod 4 requires.
21
+ * - `.uuid()` becomes `.guid()`; zod 4's `.uuid()` checks RFC variant bits that Microsoft
22
+ * ids such as skuId do not always have.
23
+ * - `.default(x)` becomes `.meta({ default: x })`. Every default sits in an optional field,
24
+ * where zod 3 left a missing value missing and zod 4 fills it in - SaveToSentItems: false
25
+ * on every send-mail. The JSON Schema still shows the default.
26
+ */
27
+ export function toZod4(clientCode) {
28
+ const code = clientCode
29
+ .replace(/\.(strict|passthrough)\(\)/g, '.loose()')
30
+ .replace(/z\.record\((?!z\.string\(\),)/g, 'z.record(z.string(), ')
31
+ .replace(/\.uuid\(\)/g, '.guid()')
32
+ .replace(/\.default\(([^()]*)\)/g, '.meta({ default: $1 })');
33
+ // A default the rewrite missed would quietly be sent to Graph again
34
+ const missed = code.match(/\.default\(.*/);
35
+ if (missed) throw new Error(`toZod4 could not rewrite ${missed[0].slice(0, 80)}`);
36
+ return code;
37
+ }
38
+
16
39
  export function generateMcpTools(openapiTrimmedFile, clientFilePath) {
17
40
  try {
18
41
  console.log(
@@ -37,7 +60,7 @@ export function generateMcpTools(openapiTrimmedFile, clientFilePath) {
37
60
  let clientCode = fs.readFileSync(clientFilePath, 'utf-8');
38
61
  clientCode = clientCode.replace(/'@zodios\/core';/, "'./hack.js';");
39
62
 
40
- clientCode = clientCode.replace(/\.strict\(\)/g, '.passthrough()');
63
+ clientCode = toZod4(clientCode);
41
64
 
42
65
  console.log('Stripping unused errors arrays from endpoint definitions...');
43
66
  // I didn't make up this crazy regex myself; you know who did. It seems works though.
@@ -285,7 +285,7 @@ describe("graph-tools", () => {
285
285
  method: "post",
286
286
  path: "/$batch",
287
287
  alias: "graph-batch",
288
- parameters: [{ name: "body", type: "Body", schema: z.object({}).passthrough() }]
288
+ parameters: [{ name: "body", type: "Body", schema: z.object({}).loose() }]
289
289
  });
290
290
  const config = makeConfig({
291
291
  pathPattern: "/$batch",
@@ -572,7 +572,7 @@ describe("graph-tools", () => {
572
572
  method: "post",
573
573
  path: "/me/messages",
574
574
  alias: "create-draft-email",
575
- parameters: [{ name: "body", type: "Body", schema: z.object({}).passthrough() }]
575
+ parameters: [{ name: "body", type: "Body", schema: z.object({}).loose() }]
576
576
  });
577
577
  const config = makeConfig({
578
578
  pathPattern: "/me/messages",
@@ -695,7 +695,7 @@ describe("graph-tools", () => {
695
695
  {
696
696
  name: "body",
697
697
  type: "Body",
698
- schema: z.object({ message: z.object({}).passthrough() })
698
+ schema: z.object({ message: z.object({}).loose() })
699
699
  }
700
700
  ]
701
701
  })
@@ -4300,7 +4300,7 @@ describe("graph-tools", () => {
4300
4300
  alias,
4301
4301
  method,
4302
4302
  path: "/chats/{chat-id}/messages",
4303
- parameters: [{ name: "body", type: "Body", schema: z.object({}).passthrough() }]
4303
+ parameters: [{ name: "body", type: "Body", schema: z.object({}).loose() }]
4304
4304
  })
4305
4305
  );
4306
4306
  mockEndpointsJson = [
@@ -1204,6 +1204,41 @@
1204
1204
  "presets": ["onenote", "personal"],
1205
1205
  "scopes": ["Notes.Read"]
1206
1206
  },
1207
+ {
1208
+ "pathPattern": "/me/onenote/pages/{onenotePage-id}/content",
1209
+ "method": "patch",
1210
+ "toolName": "update-onenote-page-content",
1211
+ "presets": ["onenote", "personal"],
1212
+ "scopes": ["Notes.ReadWrite"],
1213
+ "requestBodySchema": {
1214
+ "type": "array",
1215
+ "description": "Array of patchContentCommand objects applied in order to the page's HTML.",
1216
+ "items": {
1217
+ "type": "object",
1218
+ "required": ["target", "action"],
1219
+ "properties": {
1220
+ "target": {
1221
+ "type": "string",
1222
+ "description": "Element to change: a data-id, the generated id, or a known name like 'body' or 'title'."
1223
+ },
1224
+ "action": {
1225
+ "type": "string",
1226
+ "enum": ["append", "insert", "prepend", "replace", "delete"],
1227
+ "description": "What to do at the target. 'delete' takes no content."
1228
+ },
1229
+ "position": {
1230
+ "type": "string",
1231
+ "enum": ["after", "before"],
1232
+ "description": "For 'insert'/'append', whether content goes after (default) or before the target's content."
1233
+ },
1234
+ "content": {
1235
+ "type": "string",
1236
+ "description": "HTML to add. Required for all actions except 'delete'."
1237
+ }
1238
+ }
1239
+ }
1240
+ }
1241
+ },
1207
1242
  {
1208
1243
  "pathPattern": "/sites/{site-id}/onenote/notebooks",
1209
1244
  "method": "get",
@@ -1358,7 +1393,15 @@
1358
1393
  "presets": ["personal", "tasks"],
1359
1394
  "scopes": ["Tasks.Read"],
1360
1395
  "queryParams": ["top", "skip", "filter", "skiptoken"],
1361
- "llmTip": "Lists all To Do task lists. Returns todoTaskList-id needed for all task operations. The default list is typically called 'Tasks'."
1396
+ "llmTip": "If it returns only 'Flagged Emails', use list-todo-task-lists-delta instead."
1397
+ },
1398
+ {
1399
+ "pathPattern": "/me/todo/lists/delta()",
1400
+ "method": "get",
1401
+ "toolName": "list-todo-task-lists-delta",
1402
+ "presets": ["personal", "tasks"],
1403
+ "scopes": ["Tasks.ReadWrite"],
1404
+ "queryParams": ["select", "skiptoken"]
1362
1405
  },
1363
1406
  {
1364
1407
  "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks",
@@ -2172,6 +2215,28 @@
2172
2215
  "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
2173
2216
  "llmTip": "Add $expand=fields to include actual column values. Without it, only metadata is returned."
2174
2217
  },
2218
+ {
2219
+ "pathPattern": "/sites/{site-id}/lists/{list-id}/items/delta()",
2220
+ "method": "get",
2221
+ "toolName": "list-sharepoint-site-list-items-delta",
2222
+ "presets": ["work"],
2223
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]],
2224
+ "queryParams": ["select", "expand", "top"]
2225
+ },
2226
+ {
2227
+ "pathPattern": "/sites/{site-id}/lists/{list-id}/items/{listItem-id}/versions",
2228
+ "method": "get",
2229
+ "toolName": "list-sharepoint-site-list-item-versions",
2230
+ "presets": ["work"],
2231
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
2232
+ },
2233
+ {
2234
+ "pathPattern": "/sites/{site-id}/lists/{list-id}/items/{listItem-id}/versions/{listItemVersion-id}",
2235
+ "method": "get",
2236
+ "toolName": "get-sharepoint-site-list-item-version",
2237
+ "presets": ["work"],
2238
+ "workScopes": [["Sites.Read.All"], ["Sites.Selected"]]
2239
+ },
2175
2240
  {
2176
2241
  "pathPattern": "/sites/{site-id}/lists/{list-id}/items",
2177
2242
  "method": "post",