@softeria/ms-365-mcp-server 0.133.2 → 0.134.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.
@@ -48,6 +48,7 @@ function makeEndpoint(overrides = {}) {
48
48
  { name: "search", type: "Query", schema: z.string().optional() },
49
49
  { name: "select", type: "Query", schema: z.string().optional() },
50
50
  { name: "orderby", type: "Query", schema: z.string().optional() },
51
+ { name: "expand", type: "Query", schema: z.string().optional() },
51
52
  { name: "count", type: "Query", schema: z.boolean().optional() },
52
53
  { name: "top", type: "Query", schema: z.number().optional() },
53
54
  { name: "skip", type: "Query", schema: z.number().optional() }
@@ -378,6 +379,20 @@ describe("graph-tools", () => {
378
379
  expect(schema["top"].description).toContain("Start small");
379
380
  expect(schema["top"].description).toContain("$select");
380
381
  });
382
+ it("should describe $expand as navigation-properties-only", async () => {
383
+ const endpoint = makeEndpoint();
384
+ const config = makeConfig();
385
+ mockEndpoints.push(endpoint);
386
+ mockEndpointsJson = [config];
387
+ const server = createMockServer();
388
+ const { registerGraphTools } = await loadModule();
389
+ registerGraphTools(server, createMockGraphClient());
390
+ const schema = server.tools.get("test-tool").schema;
391
+ expect(schema["expand"]).toBeDefined();
392
+ expect(schema["expand"].description).not.toBe("Expand related entities");
393
+ expect(schema["expand"].description).toContain("navigation");
394
+ expect(schema["expand"].description).toContain("attachments");
395
+ });
381
396
  });
382
397
  describe("MS365_MCP_MAX_TOP", () => {
383
398
  const prevMaxTop = process.env.MS365_MCP_MAX_TOP;
@@ -1023,6 +1023,12 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
1023
1023
  const key = paramSchema["$select"] !== void 0 ? "$select" : "select";
1024
1024
  paramSchema[key] = z.string().describe("Comma-separated fields to return, e.g. id,subject,from,receivedDateTime").optional();
1025
1025
  }
1026
+ if (paramSchema["expand"] !== void 0 || paramSchema["$expand"] !== void 0) {
1027
+ const key = paramSchema["$expand"] !== void 0 ? "$expand" : "expand";
1028
+ paramSchema[key] = z.array(z.string()).describe(
1029
+ 'Navigation properties to inline, e.g. attachments on a message or event. Only navigation properties can be expanded: expanding a non-navigation property such as a message body fails with "Parsing OData Select and Expand failed", and an unsupported value may be ignored rather than reported. Request ordinary fields with $select instead.'
1030
+ ).optional();
1031
+ }
1026
1032
  if (paramSchema["orderby"] !== void 0 || paramSchema["$orderby"] !== void 0) {
1027
1033
  const key = paramSchema["$orderby"] !== void 0 ? "$orderby" : "orderby";
1028
1034
  paramSchema[key] = z.string().describe("Sort expression, e.g. receivedDateTime desc").optional();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.133.2",
3
+ "version": "0.134.0",
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",