snow-flow 2.6.4 → 2.6.6

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.
Files changed (31) hide show
  1. package/dist/mcp/servicenow-development-assistant-mcp.js +29 -4
  2. package/dist/queen/queen-memory.d.ts +12 -6
  3. package/dist/queen/queen-memory.js +264 -187
  4. package/dist/queen/types.d.ts +1 -0
  5. package/dist/version.d.ts +1 -0
  6. package/dist/version.js +9 -0
  7. package/package.json +1 -1
  8. package/dist/mcp/example-refactored-server.d.ts +0 -18
  9. package/dist/mcp/example-refactored-server.js +0 -57
  10. package/dist/mcp/servicenow-automation-mcp-refactored.d.ts +0 -26
  11. package/dist/mcp/servicenow-automation-mcp-refactored.js +0 -632
  12. package/dist/mcp/servicenow-deployment-mcp-refactored.d.ts +0 -74
  13. package/dist/mcp/servicenow-deployment-mcp-refactored.js +0 -1044
  14. package/dist/mcp/servicenow-flow-composer-mcp-refactored.d.ts +0 -25
  15. package/dist/mcp/servicenow-flow-composer-mcp-refactored.js +0 -565
  16. package/dist/mcp/servicenow-graph-memory-mcp-refactored.d.ts +0 -32
  17. package/dist/mcp/servicenow-graph-memory-mcp-refactored.js +0 -642
  18. package/dist/mcp/servicenow-integration-mcp-refactored.d.ts +0 -24
  19. package/dist/mcp/servicenow-integration-mcp-refactored.js +0 -612
  20. package/dist/mcp/servicenow-intelligent-mcp-refactored.d.ts +0 -63
  21. package/dist/mcp/servicenow-intelligent-mcp-refactored.js +0 -782
  22. package/dist/mcp/servicenow-operations-mcp-refactored.d.ts +0 -63
  23. package/dist/mcp/servicenow-operations-mcp-refactored.js +0 -1770
  24. package/dist/mcp/servicenow-platform-development-mcp-refactored.d.ts +0 -25
  25. package/dist/mcp/servicenow-platform-development-mcp-refactored.js +0 -542
  26. package/dist/mcp/servicenow-reporting-analytics-mcp-refactored.d.ts +0 -26
  27. package/dist/mcp/servicenow-reporting-analytics-mcp-refactored.js +0 -648
  28. package/dist/mcp/servicenow-security-compliance-mcp-refactored.d.ts +0 -25
  29. package/dist/mcp/servicenow-security-compliance-mcp-refactored.js +0 -600
  30. package/dist/mcp/servicenow-update-set-mcp-refactored.d.ts +0 -31
  31. package/dist/mcp/servicenow-update-set-mcp-refactored.js +0 -662
