snow-flow 10.0.143 β 10.0.145
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/project/agents-template.txt +45 -72
- package/src/servicenow/cli/enterprise-docs-generator.ts +129 -775
- package/src/servicenow/servicenow-mcp-unified/tools/automation/index.ts +4 -0
- package/src/servicenow/servicenow-mcp-unified/tools/automation/snow_inspect_mutations.ts +553 -0
package/package.json
CHANGED
|
@@ -15,34 +15,6 @@ Transform user intent expressed in natural language into concrete ServiceNow art
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
## π WEB TOOLS (Disabled by Default)
|
|
19
|
-
|
|
20
|
-
The following tools are **disabled by default** to prevent accidental prompt injection from external web content:
|
|
21
|
-
|
|
22
|
-
- **webfetch** β Fetches and reads content from arbitrary URLs
|
|
23
|
-
- **websearch** β Searches the web via Exa API
|
|
24
|
-
- **codesearch** β Searches code repositories via Exa API
|
|
25
|
-
|
|
26
|
-
These tools make external HTTP calls that could expose the agent to untrusted content. They are opt-in only.
|
|
27
|
-
|
|
28
|
-
### Enabling Web Tools
|
|
29
|
-
|
|
30
|
-
Users can enable them in their `snow-code.jsonc` configuration:
|
|
31
|
-
|
|
32
|
-
```jsonc
|
|
33
|
-
{
|
|
34
|
-
"tools": {
|
|
35
|
-
"webfetch": true,
|
|
36
|
-
"websearch": true,
|
|
37
|
-
"codesearch": true
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Enable only the tools you need. Each can be toggled independently.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
18
|
## π HOW MCP TOOLS WORK
|
|
47
19
|
|
|
48
20
|
### CRITICAL: Tools are NOT directly available!
|
|
@@ -464,32 +436,21 @@ function($scope) {
|
|
|
464
436
|
|
|
465
437
|
## π οΈ DEVELOPMENT WORKFLOWS
|
|
466
438
|
|
|
467
|
-
### Workflow 1: Standard Development
|
|
439
|
+
### Workflow 1: Standard Development (widgets, business rules, scoped apps, etc.)
|
|
468
440
|
|
|
469
441
|
Before creating ANY ServiceNow artifact, follow these steps IN ORDER:
|
|
470
442
|
|
|
471
|
-
1. **Decide Application Scope**
|
|
472
|
-
2. **Create Update Set**
|
|
473
|
-
3. **Start Activity Tracking**
|
|
474
|
-
4. **
|
|
475
|
-
5. **Log Each Artifact**
|
|
476
|
-
6. **
|
|
443
|
+
1. **Decide Application Scope** β Scoped app (x_vendor_appname format) or global? For scoped apps: use auto_create_update_set=true and auto_switch_scope=true
|
|
444
|
+
2. **Create Update Set** β Descriptive name (e.g., "Feature: Incident Dashboard Widget"), ensure auto_switch=true. Get the sys_id from the response!
|
|
445
|
+
3. **Start Activity Tracking** β Use activity_start with the ACTUAL Update Set sys_id (never use placeholders like "pending")
|
|
446
|
+
4. **Develop** β Create your artifact(s). For widgets: ensure coherent HTML/Client/Server scripts (ES5 only!). For business rules: specify table, timing (before/after), ES5 script
|
|
447
|
+
5. **Log Each Artifact** β Use activity_add_artifact after each creation (include artifactSysId!)
|
|
448
|
+
6. **Test** β Verify behavior. For widgets: get instance URL for preview
|
|
449
|
+
7. **Complete** β Use activity_complete and mark Update Set complete
|
|
477
450
|
|
|
478
|
-
**β οΈ CRITICAL: Activity tracking requires REAL sys_ids!**
|
|
479
|
-
- Always create the Update Set FIRST to get its sys_id
|
|
480
|
-
- NEVER use placeholder values like "pending" for updateSetSysId
|
|
481
|
-
- The activity_start call must include the actual 32-character sys_id from ServiceNow
|
|
451
|
+
**β οΈ CRITICAL: Activity tracking requires REAL 32-character sys_ids from ServiceNow responses β NEVER placeholders!**
|
|
482
452
|
|
|
483
|
-
### Workflow 2: Widget
|
|
484
|
-
|
|
485
|
-
1. Create Update Set with descriptive name (e.g., "Feature: Incident Dashboard Widget") - get the sys_id!
|
|
486
|
-
2. Start activity tracking with the ACTUAL Update Set sys_id (never use "pending")
|
|
487
|
-
3. Create the widget with coherent HTML/Client/Server scripts (ES5 only!)
|
|
488
|
-
4. Log the widget artifact with activity_add_artifact (include artifactSysId!)
|
|
489
|
-
5. Get instance URL for preview
|
|
490
|
-
6. Complete activity and Update Set
|
|
491
|
-
|
|
492
|
-
### Workflow 3: Widget Debugging
|
|
453
|
+
### Workflow 2: Widget Debugging
|
|
493
454
|
|
|
494
455
|
1. Create Update Set for the fix
|
|
495
456
|
2. Pull the widget to local filesystem for editing
|
|
@@ -497,35 +458,47 @@ Before creating ANY ServiceNow artifact, follow these steps IN ORDER:
|
|
|
497
458
|
4. Push changes back to ServiceNow
|
|
498
459
|
5. Complete Update Set
|
|
499
460
|
|
|
500
|
-
### Workflow
|
|
501
|
-
|
|
502
|
-
1. Create Update Set
|
|
503
|
-
2. Create business rule with:
|
|
504
|
-
- Descriptive name
|
|
505
|
-
- Target table
|
|
506
|
-
- When to run (before/after insert/update/delete)
|
|
507
|
-
- Script in ES5 ONLY!
|
|
508
|
-
3. Test the business rule
|
|
509
|
-
4. Complete Update Set
|
|
510
|
-
|
|
511
|
-
### Workflow 5: Data Query (No Update Set Needed)
|
|
461
|
+
### Workflow 3: Data Query (No Update Set Needed)
|
|
512
462
|
|
|
513
463
|
For read-only operations, no Update Set is needed:
|
|
514
464
|
- Query incidents, users, or any table
|
|
515
465
|
- Analyze data patterns
|
|
516
466
|
- Generate reports
|
|
517
467
|
|
|
518
|
-
### Workflow
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
468
|
+
### Workflow 4: Tool Debugging & Mutation Inspection
|
|
469
|
+
|
|
470
|
+
When debugging MCP tool behavior or verifying what actually happened on the instance, use these debugging tools:
|
|
471
|
+
|
|
472
|
+
**Available debugging tools:**
|
|
473
|
+
- `snow_get_logs` β Syslog queries (errors/warnings/info) with time filter
|
|
474
|
+
- `snow_trace_execution` β Script execution tracing
|
|
475
|
+
- `snow_get_script_output` β Output of previously executed scripts
|
|
476
|
+
- `snow_get_flow_execution_logs` β Flow Designer execution history
|
|
477
|
+
- `snow_get_inbound_http_logs` / `snow_get_outbound_http_logs` β REST API call logs
|
|
478
|
+
- `snow_audit_trail_analysis` β Audit trail analysis with anomaly detection
|
|
479
|
+
- `snow_inspect_mutations` β **(NEW)** Mutation inspection after tool execution
|
|
480
|
+
|
|
481
|
+
**Self-debugging workflow:**
|
|
482
|
+
1. Note the current timestamp (or use relative like "30s")
|
|
483
|
+
2. Execute the tool being tested (e.g. `snow_manage_flow action=create`)
|
|
484
|
+
3. Call `snow_inspect_mutations` with `since=<timestamp>` or `since="30s"`
|
|
485
|
+
4. Review: which records were INSERT/UPDATE/DELETE, which fields changed, oldβnew values
|
|
486
|
+
5. Compare expected vs. actual mutations and adjust tool code accordingly
|
|
487
|
+
|
|
488
|
+
**When to use which debugging tool:**
|
|
489
|
+
- Script errors β `snow_get_logs` with `level="error"`
|
|
490
|
+
- What changed? β `snow_inspect_mutations` with time window
|
|
491
|
+
- What FAILED? β `snow_inspect_mutations` with `include_syslog=true` and `include_transactions=true`
|
|
492
|
+
- Flow not started? β `snow_get_flow_execution_logs`
|
|
493
|
+
- REST call failed? β `snow_get_outbound_http_logs`
|
|
494
|
+
- Who did what when? β `snow_audit_trail_analysis`
|
|
495
|
+
|
|
496
|
+
**Important notes on `snow_inspect_mutations`:**
|
|
497
|
+
- `sys_audit` only captures SUCCESSFUL record changes. Failed operations leave no audit trail.
|
|
498
|
+
- For failed operations, check syslog (errors) and sys_transaction_log (HTTP 4xx/5xx responses).
|
|
499
|
+
- `sys_audit` field values are limited to 255 characters β the tool warns when values appear truncated.
|
|
500
|
+
- Use `snapshot_record` to fetch the current state of a record alongside the audit trail.
|
|
501
|
+
- Use `tables` filter to focus on specific tables and reduce noise.
|
|
529
502
|
|
|
530
503
|
---
|
|
531
504
|
|