@reproapp/mcp 0.0.1 → 0.0.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.
- package/package.json +1 -1
- package/src/index.js +28 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1279,11 +1279,38 @@ async function resolveScope(input, config, client) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
|
|
1281
1281
|
if (client && typeof client.executeTool === 'function') {
|
|
1282
|
-
return client.executeTool('resolve_scope', input);
|
|
1282
|
+
return client.executeTool('resolve_scope', sanitizeRemoteResolveScopeInput(input));
|
|
1283
1283
|
}
|
|
1284
1284
|
throw rpcError(-32602, 'appId or sessionId is required to resolve scope');
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
|
+
function sanitizeRemoteResolveScopeInput(input) {
|
|
1288
|
+
const sanitized = {};
|
|
1289
|
+
for (const key of ['tenantId', 'sessionId', 'appId']) {
|
|
1290
|
+
const value = optionalNonEmptyString(input[key]);
|
|
1291
|
+
if (value) {
|
|
1292
|
+
sanitized[key] = value;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
if (input.timeRange && typeof input.timeRange === 'object' && !Array.isArray(input.timeRange)) {
|
|
1297
|
+
const timeRange = {};
|
|
1298
|
+
const from = optionalNonEmptyString(input.timeRange.from);
|
|
1299
|
+
const to = optionalNonEmptyString(input.timeRange.to);
|
|
1300
|
+
if (from) {
|
|
1301
|
+
timeRange.from = from;
|
|
1302
|
+
}
|
|
1303
|
+
if (to) {
|
|
1304
|
+
timeRange.to = to;
|
|
1305
|
+
}
|
|
1306
|
+
if (Object.keys(timeRange).length > 0) {
|
|
1307
|
+
sanitized.timeRange = timeRange;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
return sanitized;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1287
1314
|
async function checkPrivacyCoverage(input, config, client) {
|
|
1288
1315
|
if (!client || typeof client.requestApi !== 'function') {
|
|
1289
1316
|
throw rpcError(-32603, 'This MCP client cannot fetch app privacy policies');
|