@softeria/ms-365-mcp-server 0.20.0 → 0.20.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.
@@ -89,7 +89,25 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
89
89
  queryParams[fixedParamName] = `${paramValue}`;
90
90
  break;
91
91
  case "Body":
92
- body = paramValue;
92
+ if (paramDef.schema) {
93
+ const parseResult = paramDef.schema.safeParse(paramValue);
94
+ if (!parseResult.success) {
95
+ const wrapped = { [paramName]: paramValue };
96
+ const wrappedResult = paramDef.schema.safeParse(wrapped);
97
+ if (wrappedResult.success) {
98
+ logger.info(
99
+ `Auto-corrected parameter '${paramName}': AI passed nested field directly, wrapped it as {${paramName}: ...}`
100
+ );
101
+ body = wrapped;
102
+ } else {
103
+ body = paramValue;
104
+ }
105
+ } else {
106
+ body = paramValue;
107
+ }
108
+ } else {
109
+ body = paramValue;
110
+ }
93
111
  break;
94
112
  case "Header":
95
113
  headers[fixedParamName] = `${paramValue}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
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",