@softeria/ms-365-mcp-server 0.20.3 → 0.21.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.
@@ -98,7 +98,7 @@ class GraphClient {
98
98
  try {
99
99
  logger.info(`Calling ${endpoint} with options: ${JSON.stringify(options)}`);
100
100
  const result = await this.makeRequest(endpoint, options);
101
- return this.formatJsonResponse(result, options.rawResponse);
101
+ return this.formatJsonResponse(result, options.rawResponse, options.excludeResponse);
102
102
  } catch (error) {
103
103
  logger.error(`Error in Graph API request: ${error}`);
104
104
  return {
@@ -107,7 +107,12 @@ class GraphClient {
107
107
  };
108
108
  }
109
109
  }
110
- formatJsonResponse(data, rawResponse = false) {
110
+ formatJsonResponse(data, rawResponse = false, excludeResponse = false) {
111
+ if (excludeResponse) {
112
+ return {
113
+ content: [{ type: "text", text: JSON.stringify({ success: true }) }]
114
+ };
115
+ }
111
116
  if (data && typeof data === "object" && "_headers" in data) {
112
117
  const responseData = data;
113
118
  const meta = {};
@@ -43,6 +43,7 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
43
43
  paramSchema["fetchAllPages"] = z.boolean().describe("Automatically fetch all pages of results").optional();
44
44
  }
45
45
  paramSchema["includeHeaders"] = z.boolean().describe("Include response headers (including ETag) in the response metadata").optional();
46
+ paramSchema["excludeResponse"] = z.boolean().describe("Exclude the full response body and only return success or failure indication").optional();
46
47
  server.tool(
47
48
  tool.alias,
48
49
  tool.description || `Execute ${tool.method.toUpperCase()} request to ${tool.path}`,
@@ -67,6 +68,9 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
67
68
  if (paramName === "includeHeaders") {
68
69
  continue;
69
70
  }
71
+ if (paramName === "excludeResponse") {
72
+ continue;
73
+ }
70
74
  const odataParams = [
71
75
  "filter",
72
76
  "select",
@@ -136,6 +140,9 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
136
140
  if (params.includeHeaders === true) {
137
141
  options.includeHeaders = true;
138
142
  }
143
+ if (params.excludeResponse === true) {
144
+ options.excludeResponse = true;
145
+ }
139
146
  logger.info(`Making graph request to ${path2} with options: ${JSON.stringify(options)}`);
140
147
  let response = await graphClient.graphRequest(path2, options);
141
148
  const fetchAllPages = params.fetchAllPages === true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.20.3",
3
+ "version": "0.21.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",