snow-flow 3.0.27 → 3.1.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.
@@ -132,7 +132,7 @@ class ServiceNowOperationsMCP {
132
132
  // 🎯 UNIVERSAL TABLE QUERY - Works for ANY ServiceNow table!
133
133
  {
134
134
  name: 'snow_query_table',
135
- description: 'Universal query tool for any ServiceNow table. SMART ANALYTICS: For analysis use limit:99999 with minimal fields. For display use limit:50. For counting use include_content:false. See CLAUDE.md for query patterns.',
135
+ description: 'Universal query tool for any ServiceNow table. SMART ANALYTICS: OMIT limit for ALL records with minimal fields. For display use limit:50. For counting use include_content:false. See CLAUDE.md for optimal query patterns.',
136
136
  inputSchema: {
137
137
  type: 'object',
138
138
  properties: {
@@ -147,8 +147,8 @@ class ServiceNowOperationsMCP {
147
147
  },
148
148
  limit: {
149
149
  type: 'number',
150
- description: 'Maximum records. For analytics: 99999 (get ALL data with minimal fields). For display: 10-50. For ML: 5000+. NO DEFAULT - think about your use case!',
151
- examples: [99999, 50, 5000, 10]
150
+ description: 'Maximum records to return. OMIT for analytics (gets ALL records). Use 10-50 for display, 5000+ for ML training. No default - system auto-detects best approach.',
151
+ examples: [50, 1000, 5000]
152
152
  },
153
153
  include_content: {
154
154
  type: 'boolean',
@@ -844,7 +844,7 @@ class ServiceNowOperationsMCP {
844
844
  (fields && fields.length <= 2); // Minimal fields = analytics
845
845
  if (isAnalyticsContext) {
846
846
  logger_js_1.logger.info(`📊 Analytics context detected - NO LIMIT applied for complete analysis`);
847
- return 99999; // Get ALL data for accurate analytics
847
+ return undefined; // No limit - get ALL records
848
848
  }
849
849
  // 🤖 ML Training context
850
850
  const isMLContext = query?.toLowerCase().includes('train') ||
@@ -871,6 +871,8 @@ class ServiceNowOperationsMCP {
871
871
  const { table, query, include_content = false, fields, include_display_values = false, group_by, order_by } = args;
872
872
  // Apply intelligent limit strategy
873
873
  const limit = determineSmartLimit(args.limit, table, query, include_content || !!fields, fields);
874
+ // For analytics, we want NO limit at all
875
+ const effectiveLimit = limit === undefined ? 999999 : limit; // ServiceNow max is usually 10000 per call
874
876
  // 🚨 ML Training Warning for low limits
875
877
  const isMLTrainingContext = query?.toLowerCase().includes('train') ||
876
878
  query?.toLowerCase().includes('ml') ||
@@ -878,7 +880,7 @@ class ServiceNowOperationsMCP {
878
880
  if (isMLTrainingContext && limit < 1000) {
879
881
  logger_js_1.logger.warn(`⚠️ ML Training detected with low limit (${limit}). Consider setting limit=5000+ for better training data!`);
880
882
  }
881
- logger_js_1.logger.info(`Universal query on table '${table}' with: ${query} (limit: ${limit}, include_content: ${include_content})`);
883
+ logger_js_1.logger.info(`Universal query on table '${table}' with: ${query} (limit: ${limit === undefined ? 'UNLIMITED' : limit}, include_content: ${include_content})`);
882
884
  try {
883
885
  // Convert natural language to ServiceNow query if needed
884
886
  const processedQuery = this.processNaturalLanguageQuery(query, table);
@@ -890,7 +892,7 @@ class ServiceNowOperationsMCP {
890
892
  finalQuery += `^ORDERBY${orderDirection}${orderField}`;
891
893
  }
892
894
  // Query the table
893
- const records = await this.client.searchRecords(table, finalQuery, limit);
895
+ const records = await this.client.searchRecords(table, finalQuery, effectiveLimit);
894
896
  let result = {
895
897
  table: table,
896
898
  total_results: records.success ? records.data.result.length : 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.0.27",
3
+ "version": "3.1.0",
4
4
  "description": "Snow-Flow v3.0.18: DIRECT API VERIFICATION! 🚀 Replaced unreliable searchRecords with direct API calls (snow_query_table style) for widget verification. All null/403 error recovery now uses GET /api/now/table/sp_widget with precise queries. NO MORE FALSE NEGATIVES - verification works consistently every time!",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",