@softeria/ms-365-mcp-server 0.125.0 → 0.125.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.
@@ -178,7 +178,7 @@ class GraphClient {
178
178
  const removeODataProps2 = (obj) => {
179
179
  if (typeof obj === "object" && obj !== null) {
180
180
  Object.keys(obj).forEach((key) => {
181
- if (key.startsWith("@odata.") && key !== "@odata.nextLink") {
181
+ if (key.startsWith("@odata.") && key !== "@odata.nextLink" && key !== "@odata.deltaLink") {
182
182
  delete obj[key];
183
183
  } else if (typeof obj[key] === "object") {
184
184
  removeODataProps2(obj[key]);
@@ -207,7 +207,7 @@ class GraphClient {
207
207
  const removeODataProps = (obj) => {
208
208
  if (typeof obj === "object" && obj !== null) {
209
209
  Object.keys(obj).forEach((key) => {
210
- if (key.startsWith("@odata.") && key !== "@odata.nextLink") {
210
+ if (key.startsWith("@odata.") && key !== "@odata.nextLink" && key !== "@odata.deltaLink") {
211
211
  delete obj[key];
212
212
  } else if (typeof obj[key] === "object") {
213
213
  removeODataProps(obj[key]);
@@ -23,6 +23,10 @@ const __dirname = path.dirname(__filename);
23
23
  const endpointsData = JSON.parse(
24
24
  readFileSync(path.join(__dirname, "endpoints.json"), "utf8")
25
25
  );
26
+ const TOP_UNSUPPORTED_DELTA_TOOLS = /* @__PURE__ */ new Set([
27
+ "list-calendar-events-delta",
28
+ "list-calendar-view-delta"
29
+ ]);
26
30
  function withApiVersionPrefix(description, config) {
27
31
  return config?.apiVersion === "beta" ? `[beta] ${description}` : description;
28
32
  }
@@ -304,6 +308,9 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
304
308
  logger.info(`OData param fallback: forwarded ${fixedParamName}=${paramValue}`);
305
309
  }
306
310
  }
311
+ if (TOP_UNSUPPORTED_DELTA_TOOLS.has(tool.alias)) {
312
+ delete queryParams["$top"];
313
+ }
307
314
  clampTopQueryParam(queryParams);
308
315
  const preferValues = [];
309
316
  if (config?.supportsTimezone && params.timezone) {
@@ -401,6 +408,7 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
401
408
  let pageCount = 1;
402
409
  const maxPages = positiveIntFromEnv("MS365_MCP_MAX_PAGES", DEFAULT_MAX_PAGES);
403
410
  const maxItems = positiveIntFromEnv("MS365_MCP_MAX_ITEMS", DEFAULT_MAX_ITEMS);
411
+ let deltaLink = combinedResponse["@odata.deltaLink"];
404
412
  while (nextLink && pageCount < maxPages && allItems.length < maxItems) {
405
413
  logger.info(`Fetching page ${pageCount + 1} from: ${nextLink}`);
406
414
  const url = new URL(nextLink);
@@ -413,6 +421,9 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
413
421
  allItems = allItems.concat(nextJsonResponse.value);
414
422
  }
415
423
  nextLink = nextJsonResponse["@odata.nextLink"];
424
+ if (nextJsonResponse["@odata.deltaLink"]) {
425
+ deltaLink = nextJsonResponse["@odata.deltaLink"];
426
+ }
416
427
  pageCount++;
417
428
  } else {
418
429
  break;
@@ -431,6 +442,9 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
431
442
  combinedResponse["@odata.count"] = allItems.length;
432
443
  }
433
444
  delete combinedResponse["@odata.nextLink"];
445
+ if (deltaLink) {
446
+ combinedResponse["@odata.deltaLink"] = deltaLink;
447
+ }
434
448
  response.content[0].text = JSON.stringify(combinedResponse);
435
449
  logger.info(
436
450
  `Pagination complete: collected ${allItems.length} items across ${pageCount} pages`
@@ -579,7 +593,10 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
579
593
  const key = paramSchema["$orderby"] !== void 0 ? "$orderby" : "orderby";
580
594
  paramSchema[key] = z.string().describe("Sort expression, e.g. receivedDateTime desc").optional();
581
595
  }
582
- if (paramSchema["top"] !== void 0 || paramSchema["$top"] !== void 0) {
596
+ if (TOP_UNSUPPORTED_DELTA_TOOLS.has(tool.alias)) {
597
+ delete paramSchema["top"];
598
+ delete paramSchema["$top"];
599
+ } else if (paramSchema["top"] !== void 0 || paramSchema["$top"] !== void 0) {
583
600
  const key = paramSchema["$top"] !== void 0 ? "$top" : "top";
584
601
  paramSchema[key] = z.number().describe(
585
602
  "Page size (Graph $top). Start small (e.g. 5\u201315) so responses fit the model context; raise only if needed. Use $select to return fewer fields per item. For more rows, use @odata.nextLink from the response instead of a very large $top."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.125.0",
3
+ "version": "0.125.1",
4
4
  "description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",