@softeria/ms-365-mcp-server 0.133.1 → 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;
@@ -10,6 +10,7 @@
10
10
  "pathPattern": "/me/messages",
11
11
  "method": "get",
12
12
  "toolName": "list-mail-messages",
13
+ "descriptionOverride": "List, search, and filter Outlook email messages in the signed-in user's mailbox across all folders. Returns message metadata (subject, from, receivedDateTime, isRead, hasAttachments) plus a body preview. Use $search for keyword queries, $filter to narrow by sender/read state/date, $top to limit page size, and $select to trim fields.",
13
14
  "presets": ["mail", "outlook", "personal"],
14
15
  "scopes": ["Mail.Read"],
15
16
  "llmTip": "List read search my Outlook emails across folders. CRITICAL: When searching emails, the $search parameter value MUST be wrapped in double quotes. Format: $search=\"your search query here\". Use KQL (Keyword Query Language) syntax to search specific properties: 'from:', 'subject:', 'body:', 'to:', 'cc:', 'bcc:', 'attachment:', 'hasAttachments:', 'importance:', 'received:', 'sent:'. Examples: $search=\"from:john@example.com\" | $search=\"subject:meeting AND hasAttachments:true\" | $search=\"body:urgent AND received>=2024-01-01\" | $search=\"from:john AND importance:high\". Remember: ALWAYS wrap the entire search expression in double quotes! Reference: https://learn.microsoft.com/en-us/graph/search-query-parameter IMPORTANT: Always use $select to limit returned fields and reduce response size. Recommended default: $select=id,subject,from,toRecipients,receivedDateTime,bodyPreview,isRead,hasAttachments. Use bodyPreview instead of body for listings. To read the full email body, use get-mail-message with the specific message id."
@@ -72,6 +73,7 @@
72
73
  "pathPattern": "/me/messages/{message-id}",
73
74
  "method": "get",
74
75
  "toolName": "get-mail-message",
76
+ "descriptionOverride": "Get a single Outlook email message by its message ID, including full subject, sender, recipients, body, and attachment flags. Use list-mail-messages first to obtain the message ID.",
75
77
  "presets": ["mail", "outlook", "personal"],
76
78
  "scopes": ["Mail.Read"]
77
79
  },
@@ -157,6 +159,7 @@
157
159
  "pathPattern": "/me/messages",
158
160
  "method": "post",
159
161
  "toolName": "create-draft-email",
162
+ "descriptionOverride": "Create a draft Outlook email message in the signed-in user's Drafts folder. Set subject, body, toRecipients, ccRecipients, and importance. The draft is saved, not sent — use send-mail to send a message directly, or send the draft afterwards.",
160
163
  "presets": ["mail", "outlook", "personal"],
161
164
  "scopes": ["Mail.ReadWrite"]
162
165
  },
@@ -164,6 +167,7 @@
164
167
  "pathPattern": "/me/messages/{message-id}",
165
168
  "method": "delete",
166
169
  "toolName": "delete-mail-message",
170
+ "descriptionOverride": "Delete an Outlook email message by its message ID. This is a soft delete that moves the message to Deleted Items.",
167
171
  "presets": ["mail", "outlook", "personal"],
168
172
  "scopes": ["Mail.ReadWrite"],
169
173
  "llmTip": "Soft delete — moves to Deleted Items. To permanently delete, delete again from Deleted Items."
@@ -180,6 +184,7 @@
180
184
  "pathPattern": "/me/messages/{message-id}",
181
185
  "method": "patch",
182
186
  "toolName": "update-mail-message",
187
+ "descriptionOverride": "Update an existing Outlook email message by its message ID — for example mark it read or unread (isRead), flag it (flag), change its categories, importance, or edit a draft's subject, body, or recipients.",
183
188
  "presets": ["mail", "outlook", "personal"],
184
189
  "scopes": ["Mail.ReadWrite"]
185
190
  },
@@ -820,6 +825,7 @@
820
825
  "pathPattern": "/me/messages/{message-id}/$value",
821
826
  "method": "get",
822
827
  "toolName": "get-mail-message-mime",
828
+ "descriptionOverride": "Download the raw MIME source (RFC 822 .eml content) of an Outlook email message by its message ID. Returns the complete original message including headers and encoded attachments.",
823
829
  "presets": ["mail", "outlook", "personal"],
824
830
  "scopes": ["Mail.Read"],
825
831
  "acceptType": "text/plain",
