@softeria/ms-365-mcp-server 0.148.1 → 0.148.2

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.
@@ -42,6 +42,7 @@ import {
42
42
  CONFIRM_PARAM_DESCRIPTION,
43
43
  TIMEZONE_PARAM_DESCRIPTION,
44
44
  EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION,
45
+ getAcceptParamDescription,
45
46
  getAccountParamDescription,
46
47
  getFetchAllPagesParamDescription
47
48
  } from "./lib/param-descriptions.js";
@@ -968,6 +969,8 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
968
969
  const encodedValue = encodeURIComponent(paramValue).replace(/%3D/g, "=");
969
970
  path2 = path2.replace(`{${paramName}}`, encodedValue).replace(`:${paramName}`, encodedValue).replace(`{${camelCaseParamName}}`, encodedValue).replace(`:${camelCaseParamName}`, encodedValue);
970
971
  logger.info(`Path param fallback: replaced :${camelCaseParamName} with encoded value`);
972
+ } else if (paramName.toLowerCase() === "accept" && config?.acceptType) {
973
+ headers["Accept"] = `${paramValue}`;
971
974
  } else if (isOdataParam) {
972
975
  queryParams[fixedParamName] = `${paramValue}`;
973
976
  logger.info(`OData param fallback: forwarded ${fixedParamName}=${paramValue}`);
@@ -1053,7 +1056,7 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
1053
1056
  headers["Content-Type"] = config.contentType;
1054
1057
  logger.info(`Setting custom Content-Type: ${config.contentType}`);
1055
1058
  }
1056
- if (config?.acceptType) {
1059
+ if (config?.acceptType && !headers["Accept"]) {
1057
1060
  headers["Accept"] = config.acceptType;
1058
1061
  logger.info(`Setting custom Accept: ${config.acceptType}`);
1059
1062
  }
@@ -1318,6 +1321,9 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
1318
1321
  paramSchema[pathParamName] = z.string().describe(describePathParam(pathParamName));
1319
1322
  }
1320
1323
  }
1324
+ if (endpointConfig?.acceptType && paramSchema["Accept"] === void 0) {
1325
+ paramSchema["Accept"] = z.string().describe(getAcceptParamDescription(endpointConfig.acceptType)).optional();
1326
+ }
1321
1327
  if (isFetchAllPagesApplicable(tool)) {
1322
1328
  const maxPages = getMaxPages();
1323
1329
  paramSchema["fetchAllPages"] = z.boolean().describe(getFetchAllPagesParamDescription(maxPages)).optional();
@@ -39,6 +39,9 @@ const COUNT_PARAM_DESCRIPTION = "Set true to enable advanced query mode (Consist
39
39
  const CONFIRM_PARAM_DESCRIPTION = 'For destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: "confirmation_required" } without touching user data.';
40
40
  const TIMEZONE_PARAM_DESCRIPTION = 'IANA timezone name (e.g., "America/New_York", "Europe/London", "Asia/Tokyo") for calendar event times. If not specified, times are returned in UTC.';
41
41
  const EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION = "When true, expands singleValueExtendedProperties on each event. Use this to retrieve custom extended properties (e.g., sync metadata) stored on calendar events.";
42
+ function getAcceptParamDescription(acceptType) {
43
+ return `Accept header for the response representation. Defaults to "${acceptType}". Only set this when Graph asks for a different format \u2014 e.g. a 403 SpeakerAttributionNotAllowed on transcript content names the media type to retry with.`;
44
+ }
42
45
  function getAccountParamDescription(accountNames) {
43
46
  const accountHint = accountNames.length > 0 ? `Known accounts: ${accountNames.join(", ")}. ` : "";
44
47
  return `${accountHint}Microsoft account email to use for this request. Required when multiple accounts are configured. Use the list-accounts tool to discover all currently available accounts.`;
@@ -82,6 +85,7 @@ export {
82
85
  TIMEZONE_PARAM_DESCRIPTION,
83
86
  TOP_PARAM_DESCRIPTION,
84
87
  TOP_UNSUPPORTED_DELTA_TOOLS,
88
+ getAcceptParamDescription,
85
89
  getAccountParamDescription,
86
90
  getFetchAllPagesParamDescription,
87
91
  getMaxPages,
@@ -9,7 +9,8 @@ import {
9
9
  getAccountParamDescription,
10
10
  CONFIRM_PARAM_DESCRIPTION,
11
11
  TIMEZONE_PARAM_DESCRIPTION,
12
- EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION
12
+ EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION,
13
+ getAcceptParamDescription
13
14
  } from "./param-descriptions.js";
14
15
  function unwrapOptional(schema) {
15
16
  const def = schema._def;
@@ -83,6 +84,15 @@ function describeToolSchema(tool, config, ctx = {}) {
83
84
  schema: { type: "boolean" }
84
85
  });
85
86
  }
87
+ if (config?.acceptType && !params.some((p) => p.name.toLowerCase() === "accept")) {
88
+ params.push({
89
+ name: "Accept",
90
+ in: "Header",
91
+ required: false,
92
+ description: getAcceptParamDescription(config.acceptType),
93
+ schema: { type: "string" }
94
+ });
95
+ }
86
96
  const llmTip = config?.llmTip;
87
97
  return {
88
98
  name: tool.alias,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
3
  "mcpName": "io.github.Softeria/ms-365-mcp-server",
4
- "version": "0.148.1",
4
+ "version": "0.148.2",
5
5
  "description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",