snow-flow 2.8.9 → 2.9.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.
|
@@ -131,7 +131,7 @@ class ServiceNowOperationsMCP {
|
|
|
131
131
|
// 🎯 UNIVERSAL TABLE QUERY - Works for ANY ServiceNow table!
|
|
132
132
|
{
|
|
133
133
|
name: 'snow_query_table',
|
|
134
|
-
description: '🚀 Universal high-performance query tool for ANY ServiceNow table - optimized for memory efficiency',
|
|
134
|
+
description: '🚀 Universal high-performance query tool for ANY ServiceNow table - optimized for memory efficiency. SMART DEFAULTS: 1000 records (5000 for ML training contexts)',
|
|
135
135
|
inputSchema: {
|
|
136
136
|
type: 'object',
|
|
137
137
|
properties: {
|
|
@@ -146,8 +146,8 @@ class ServiceNowOperationsMCP {
|
|
|
146
146
|
},
|
|
147
147
|
limit: {
|
|
148
148
|
type: 'number',
|
|
149
|
-
description: 'Maximum number of results
|
|
150
|
-
default:
|
|
149
|
+
description: '🎯 Maximum number of results. SMART DEFAULTS: 1000 (normal queries), 5000 (ML training contexts). Set higher for large ML datasets (10000+)',
|
|
150
|
+
default: 1000
|
|
151
151
|
},
|
|
152
152
|
include_content: {
|
|
153
153
|
type: 'boolean',
|
|
@@ -828,8 +828,37 @@ class ServiceNowOperationsMCP {
|
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
async handleUniversalQuery(args) {
|
|
831
|
-
|
|
832
|
-
|
|
831
|
+
// 🎯 SMART DEFAULT LIMITS - Context-aware for ML training
|
|
832
|
+
const determineSmartLimit = (providedLimit, table, query, includeContent) => {
|
|
833
|
+
if (providedLimit !== undefined)
|
|
834
|
+
return providedLimit; // User explicitly set limit
|
|
835
|
+
// ML Training context detection
|
|
836
|
+
const isMLContext = query?.toLowerCase().includes('train') ||
|
|
837
|
+
query?.toLowerCase().includes('ml') ||
|
|
838
|
+
table?.toLowerCase().includes('train') ||
|
|
839
|
+
(includeContent && table === 'incident'); // ML often needs incident content
|
|
840
|
+
if (isMLContext) {
|
|
841
|
+
logger_js_1.logger.info(`🧠 ML context detected - using ML-optimized limit: 5000`);
|
|
842
|
+
return 5000; // ML training needs more data
|
|
843
|
+
}
|
|
844
|
+
// Count-only queries can handle more records efficiently
|
|
845
|
+
if (!includeContent) {
|
|
846
|
+
return 2000; // Count queries are memory-efficient
|
|
847
|
+
}
|
|
848
|
+
// Normal content queries
|
|
849
|
+
return 1000; // Balanced default for content queries
|
|
850
|
+
};
|
|
851
|
+
const { table, query, include_content = false, fields, include_display_values = false, group_by, order_by } = args;
|
|
852
|
+
// Apply smart limit logic
|
|
853
|
+
const limit = determineSmartLimit(args.limit, table, query, include_content || !!fields);
|
|
854
|
+
// 🚨 ML Training Warning for low limits
|
|
855
|
+
const isMLTrainingContext = query?.toLowerCase().includes('train') ||
|
|
856
|
+
query?.toLowerCase().includes('ml') ||
|
|
857
|
+
args.limit !== undefined && args.limit < 1000;
|
|
858
|
+
if (isMLTrainingContext && limit < 1000) {
|
|
859
|
+
logger_js_1.logger.warn(`⚠️ ML Training detected with low limit (${limit}). Consider setting limit=5000+ for better training data!`);
|
|
860
|
+
}
|
|
861
|
+
logger_js_1.logger.info(`Universal query on table '${table}' with: ${query} (limit: ${limit}, include_content: ${include_content})`);
|
|
833
862
|
try {
|
|
834
863
|
// Convert natural language to ServiceNow query if needed
|
|
835
864
|
const processedQuery = this.processNaturalLanguageQuery(query, table);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Snow-Flow: ServiceNow Advanced Intelligence Platform - 100+ real MCP tools with AI-powered swarm orchestration and neural networks. Dynamic task categorization using AI. Machine learning for incident classification, change risk prediction, and anomaly detection. Zero Mock Data, 100% Real API Integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|