@@ -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.1",
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",
@@ -10,6 +10,7 @@
10
10
  "pathPattern": "/me/messages",
11
11
  "method": "get",
12
12
  "toolName": "list-mail-messages",
13
+ "descriptionOverride": "List, search, and filter Outlook email messages in the signed-in user's mailbox across all folders. Returns message metadata (subject, from, receivedDateTime, isRead, hasAttachments) plus a body preview. Use $search for keyword queries, $filter to narrow by sender/read state/date, $top to limit page size, and $select to trim fields.",
13
14
  "presets": ["mail", "outlook", "personal"],
14
15
  "scopes": ["Mail.Read"],
15
16
  "llmTip": "List read search my Outlook emails across folders. CRITICAL: When searching emails, the $search parameter value MUST be wrapped in double quotes. Format: $search=\"your search query here\". Use KQL (Keyword Query Language) syntax to search specific properties: 'from:', 'subject:', 'body:', 'to:', 'cc:', 'bcc:', 'attachment:', 'hasAttachments:', 'importance:', 'received:', 'sent:'. Examples: $search=\"from:john@example.com\" | $search=\"subject:meeting AND hasAttachments:true\" | $search=\"body:urgent AND received>=2024-01-01\" | $search=\"from:john AND importance:high\". Remember: ALWAYS wrap the entire search expression in double quotes! Reference: https://learn.microsoft.com/en-us/graph/search-query-parameter IMPORTANT: Always use $select to limit returned fields and reduce response size. Recommended default: $select=id,subject,from,toRecipients,receivedDateTime,bodyPreview,isRead,hasAttachments. Use bodyPreview instead of body for listings. To read the full email body, use get-mail-message with the specific message id."
@@ -72,6 +73,7 @@
72
73
  "pathPattern": "/me/messages/{message-id}",
73
74
  "method": "get",
74
75
  "toolName": "get-mail-message",
76
+ "descriptionOverride": "Get a single Outlook email message by its message ID, including full subject, sender, recipients, body, and attachment flags. Use list-mail-messages first to obtain the message ID.",
75
77
  "presets": ["mail", "outlook", "personal"],
76
78
  "scopes": ["Mail.Read"]
77
79
  },
@@ -157,6 +159,7 @@
157
159
  "pathPattern": "/me/messages",
158
160
  "method": "post",
159
161
  "toolName": "create-draft-email",
162
+ "descriptionOverride": "Create a draft Outlook email message in the signed-in user's Drafts folder. Set subject, body, toRecipients, ccRecipients, and importance. The draft is saved, not sent — use send-mail to send a message directly, or send the draft afterwards.",
160
163
  "presets": ["mail", "outlook", "personal"],
161
164
  "scopes": ["Mail.ReadWrite"]
162
165
  },
@@ -164,6 +167,7 @@
164
167
  "pathPattern": "/me/messages/{message-id}",
165
168
  "method": "delete",
166
169
  "toolName": "delete-mail-message",
170
+ "descriptionOverride": "Delete an Outlook email message by its message ID. This is a soft delete that moves the message to Deleted Items.",
167
171
  "presets": ["mail", "outlook", "personal"],
168
172
  "scopes": ["Mail.ReadWrite"],
169
173
  "llmTip": "Soft delete — moves to Deleted Items. To permanently delete, delete again from Deleted Items."
@@ -180,6 +184,7 @@
180
184
  "pathPattern": "/me/messages/{message-id}",
181
185
  "method": "patch",
182
186
  "toolName": "update-mail-message",
187
+ "descriptionOverride": "Update an existing Outlook email message by its message ID — for example mark it read or unread (isRead), flag it (flag), change its categories, importance, or edit a draft's subject, body, or recipients.",
183
188
  "presets": ["mail", "outlook", "personal"],
184
189
  "scopes": ["Mail.ReadWrite"]
185
190
  },
@@ -820,6 +825,7 @@
820
825
  "pathPattern": "/me/messages/{message-id}/$value",
821
826
  "method": "get",
822
827
  "toolName": "get-mail-message-mime",
828
+ "descriptionOverride": "Download the raw MIME source (RFC 822 .eml content) of an Outlook email message by its message ID. Returns the complete original message including headers and encoded attachments.",
823
829
  "presets": ["mail", "outlook", "personal"],
824
830
  "scopes": ["Mail.Read"],
825
831
  "acceptType": "text/plain",