@@ -1,648 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * servicenow-reporting-analytics MCP Server - REFACTORED
5
- * Uses BaseMCPServer to eliminate code duplication
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ServiceNowReportingAnalyticsMCP = void 0;
9
- const base_mcp_server_js_1 = require("./base-mcp-server.js");
10
- class ServiceNowReportingAnalyticsMCP extends base_mcp_server_js_1.BaseMCPServer {
11
- constructor() {
12
- super({
13
- name: 'servicenow-reporting-analytics',
14
- version: '2.0.0',
15
- description: 'Handles reports, dashboards, and analytics operations'
16
- });
17
- }
18
- setupTools() {
19
- // Tools are defined in getTools() method
20
- }
21
- getTools() {
22
- return [
23
- {
24
- name: 'snow_create_report',
25
- description: 'Create Report with dynamic table and field discovery - NO hardcoded values',
26
- inputSchema: {
27
- type: 'object',
28
- properties: {
29
- name: { type: 'string', description: 'Report name' },
30
- table: { type: 'string', description: 'Source table' },
31
- description: { type: 'string', description: 'Report description' },
32
- conditions: { type: 'string', description: 'Report conditions/filters' },
33
- fields: { type: 'array', description: 'Fields to include in report' },
34
- groupBy: { type: 'array', description: 'Group by fields' },
35
- aggregations: { type: 'array', description: 'Aggregation functions' },
36
- sortBy: { type: 'string', description: 'Sort field' },
37
- sortOrder: { type: 'string', description: 'Sort order (asc/desc)' },
38
- schedule: { type: 'string', description: 'Report schedule' },
39
- format: { type: 'string', description: 'Output format (PDF, Excel, CSV)' }
40
- },
41
- required: ['name', 'table', 'fields']
42
- }
43
- },
44
- {
45
- name: 'snow_create_dashboard',
46
- description: 'Create Dashboard with dynamic widget discovery',
47
- inputSchema: {
48
- type: 'object',
49
- properties: {
50
- name: { type: 'string', description: 'Dashboard name' },
51
- description: { type: 'string', description: 'Dashboard description' },
52
- layout: { type: 'string', description: 'Dashboard layout (grid, tabs, accordion)' },
53
- widgets: { type: 'array', description: 'Dashboard widgets configuration' },
54
- permissions: { type: 'array', description: 'User/role permissions' },
55
- refreshInterval: { type: 'number', description: 'Auto-refresh interval in minutes' },
56
- public: { type: 'boolean', description: 'Public dashboard' }
57
- },
58
- required: ['name', 'widgets']
59
- }
60
- },
61
- {
62
- name: 'snow_create_kpi',
63
- description: 'Create KPI with dynamic metric discovery',
64
- inputSchema: {
65
- type: 'object',
66
- properties: {
67
- name: { type: 'string', description: 'KPI name' },
68
- description: { type: 'string', description: 'KPI description' },
69
- table: { type: 'string', description: 'Source table' },
70
- metric: { type: 'string', description: 'Metric to measure' },
71
- aggregation: { type: 'string', description: 'Aggregation function (count, sum, avg, max, min)' },
72
- conditions: { type: 'string', description: 'KPI conditions/filters' },
73
- target: { type: 'number', description: 'Target value' },
74
- threshold: { type: 'object', description: 'Threshold configuration' },
75
- unit: { type: 'string', description: 'Unit of measurement' },
76
- frequency: { type: 'string', description: 'Update frequency' }
77
- },
78
- required: ['name', 'table', 'metric', 'aggregation']
79
- }
80
- },
81
- {
82
- name: 'snow_create_data_visualization',
83
- description: 'Create Data Visualization with dynamic chart discovery',
84
- inputSchema: {
85
- type: 'object',
86
- properties: {
87
- name: { type: 'string', description: 'Visualization name' },
88
- type: { type: 'string', description: 'Chart type (bar, line, pie, scatter, etc.)' },
89
- dataSource: { type: 'string', description: 'Data source (table or report)' },
90
- xAxis: { type: 'string', description: 'X-axis field' },
91
- yAxis: { type: 'string', description: 'Y-axis field' },
92
- series: { type: 'array', description: 'Data series configuration' },
93
- filters: { type: 'array', description: 'Chart filters' },
94
- colors: { type: 'array', description: 'Color palette' },
95
- interactive: { type: 'boolean', description: 'Interactive chart' }
96
- },
97
- required: ['name', 'type', 'dataSource']
98
- }
99
- },
100
- {
101
- name: 'snow_create_performance_analytics',
102
- description: 'Create Performance Analytics with dynamic metric discovery',
103
- inputSchema: {
104
- type: 'object',
105
- properties: {
106
- name: { type: 'string', description: 'Analytics name' },
107
- category: { type: 'string', description: 'Analytics category' },
108
- dataSource: { type: 'string', description: 'Data source table' },
109
- metrics: { type: 'array', description: 'Performance metrics to track' },
110
- dimensions: { type: 'array', description: 'Analysis dimensions' },
111
- timeframe: { type: 'string', description: 'Time period for _analysis' },
112
- benchmarks: { type: 'array', description: 'Performance benchmarks' },
113
- alerts: { type: 'array', description: 'Alert configurations' }
114
- },
115
- required: ['name', 'dataSource', 'metrics']
116
- }
117
- },
118
- {
119
- name: 'snow_create_scheduled_report',
120
- description: 'Create Scheduled Report with dynamic delivery discovery',
121
- inputSchema: {
122
- type: 'object',
123
- properties: {
124
- reportName: { type: 'string', description: 'Source report name' },
125
- schedule: { type: 'string', description: 'Schedule frequency' },
126
- recipients: { type: 'array', description: 'Email recipients' },
127
- format: { type: 'string', description: 'Report format (PDF, Excel, CSV)' },
128
- conditions: { type: 'string', description: 'Additional conditions' },
129
- subject: { type: 'string', description: 'Email subject' },
130
- message: { type: 'string', description: 'Email message' }
131
- },
132
- required: ['reportName', 'schedule', 'recipients']
133
- }
134
- },
135
- {
136
- name: 'snow_discover_reporting_tables',
137
- description: 'Discover all tables available for reporting',
138
- inputSchema: {
139
- type: 'object',
140
- properties: {
141
- category: { type: 'string', description: 'Table category filter' },
142
- hasData: { type: 'boolean', description: 'Only tables with data' }
143
- }
144
- }
145
- },
146
- {
147
- name: 'snow_discover_report_fields',
148
- description: 'Discover available fields for reporting on a table',
149
- inputSchema: {
150
- type: 'object',
151
- properties: {
152
- table: { type: 'string', description: 'Table name to analyze' },
153
- fieldType: { type: 'string', description: 'Filter by field type' }
154
- },
155
- required: ['table']
156
- }
157
- },
158
- {
159
- name: 'snow_analyze_data_quality',
160
- description: 'Analyze data quality for reporting',
161
- inputSchema: {
162
- type: 'object',
163
- properties: {
164
- table: { type: 'string', description: 'Table to analyze' },
165
- fields: { type: 'array', description: 'Specific fields to analyze' },
166
- checkCompleteness: { type: 'boolean', description: 'Check data completeness' },
167
- checkConsistency: { type: 'boolean', description: 'Check data consistency' },
168
- checkAccuracy: { type: 'boolean', description: 'Check data accuracy' }
169
- },
170
- required: ['table']
171
- }
172
- },
173
- {
174
- name: 'snow_generate_insights',
175
- description: 'Generate data insights and recommendations',
176
- inputSchema: {
177
- type: 'object',
178
- properties: {
179
- table: { type: 'string', description: 'Table to analyze' },
180
- analysisType: { type: 'string', description: 'Analysis type (trends, patterns, anomalies)' },
181
- timeframe: { type: 'string', description: 'Time period for _analysis' },
182
- generateRecommendations: { type: 'boolean', description: 'Generate recommendations' }
183
- },
184
- required: ['table']
185
- }
186
- },
187
- {
188
- name: 'snow_export_report_data',
189
- description: 'Export report data in various formats',
190
- inputSchema: {
191
- type: 'object',
192
- properties: {
193
- reportName: { type: 'string', description: 'Report name to export' },
194
- format: { type: 'string', description: 'Export format (CSV, Excel, JSON, XML)' },
195
- includeHeaders: { type: 'boolean', description: 'Include column headers' },
196
- maxRows: { type: 'number', description: 'Maximum rows to export' }
197
- },
198
- required: ['reportName', 'format']
199
- }
200
- }
201
- ];
202
- }
203
- async executeTool(name, args) {
204
- const startTime = Date.now();
205
- switch (name) {
206
- case 'snow_create_report':
207
- return await this.handleSnowCreateReport(args);
208
- case 'snow_create_dashboard':
209
- return await this.handleSnowCreateDashboard(args);
210
- case 'snow_create_kpi':
211
- return await this.handleSnowCreateKpi(args);
212
- case 'snow_create_data_visualization':
213
- return await this.handleSnowCreateDataVisualization(args);
214
- case 'snow_create_performance_analytics':
215
- return await this.handleSnowCreatePerformanceAnalytics(args);
216
- case 'snow_create_scheduled_report':
217
- return await this.handleSnowCreateScheduledReport(args);
218
- case 'snow_discover_reporting_tables':
219
- return await this.handleSnowDiscoverReportingTables(args);
220
- case 'snow_discover_report_fields':
221
- return await this.handleSnowDiscoverReportFields(args);
222
- case 'snow_analyze_data_quality':
223
- return await this.handleSnowAnalyzeDataQuality(args);
224
- case 'snow_generate_insights':
225
- return await this.handleSnowGenerateInsights(args);
226
- case 'snow_export_report_data':
227
- return await this.handleSnowExportReportData(args);
228
- default:
229
- return {
230
- success: false,
231
- error: `Unknown tool: ${name}`
232
- };
233
- }
234
- }
235
- // Tool handlers
236
- async handleSnowCreateReport(args) {
237
- const startTime = Date.now();
238
- try {
239
- const reportData = {
240
- name: args.name,
241
- table: args.table,
242
- description: args.description || '',
243
- filter: args.conditions || '',
244
- fields: args.fields.join(','),
245
- group_by: args.groupBy ? args.groupBy.join(',') : '',
246
- aggregation: args.aggregations ? args.aggregations.join(',') : '',
247
- sort_by: args.sortBy || '',
248
- sort_order: args.sortOrder || 'asc',
249
- schedule: args.schedule || '',
250
- format: args.format || 'PDF',
251
- active: true
252
- };
253
- const result = await this.client.createRecord('sys_report', reportData);
254
- return {
255
- success: result.success,
256
- result: result.result,
257
- error: result.success ? undefined : 'Failed to create report',
258
- executionTime: Date.now() - startTime
259
- };
260
- }
261
- catch (error) {
262
- return {
263
- success: false,
264
- error: error instanceof Error ? error.message : 'Failed to create report',
265
- executionTime: Date.now() - startTime
266
- };
267
- }
268
- }
269
- async handleSnowCreateDashboard(args) {
270
- const startTime = Date.now();
271
- try {
272
- const dashboardData = {
273
- name: args.name,
274
- description: args.description || '',
275
- layout: args.layout || 'grid',
276
- refresh_interval: args.refreshInterval || 0,
277
- is_public: args.public || false,
278
- active: true
279
- };
280
- // Create dashboard
281
- const dashboardResult = await this.client.createRecord('sys_dashboard', dashboardData);
282
- if (dashboardResult.success && args.widgets) {
283
- // Create widgets for the dashboard
284
- const dashboardId = Array.isArray(dashboardResult.result)
285
- ? dashboardResult.result[0]?.sys_id
286
- : dashboardResult.result?.sys_id || 'unknown';
287
- for (const widget of args.widgets) {
288
- await this.createDashboardWidget(dashboardId, widget);
289
- }
290
- }
291
- return {
292
- success: dashboardResult.success,
293
- result: dashboardResult.result,
294
- error: dashboardResult.success ? undefined : 'Failed to create dashboard',
295
- executionTime: Date.now() - startTime
296
- };
297
- }
298
- catch (error) {
299
- return {
300
- success: false,
301
- error: error instanceof Error ? error.message : 'Failed to create dashboard',
302
- executionTime: Date.now() - startTime
303
- };
304
- }
305
- }
306
- async handleSnowCreateKpi(args) {
307
- const startTime = Date.now();
308
- try {
309
- const kpiData = {
310
- name: args.name,
311
- description: args.description || '',
312
- table: args.table,
313
- field: args.metric,
314
- aggregate: args.aggregation,
315
- conditions: args.conditions || '',
316
- target_value: args.target || 0,
317
- unit: args.unit || '',
318
- frequency: args.frequency || 'daily',
319
- active: true
320
- };
321
- const result = await this.client.createRecord('sysauto_indicator', kpiData);
322
- return {
323
- success: result.success,
324
- result: result.result,
325
- error: result.success ? undefined : 'Failed to create KPI',
326
- executionTime: Date.now() - startTime
327
- };
328
- }
329
- catch (error) {
330
- return {
331
- success: false,
332
- error: error instanceof Error ? error.message : 'Failed to create KPI',
333
- executionTime: Date.now() - startTime
334
- };
335
- }
336
- }
337
- async handleSnowCreateDataVisualization(args) {
338
- const startTime = Date.now();
339
- try {
340
- const vizData = {
341
- name: args.name,
342
- type: args.type,
343
- data_source: args.dataSource,
344
- x_axis: args.xAxis || '',
345
- y_axis: args.yAxis || '',
346
- series: args.series ? JSON.stringify(args.series) : '',
347
- filters: args.filters ? JSON.stringify(args.filters) : '',
348
- colors: args.colors ? args.colors.join(',') : '',
349
- interactive: args.interactive !== false,
350
- active: true
351
- };
352
- const result = await this.client.createRecord('sys_visualization', vizData);
353
- return {
354
- success: result.success,
355
- result: result.result,
356
- error: result.success ? undefined : 'Failed to create data visualization',
357
- executionTime: Date.now() - startTime
358
- };
359
- }
360
- catch (error) {
361
- return {
362
- success: false,
363
- error: error instanceof Error ? error.message : 'Failed to create data visualization',
364
- executionTime: Date.now() - startTime
365
- };
366
- }
367
- }
368
- async handleSnowCreatePerformanceAnalytics(args) {
369
- const startTime = Date.now();
370
- try {
371
- const analyticsData = {
372
- name: args.name,
373
- category: args.category || 'general',
374
- table: args.dataSource,
375
- metrics: args.metrics.join(','),
376
- dimensions: args.dimensions ? args.dimensions.join(',') : '',
377
- timeframe: args.timeframe || 'monthly',
378
- benchmarks: args.benchmarks ? JSON.stringify(args.benchmarks) : '',
379
- alerts: args.alerts ? JSON.stringify(args.alerts) : '',
380
- active: true
381
- };
382
- const result = await this.client.createRecord('pa_cubes', analyticsData);
383
- return {
384
- success: result.success,
385
- result: result.result,
386
- error: result.success ? undefined : 'Failed to create performance analytics',
387
- executionTime: Date.now() - startTime
388
- };
389
- }
390
- catch (error) {
391
- return {
392
- success: false,
393
- error: error instanceof Error ? error.message : 'Failed to create performance analytics',
394
- executionTime: Date.now() - startTime
395
- };
396
- }
397
- }
398
- async handleSnowCreateScheduledReport(args) {
399
- const startTime = Date.now();
400
- try {
401
- // Find the source report
402
- const reportResponse = await this.client.searchRecords('sys_report', `name=${args.reportName}`, 1);
403
- if (!reportResponse.success || !reportResponse.data?.result?.length) {
404
- throw new Error(`Report not found: ${args.reportName}`);
405
- }
406
- const reportId = reportResponse.data.result[0].sys_id;
407
- const scheduleData = {
408
- report: reportId,
409
- schedule_type: args.schedule,
410
- recipients: args.recipients.join(','),
411
- format: args.format || 'PDF',
412
- conditions: args.conditions || '',
413
- subject: args.subject || `Scheduled Report: ${args.reportName}`,
414
- message: args.message || 'Please find the attached report.',
415
- active: true
416
- };
417
- const result = await this.client.createRecord('sys_report_schedule', scheduleData);
418
- return {
419
- success: result.success,
420
- result: result.result,
421
- error: result.success ? undefined : 'Failed to create scheduled report',
422
- executionTime: Date.now() - startTime
423
- };
424
- }
425
- catch (error) {
426
- return {
427
- success: false,
428
- error: error instanceof Error ? error.message : 'Failed to create scheduled report',
429
- executionTime: Date.now() - startTime
430
- };
431
- }
432
- }
433
- async handleSnowDiscoverReportingTables(args) {
434
- const startTime = Date.now();
435
- try {
436
- const tables = [];
437
- // Build query
438
- let query = '';
439
- if (args.hasData) {
440
- query = 'row_count>0';
441
- }
442
- // Discover tables
443
- const tableResponse = await this.client.searchRecords('sys_db_object', query, 100);
444
- if (tableResponse.success && tableResponse.data) {
445
- tables.push(...tableResponse.data.result.map((table) => ({
446
- name: table.name,
447
- label: table.label,
448
- row_count: table.row_count,
449
- category: table.super_class ? 'extended' : 'base',
450
- accessible: table.accessible
451
- })));
452
- }
453
- // Filter by category if specified
454
- const filteredTables = args.category
455
- ? tables.filter(t => t.category === args.category)
456
- : tables;
457
- return {
458
- success: true,
459
- result: { tables: filteredTables },
460
- executionTime: Date.now() - startTime
461
- };
462
- }
463
- catch (error) {
464
- return {
465
- success: false,
466
- error: error instanceof Error ? error.message : 'Failed to discover reporting tables',
467
- executionTime: Date.now() - startTime
468
- };
469
- }
470
- }
471
- async handleSnowDiscoverReportFields(args) {
472
- const startTime = Date.now();
473
- try {
474
- const fields = [];
475
- // Get fields for the table
476
- const fieldResponse = await this.client.searchRecords('sys_dictionary', `name=${args.table}^element!=NULL`, 100);
477
- if (fieldResponse.success && fieldResponse.data) {
478
- fields.push(...fieldResponse.data.result.map((field) => ({
479
- name: field.element,
480
- label: field.column_label,
481
- type: field.internal_type,
482
- reference: field.reference,
483
- choice: field.choice,
484
- max_length: field.max_length,
485
- mandatory: field.mandatory === 'true',
486
- calculated: field.virtual === 'true',
487
- reportable: field.attributes?.includes('report') !== false
488
- })));
489
- }
490
- // Filter by field type if specified
491
- const filteredFields = args.fieldType
492
- ? fields.filter(f => f.type === args.fieldType)
493
- : fields;
494
- return {
495
- success: true,
496
- result: { fields: filteredFields },
497
- executionTime: Date.now() - startTime
498
- };
499
- }
500
- catch (error) {
501
- return {
502
- success: false,
503
- error: error instanceof Error ? error.message : 'Failed to discover report fields',
504
- executionTime: Date.now() - startTime
505
- };
506
- }
507
- }
508
- async handleSnowAnalyzeDataQuality(args) {
509
- const startTime = Date.now();
510
- try {
511
- // This would be a complex _analysis in reality
512
- // For now, simulate data quality analysis
513
- const _analysis = {
514
- table: args.table,
515
- total_records: Math.floor(Math.random() * 10000) + 1000,
516
- fields_analyzed: args.fields?.length || 'all',
517
- completeness: args.checkCompleteness ? {
518
- score: 94.5,
519
- missing_values: 234,
520
- null_fields: ['description', 'notes']
521
- } : null,
522
- consistency: args.checkConsistency ? {
523
- score: 87.3,
524
- inconsistent_formats: 45,
525
- duplicate_records: 12
526
- } : null,
527
- accuracy: args.checkAccuracy ? {
528
- score: 91.2,
529
- validation_errors: 78,
530
- outliers: 23
531
- } : null,
532
- overall_quality_score: 91.0,
533
- recommendations: [
534
- 'Standardize date formats across all fields',
535
- 'Implement validation rules for email fields',
536
- 'Remove duplicate entries in customer table'
537
- ]
538
- };
539
- return {
540
- success: true,
541
- result: _analysis,
542
- executionTime: Date.now() - startTime
543
- };
544
- }
545
- catch (error) {
546
- return {
547
- success: false,
548
- error: error instanceof Error ? error.message : 'Failed to analyze data quality',
549
- executionTime: Date.now() - startTime
550
- };
551
- }
552
- }
553
- async handleSnowGenerateInsights(args) {
554
- const startTime = Date.now();
555
- try {
556
- // Simulate insight generation
557
- const insights = {
558
- table: args.table,
559
- analysis_type: args.analysisType || 'trends',
560
- timeframe: args.timeframe || 'last_30_days',
561
- key_findings: [
562
- 'Incident volume increased by 23% in the last week',
563
- 'Average resolution time improved by 15%',
564
- 'Peak incident hours are between 9 AM and 11 AM'
565
- ],
566
- patterns: [
567
- { type: 'seasonal', description: 'Higher volume on Mondays' },
568
- { type: 'correlation', description: 'Priority 1 incidents correlate with system outages' }
569
- ],
570
- anomalies: [
571
- { date: '2024-01-15', description: 'Unusual spike in network incidents' }
572
- ],
573
- recommendations: args.generateRecommendations ? [
574
- 'Increase staffing during peak hours',
575
- 'Implement proactive monitoring for high-risk systems',
576
- 'Create automation for common incident types'
577
- ] : []
578
- };
579
- return {
580
- success: true,
581
- result: insights,
582
- executionTime: Date.now() - startTime
583
- };
584
- }
585
- catch (error) {
586
- return {
587
- success: false,
588
- error: error instanceof Error ? error.message : 'Failed to generate insights',
589
- executionTime: Date.now() - startTime
590
- };
591
- }
592
- }
593
- async handleSnowExportReportData(args) {
594
- const startTime = Date.now();
595
- try {
596
- // Find the report
597
- const reportResponse = await this.client.searchRecords('sys_report', `name=${args.reportName}`, 1);
598
- if (!reportResponse.success || !reportResponse.data?.result?.length) {
599
- throw new Error(`Report not found: ${args.reportName}`);
600
- }
601
- const report = reportResponse.data.result[0];
602
- // Simulate export
603
- const exportResult = {
604
- report_name: report.name,
605
- export_format: args.format,
606
- include_headers: args.includeHeaders !== false,
607
- max_rows: args.maxRows || 10000,
608
- export_date: new Date().toISOString(),
609
- file_size: Math.floor(Math.random() * 5000) + 1000,
610
- download_url: `/api/now/export/report/${report.sys_id}/${args.format.toLowerCase()}`,
611
- expires_in: '24 hours'
612
- };
613
- return {
614
- success: true,
615
- result: exportResult,
616
- executionTime: Date.now() - startTime
617
- };
618
- }
619
- catch (error) {
620
- return {
621
- success: false,
622
- error: error instanceof Error ? error.message : 'Failed to export report data',
623
- executionTime: Date.now() - startTime
624
- };
625
- }
626
- }
627
- // Helper methods
628
- async createDashboardWidget(dashboardId, widget) {
629
- const widgetData = {
630
- dashboard: dashboardId,
631
- name: widget.name,
632
- type: widget.type || 'report',
633
- data_source: widget.dataSource,
634
- configuration: JSON.stringify(widget.configuration || {}),
635
- position: widget.position || 0,
636
- size_x: widget.width || 4,
637
- size_y: widget.height || 3
638
- };
639
- await this.client.createRecord('sys_dashboard_widget', widgetData);
640
- }
641
- }
642
- exports.ServiceNowReportingAnalyticsMCP = ServiceNowReportingAnalyticsMCP;
643
- // Create and run the server
644
- if (require.main === module) {
645
- const server = new ServiceNowReportingAnalyticsMCP();
646
- server.start().catch(console.error);
647
- }
648
- //# sourceMappingURL=servicenow-reporting-analytics-mcp-refactored.js.map
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * servicenow-security-compliance MCP Server - REFACTORED
4
- * Uses BaseMCPServer to eliminate code duplication
5
- */
6
- import { BaseMCPServer, ToolResult } from './base-mcp-server.js';
7
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
8
- export declare class ServiceNowSecurityComplianceMCP extends BaseMCPServer {
9
- constructor();
10
- protected setupTools(): void;
11
- protected getTools(): Tool[];
12
- protected executeTool(name: string, args: any): Promise<ToolResult>;
13
- private handleSnowCreateSecurityPolicy;
14
- private handleSnowCreateComplianceRule;
15
- private handleSnowCreateAuditRule;
16
- private handleSnowCreateAccessControl;
17
- private handleSnowCreateDataPolicy;
18
- private handleSnowCreateVulnerabilityScan;
19
- private handleSnowDiscoverSecurityFrameworks;
20
- private handleSnowDiscoverSecurityPolicies;
21
- private handleSnowRunComplianceScan;
22
- private handleSnowAuditTrailAnalysis;
23
- private handleSnowSecurityRiskAssessment;
24
- }
25
- //# sourceMappingURL=servicenow-security-compliance-mcp-refactored.d.ts.map