simply-outlook-mcp 0.0.1 → 0.0.3

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.
@@ -210,8 +210,9 @@ export class GraphService {
210
210
  const filterStr = filters.join(" and ");
211
211
  let query = this.graphClient.api("/me/messages").select(MAIL_PREVIEW_MESSAGE_PROPS).top(limit);
212
212
  // Graph search endpoint does not support MSA so use $search with limited functionalities
213
- query = searchQuery
214
- ? query.search(searchQuery)
213
+ const encodedQuery = searchQuery && encodeURIComponent(searchQuery);
214
+ query = encodedQuery
215
+ ? query.search(`"subject:${encodedQuery} OR body:${encodedQuery} OR from:${encodedQuery}"`)
215
216
  : query
216
217
  .filter(filterStr)
217
218
  .skip(skip || 0)
@@ -4,11 +4,11 @@ export const CREATE_CALENDAR_EVENT_WITH_INVITE_TOOL_NAME = "create-calendar-even
4
4
  const DEFAULT_EVENT_DURATION_MINUTES = 30;
5
5
  export const registerCreateCalendarEventWithInviteTool = async (server, graphService) => {
6
6
  server.tool(CREATE_CALENDAR_EVENT_WITH_INVITE_TOOL_NAME, "Create a calendar event in Outlook and send invitations to specified attendees. Use this tool when you need to invite other people to the event.", {
7
- subject: z.string().describe("The title/subject of the calendar event"),
8
- content: z
7
+ userEmails: z
9
8
  .string()
10
- .optional()
11
- .describe("Optional description or body content for the event. Must be in markdown or plain text format."),
9
+ .array()
10
+ .describe("Array of email addresses to invite as attendees. Each attendee will receive a calendar invitation. Use empty array [] if no attendees should be invited."),
11
+ subject: z.string().describe("The title/subject of the calendar event"),
12
12
  startDateTime: z
13
13
  .string()
14
14
  .describe("The event start date and time in ISO format using local time zone. Format: 'YYYY-MM-DDTHH:mm:ss' (e.g., '2025-12-25T14:30:00')"),
@@ -20,10 +20,10 @@ export const registerCreateCalendarEventWithInviteTool = async (server, graphSer
20
20
  .string()
21
21
  .optional()
22
22
  .describe("Optional location or venue for the event (e.g., 'Conference Room A', 'Zoom Meeting', 'Central Park')"),
23
- userEmails: z
23
+ content: z
24
24
  .string()
25
- .array()
26
- .describe("Array of email addresses to invite as attendees. Each attendee will receive a calendar invitation. Use empty array [] if no attendees should be invited."),
25
+ .optional()
26
+ .describe("Optional description or body content for the event. Must be in markdown or plain text format."),
27
27
  isMeeting: z
28
28
  .boolean()
29
29
  .optional()
@@ -39,7 +39,11 @@ export const registerCreateCalendarEventWithInviteTool = async (server, graphSer
39
39
  }
40
40
  const endDateTimeUtc = new Date(calculatedEndDateTime).toISOString();
41
41
  const eventData = await graphService.createCalendarEvent(subject, content || "", startDateTimeUtc, endDateTimeUtc, userEmails, location, isMeeting);
42
- return textToolResult([`Event created successfully:`, JSON.stringify(toCalendarEventResult(eventData))]);
42
+ return textToolResult([
43
+ `Do not show the event ID to the user.`,
44
+ `Event created successfully:`,
45
+ JSON.stringify(toCalendarEventResult(eventData)),
46
+ ]);
43
47
  }
44
48
  catch (error) {
45
49
  return getErrorToolResult(error, "Failed to create calendar event.");
@@ -5,10 +5,6 @@ const DEFAULT_EVENT_DURATION_MINUTES = 30;
5
5
  export const registerCreateCalendarEventTool = async (server, graphService) => {
6
6
  server.tool(CREATE_CALENDAR_EVENT_TOOL_NAME, "Create a personal calendar event in Outlook without sending invitations to other attendees. This creates a private event only on the user's calendar.", {
7
7
  subject: z.string().describe("The title/subject of the calendar event"),
8
- content: z
9
- .string()
10
- .optional()
11
- .describe("Optional description or body content for the event. Must be in markdown or plain text format."),
12
8
  startDateTime: z
13
9
  .string()
14
10
  .describe("The event start date and time in ISO format using local time zone. Format: 'YYYY-MM-DDTHH:mm:ss' (e.g., '2025-12-25T14:30:00')"),
@@ -20,6 +16,10 @@ export const registerCreateCalendarEventTool = async (server, graphService) => {
20
16
  .string()
21
17
  .optional()
22
18
  .describe("Optional location or venue for the event (e.g., 'Conference Room A', 'Airport', 'Central Park')"),
19
+ content: z
20
+ .string()
21
+ .optional()
22
+ .describe("Optional description or body content for the event. Must be in markdown or plain text format."),
23
23
  }, async ({ subject, content, startDateTime, endDateTime, location }) => {
24
24
  try {
25
25
  const startDateTimeUtc = new Date(startDateTime).toISOString();
@@ -31,7 +31,11 @@ export const registerCreateCalendarEventTool = async (server, graphService) => {
31
31
  }
32
32
  const endDateTimeUtc = new Date(calculatedEndDateTime).toISOString();
33
33
  const eventData = await graphService.createCalendarEvent(subject, content || "", startDateTimeUtc, endDateTimeUtc, undefined, location);
34
- return textToolResult([`Event created successfully:`, JSON.stringify(toCalendarEventResult(eventData))]);
34
+ return textToolResult([
35
+ `Do not show the event ID to the user.`,
36
+ `Event created successfully:`,
37
+ JSON.stringify(toCalendarEventResult(eventData)),
38
+ ]);
35
39
  }
36
40
  catch (error) {
37
41
  return getErrorToolResult(error, "Failed to create calendar event.");
@@ -51,7 +51,11 @@ export const registerGetCalendarEventsTool = async (server, graphService) => {
51
51
  if (!eventsData.length) {
52
52
  return textToolResult(["No calendar events found."]);
53
53
  }
54
- return textToolResult(["Calendar events found:", JSON.stringify(eventsData.map((event) => toCalendarEventResult(event)))]);
54
+ return textToolResult([
55
+ `Do not show the event ID to the user.`,
56
+ `There are ${eventsData.length} calendar events found:`,
57
+ JSON.stringify(eventsData.map((event) => toCalendarEventResult(event))),
58
+ ]);
55
59
  }
56
60
  catch (error) {
57
61
  return getErrorToolResult(error, "Failed to get calendar events.");
@@ -3,7 +3,9 @@ import { getErrorToolResult, textToolResult, toMailMessageResult } from "./tool-
3
3
  export const GET_OUTLOOK_MESSAGE_CONTENT_TOOL_NAME = "get-outlook-message-content";
4
4
  export const registerGetOutlookMessageContentTool = async (server, graphService) => {
5
5
  server.tool(GET_OUTLOOK_MESSAGE_CONTENT_TOOL_NAME, "Retrieve the full content of a specific Outlook mail message by its ID.", {
6
- id: z.string().describe("The unique identifier of the mail message to retrieve the content for."),
6
+ id: z
7
+ .string()
8
+ .describe("The unique identifier of the mail message to retrieve the content for. This is a base64-encoded string that uniquely identifies the message in the user's mailbox. Preserve the exact ID format including any trailing '=' padding characters."),
7
9
  }, async ({ id }) => {
8
10
  try {
9
11
  const messageData = await graphService.getOutlookMessageById(id);
@@ -36,7 +36,8 @@ export const registerGetOutlookMessagesTool = async (server, graphService) => {
36
36
  return textToolResult(["No Outlook messages found."]);
37
37
  }
38
38
  return textToolResult([
39
- `Outlook messages since ${utcDateTimeToLocal(receivedStartDateTimeUtc)}:`,
39
+ `Do not show the message ID to the user.`,
40
+ `There are ${messagesData.length} Outlook messages since ${utcDateTimeToLocal(receivedStartDateTimeUtc)}:`,
40
41
  JSON.stringify(messagesData.map((message) => toMailMessageResult(message))),
41
42
  ]);
42
43
  }
@@ -3,7 +3,9 @@ import { getErrorToolResult, textToolResult } from "./tool-utils.js";
3
3
  export const REPLY_OUTLOOK_MESSAGE_TOOL_NAME = "reply-outlook-message";
4
4
  export const registerReplyOutlookMessageTool = async (server, graphService) => {
5
5
  server.tool(REPLY_OUTLOOK_MESSAGE_TOOL_NAME, "Reply to an existing Outlook mail message with new content.", {
6
- messageId: z.string().describe("The unique identifier of the mail message to reply to."),
6
+ messageId: z
7
+ .string()
8
+ .describe("The unique identifier of the mail message to reply to. This is a base64-encoded string that uniquely identifies the message in the user's mailbox. Preserve the exact ID format including any trailing '=' padding characters."),
7
9
  content: z
8
10
  .string()
9
11
  .describe("The reply content/body of the email message. Supports Markdown formatting which will be converted to HTML."),
@@ -16,7 +18,10 @@ export const registerReplyOutlookMessageTool = async (server, graphService) => {
16
18
  throw new Error("Reply content cannot be empty.");
17
19
  }
18
20
  await graphService.replyOutlookMessage(messageId, content);
19
- return textToolResult([`Successfully sent reply to Outlook message with ID: ${messageId}`]);
21
+ return textToolResult([
22
+ `Do not show the message ID to the user.`,
23
+ `Successfully sent reply to Outlook message with ID: ${messageId}`,
24
+ ]);
20
25
  }
21
26
  catch (error) {
22
27
  return getErrorToolResult(error, "Failed to reply to Outlook message.");
@@ -23,7 +23,8 @@ export const registerSearchOutlookMessagesTool = async (server, graphService) =>
23
23
  return textToolResult(["No Outlook messages found."]);
24
24
  }
25
25
  return textToolResult([
26
- `Outlook messages matching keywords [${keywords}]:`,
26
+ `Do not show the message ID to the user.`,
27
+ `There are ${messagesData.length} Outlook messages matching keywords [${keywords}]:`,
27
28
  JSON.stringify(messagesData.map((message) => toMailMessageResult(message))),
28
29
  ]);
29
30
  }
@@ -3,12 +3,10 @@ import { getErrorToolResult, textToolResult, toCalendarEventResult } from "./too
3
3
  export const UPDATE_CALENDAR_EVENT_TOOL_NAME = "update-calendar-event";
4
4
  export const registerUpdateCalendarEventTool = async (server, graphService) => {
5
5
  server.tool(UPDATE_CALENDAR_EVENT_TOOL_NAME, "Update an existing calendar event in Outlook. You can modify the subject, content, start/end times, or location. At least one field must be provided to update.", {
6
- id: z.string().describe("The unique identifier of the calendar event to update"),
7
- subject: z.string().optional().describe("Optional new title/subject for the calendar event"),
8
- content: z
6
+ id: z
9
7
  .string()
10
- .optional()
11
- .describe("Optional new description or body content for the event. Must be in markdown or plain text format."),
8
+ .describe("This is a base64-encoded string that uniquely identifies the calendar event to update. Preserve the exact ID format including any trailing '=' padding characters."),
9
+ subject: z.string().optional().describe("Optional new title/subject for the calendar event"),
12
10
  startDateTime: z
13
11
  .string()
14
12
  .optional()
@@ -21,12 +19,20 @@ export const registerUpdateCalendarEventTool = async (server, graphService) => {
21
19
  .string()
22
20
  .optional()
23
21
  .describe("Optional new location or venue for the event (e.g., 'Conference Room A', 'Airport', 'Central Park'). Use empty string to remove location."),
22
+ content: z
23
+ .string()
24
+ .optional()
25
+ .describe("Optional new description or body content for the event. Must be in markdown or plain text format."),
24
26
  }, async ({ id, subject, content, startDateTime, endDateTime, location }) => {
25
27
  try {
26
28
  const startDateTimeUtc = startDateTime ? new Date(startDateTime).toISOString() : undefined;
27
29
  const endDateTimeUtc = endDateTime ? new Date(endDateTime).toISOString() : undefined;
28
30
  const eventData = await graphService.updateCalendarEvent(id, content, subject, startDateTimeUtc, endDateTimeUtc, location);
29
- return textToolResult([`Calendar event updated successfully:`, JSON.stringify(toCalendarEventResult(eventData))]);
31
+ return textToolResult([
32
+ `Do not show the event ID to the user.`,
33
+ `Calendar event updated successfully:`,
34
+ JSON.stringify(toCalendarEventResult(eventData)),
35
+ ]);
30
36
  }
31
37
  catch (error) {
32
38
  return getErrorToolResult(error, "Failed to update calendar event.");
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.0.1";
1
+ export declare const VERSION = "0.0.3";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.1';
1
+ export const VERSION = '0.0.3';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "type": "git",
20
20
  "url": "https://github.com/hmmroger/simply-outlook-mcp.git"
21
21
  },
22
- "version": "0.0.1",
22
+ "version": "0.0.3",
23
23
  "files": [
24
24
  "dist/**/*.js",
25
25
  "dist/**/*.d.ts",