@sonisoft/now-sdk-ext-mcp 4.1.0 → 4.3.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.
- package/LICENSE +21 -0
- package/dist/common/annotations.d.ts +50 -0
- package/dist/common/annotations.d.ts.map +1 -0
- package/dist/common/annotations.js +193 -0
- package/dist/common/annotations.js.map +1 -0
- package/dist/common/progress.d.ts +33 -0
- package/dist/common/progress.d.ts.map +1 -0
- package/dist/common/progress.js +57 -0
- package/dist/common/progress.js.map +1 -0
- package/dist/common/version.d.ts +14 -0
- package/dist/common/version.d.ts.map +1 -0
- package/dist/common/version.js +24 -0
- package/dist/common/version.js.map +1 -0
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/tools/aggregate.d.ts.map +1 -1
- package/dist/tools/aggregate.js +4 -0
- package/dist/tools/aggregate.js.map +1 -1
- package/dist/tools/app-manager.d.ts.map +1 -1
- package/dist/tools/app-manager.js +9 -0
- package/dist/tools/app-manager.js.map +1 -1
- package/dist/tools/atf.d.ts.map +1 -1
- package/dist/tools/atf.js +3 -0
- package/dist/tools/atf.js.map +1 -1
- package/dist/tools/attachment.d.ts.map +1 -1
- package/dist/tools/attachment.js +4 -0
- package/dist/tools/attachment.js.map +1 -1
- package/dist/tools/batch.d.ts.map +1 -1
- package/dist/tools/batch.js +10 -3
- package/dist/tools/batch.js.map +1 -1
- package/dist/tools/catalog.d.ts.map +1 -1
- package/dist/tools/catalog.js +7 -0
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/cmdb.d.ts.map +1 -1
- package/dist/tools/cmdb.js +3 -0
- package/dist/tools/cmdb.js.map +1 -1
- package/dist/tools/codesearch.d.ts.map +1 -1
- package/dist/tools/codesearch.js +5 -0
- package/dist/tools/codesearch.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +3 -0
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/execute-script.d.ts.map +1 -1
- package/dist/tools/execute-script.js +2 -0
- package/dist/tools/execute-script.js.map +1 -1
- package/dist/tools/find-atf-tests.d.ts.map +1 -1
- package/dist/tools/find-atf-tests.js +2 -0
- package/dist/tools/find-atf-tests.js.map +1 -1
- package/dist/tools/flow.d.ts.map +1 -1
- package/dist/tools/flow.js +12 -0
- package/dist/tools/flow.js.map +1 -1
- package/dist/tools/health.d.ts.map +1 -1
- package/dist/tools/health.js +2 -0
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/knowledge.d.ts.map +1 -1
- package/dist/tools/knowledge.js +10 -0
- package/dist/tools/knowledge.js.map +1 -1
- package/dist/tools/lookup-app.d.ts.map +1 -1
- package/dist/tools/lookup-app.js +2 -0
- package/dist/tools/lookup-app.js.map +1 -1
- package/dist/tools/lookup-columns.d.ts.map +1 -1
- package/dist/tools/lookup-columns.js +2 -0
- package/dist/tools/lookup-columns.js.map +1 -1
- package/dist/tools/lookup-table.d.ts.map +1 -1
- package/dist/tools/lookup-table.js +2 -0
- package/dist/tools/lookup-table.js.map +1 -1
- package/dist/tools/query-batch.d.ts.map +1 -1
- package/dist/tools/query-batch.js +10 -2
- package/dist/tools/query-batch.js.map +1 -1
- package/dist/tools/query-syslog.d.ts.map +1 -1
- package/dist/tools/query-syslog.js +2 -0
- package/dist/tools/query-syslog.js.map +1 -1
- package/dist/tools/query-table.d.ts.map +1 -1
- package/dist/tools/query-table.js +2 -0
- package/dist/tools/query-table.js.map +1 -1
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +4 -0
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +4 -0
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/scriptsync.d.ts.map +1 -1
- package/dist/tools/scriptsync.js +3 -0
- package/dist/tools/scriptsync.js.map +1 -1
- package/dist/tools/task.d.ts.map +1 -1
- package/dist/tools/task.js +7 -0
- package/dist/tools/task.js.map +1 -1
- package/dist/tools/updateset.d.ts.map +1 -1
- package/dist/tools/updateset.js +12 -2
- package/dist/tools/updateset.js.map +1 -1
- package/dist/tools/workflow.d.ts.map +1 -1
- package/dist/tools/workflow.js +6 -2
- package/dist/tools/workflow.js.map +1 -1
- package/dist/tools/xml-record.d.ts.map +1 -1
- package/dist/tools/xml-record.js +3 -0
- package/dist/tools/xml-record.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SoniSoft Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool annotations — the machine-readable risk classification for every tool.
|
|
3
|
+
*
|
|
4
|
+
* Until now the only signal that a tool deletes records rather than reads them
|
|
5
|
+
* was prose in its description ("IMPORTANT: This PERMANENTLY DELETES..."). A
|
|
6
|
+
* host client cannot act on prose, so it had to prompt for all 86 tools equally
|
|
7
|
+
* — including `query_table` and `count_records`, which cannot change anything.
|
|
8
|
+
* Prompting uniformly trains people to click through, which is worse than not
|
|
9
|
+
* prompting at all.
|
|
10
|
+
*
|
|
11
|
+
* Kept as ONE table rather than inlined at 86 registration sites, because
|
|
12
|
+
* NEX-40 (role-based tool filtering) needs exactly the same central metadata.
|
|
13
|
+
* Building it twice would guarantee the two drift.
|
|
14
|
+
*
|
|
15
|
+
* These are HINTS, not guarantees. The authority on what a tool may do is the
|
|
16
|
+
* ServiceNow ACLs of the authenticated user; this only describes intent.
|
|
17
|
+
*
|
|
18
|
+
* ---
|
|
19
|
+
*
|
|
20
|
+
* Classification rules used here, since the spec defaults are easy to misread:
|
|
21
|
+
*
|
|
22
|
+
* - `readOnlyHint: true` — cannot modify anything. destructive/idempotent are
|
|
23
|
+
* meaningless alongside it and are omitted.
|
|
24
|
+
* - `destructiveHint` — DEFAULTS TO TRUE, so it must be set false explicitly for
|
|
25
|
+
* writes that only add. Reserved for operations that can lose or overwrite
|
|
26
|
+
* data that already existed.
|
|
27
|
+
* - `idempotentHint` — repeating the call with identical arguments leaves the
|
|
28
|
+
* same end state. True for "set this field to X"; false for "append a comment"
|
|
29
|
+
* or "create a record", which accumulate.
|
|
30
|
+
* - `openWorldHint` — reserved here for arbitrary code execution, where the
|
|
31
|
+
* effect is genuinely unbounded and cannot be inferred from the arguments.
|
|
32
|
+
*/
|
|
33
|
+
export interface ToolAnnotations {
|
|
34
|
+
readOnlyHint?: boolean;
|
|
35
|
+
destructiveHint?: boolean;
|
|
36
|
+
idempotentHint?: boolean;
|
|
37
|
+
openWorldHint?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const TOOL_ANNOTATIONS: Record<string, ToolAnnotations>;
|
|
40
|
+
/**
|
|
41
|
+
* Annotations for a tool.
|
|
42
|
+
*
|
|
43
|
+
* Throws on an unknown name rather than returning a permissive default. An
|
|
44
|
+
* unannotated tool would silently inherit the spec defaults — `readOnlyHint`
|
|
45
|
+
* false, `destructiveHint` TRUE — which is safe, but it would also mean a new
|
|
46
|
+
* tool could ship with no deliberate classification and nobody would notice.
|
|
47
|
+
* Failing at registration makes that impossible.
|
|
48
|
+
*/
|
|
49
|
+
export declare function annotationsFor(toolName: string): ToolAnnotations;
|
|
50
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/common/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,WAAW,eAAe;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAyBD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAmJ5D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAShE"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool annotations — the machine-readable risk classification for every tool.
|
|
3
|
+
*
|
|
4
|
+
* Until now the only signal that a tool deletes records rather than reads them
|
|
5
|
+
* was prose in its description ("IMPORTANT: This PERMANENTLY DELETES..."). A
|
|
6
|
+
* host client cannot act on prose, so it had to prompt for all 86 tools equally
|
|
7
|
+
* — including `query_table` and `count_records`, which cannot change anything.
|
|
8
|
+
* Prompting uniformly trains people to click through, which is worse than not
|
|
9
|
+
* prompting at all.
|
|
10
|
+
*
|
|
11
|
+
* Kept as ONE table rather than inlined at 86 registration sites, because
|
|
12
|
+
* NEX-40 (role-based tool filtering) needs exactly the same central metadata.
|
|
13
|
+
* Building it twice would guarantee the two drift.
|
|
14
|
+
*
|
|
15
|
+
* These are HINTS, not guarantees. The authority on what a tool may do is the
|
|
16
|
+
* ServiceNow ACLs of the authenticated user; this only describes intent.
|
|
17
|
+
*
|
|
18
|
+
* ---
|
|
19
|
+
*
|
|
20
|
+
* Classification rules used here, since the spec defaults are easy to misread:
|
|
21
|
+
*
|
|
22
|
+
* - `readOnlyHint: true` — cannot modify anything. destructive/idempotent are
|
|
23
|
+
* meaningless alongside it and are omitted.
|
|
24
|
+
* - `destructiveHint` — DEFAULTS TO TRUE, so it must be set false explicitly for
|
|
25
|
+
* writes that only add. Reserved for operations that can lose or overwrite
|
|
26
|
+
* data that already existed.
|
|
27
|
+
* - `idempotentHint` — repeating the call with identical arguments leaves the
|
|
28
|
+
* same end state. True for "set this field to X"; false for "append a comment"
|
|
29
|
+
* or "create a record", which accumulate.
|
|
30
|
+
* - `openWorldHint` — reserved here for arbitrary code execution, where the
|
|
31
|
+
* effect is genuinely unbounded and cannot be inferred from the arguments.
|
|
32
|
+
*/
|
|
33
|
+
/** Cannot modify anything. */
|
|
34
|
+
const READ = { readOnlyHint: true };
|
|
35
|
+
/** Adds something new; nothing pre-existing is lost. Repeating accumulates. */
|
|
36
|
+
const CREATE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false };
|
|
37
|
+
/** Sets state to a given value. Nothing is destroyed; repeating is a no-op. */
|
|
38
|
+
const SET = { readOnlyHint: false, destructiveHint: false, idempotentHint: true };
|
|
39
|
+
/** Overwrites or removes data that already existed. Repeating settles. */
|
|
40
|
+
const OVERWRITE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true };
|
|
41
|
+
/** Overwrites or removes, and repeating does NOT settle. */
|
|
42
|
+
const OVERWRITE_ONCE = { readOnlyHint: false, destructiveHint: true, idempotentHint: false };
|
|
43
|
+
/** Runs caller-supplied logic. Effect is unbounded and not inferable from args. */
|
|
44
|
+
const ARBITRARY = {
|
|
45
|
+
readOnlyHint: false,
|
|
46
|
+
destructiveHint: true,
|
|
47
|
+
idempotentHint: false,
|
|
48
|
+
openWorldHint: true,
|
|
49
|
+
};
|
|
50
|
+
export const TOOL_ANNOTATIONS = {
|
|
51
|
+
// ---- aggregate: server-side counts, no writes
|
|
52
|
+
count_records: READ,
|
|
53
|
+
aggregate_query: READ,
|
|
54
|
+
aggregate_grouped: READ,
|
|
55
|
+
// ---- app lifecycle
|
|
56
|
+
get_app_details: READ,
|
|
57
|
+
list_company_apps: READ,
|
|
58
|
+
search_store_apps: READ,
|
|
59
|
+
// Checks whether an install WOULD work; performs no install itself.
|
|
60
|
+
validate_app_install: READ,
|
|
61
|
+
// Installs change what code runs on the instance and can replace an existing
|
|
62
|
+
// version, so destructive even though nothing is "deleted" in a table sense.
|
|
63
|
+
install_store_app: OVERWRITE_ONCE,
|
|
64
|
+
update_store_app: OVERWRITE_ONCE,
|
|
65
|
+
install_from_app_repo: OVERWRITE_ONCE,
|
|
66
|
+
publish_to_app_repo: OVERWRITE_ONCE,
|
|
67
|
+
// ---- ATF: tests execute real logic against the instance and routinely
|
|
68
|
+
// create and modify records as part of running.
|
|
69
|
+
find_atf_tests: READ,
|
|
70
|
+
run_atf_test: OVERWRITE_ONCE,
|
|
71
|
+
run_atf_test_suite: OVERWRITE_ONCE,
|
|
72
|
+
// ---- attachments
|
|
73
|
+
list_attachments: READ,
|
|
74
|
+
get_attachment_info: READ,
|
|
75
|
+
upload_attachment: CREATE,
|
|
76
|
+
// ---- batch
|
|
77
|
+
batch_create_records: CREATE,
|
|
78
|
+
batch_update_records: OVERWRITE,
|
|
79
|
+
// ---- catalog
|
|
80
|
+
list_catalog_items: READ,
|
|
81
|
+
get_catalog_item: READ,
|
|
82
|
+
list_catalog_categories: READ,
|
|
83
|
+
get_catalog_category: READ,
|
|
84
|
+
list_catalog_item_variables: READ,
|
|
85
|
+
submit_catalog_request: CREATE,
|
|
86
|
+
// ---- CMDB
|
|
87
|
+
get_cmdb_relationships: READ,
|
|
88
|
+
traverse_cmdb_graph: READ,
|
|
89
|
+
// ---- code search
|
|
90
|
+
code_search: READ,
|
|
91
|
+
list_code_search_groups: READ,
|
|
92
|
+
list_code_search_tables: READ,
|
|
93
|
+
// Registering the same table twice leaves the same configuration.
|
|
94
|
+
add_code_search_table: SET,
|
|
95
|
+
// ---- discovery
|
|
96
|
+
list_instance_tables: READ,
|
|
97
|
+
list_plugins: READ,
|
|
98
|
+
// ---- scripting: arbitrary server-side JavaScript with the caller's rights.
|
|
99
|
+
execute_script: ARBITRARY,
|
|
100
|
+
// ---- flows: running one executes whatever the flow author wrote.
|
|
101
|
+
execute_flow: ARBITRARY,
|
|
102
|
+
execute_subflow: ARBITRARY,
|
|
103
|
+
execute_action: ARBITRARY,
|
|
104
|
+
test_flow: ARBITRARY,
|
|
105
|
+
get_flow_context_status: READ,
|
|
106
|
+
get_flow_outputs: READ,
|
|
107
|
+
get_flow_error: READ,
|
|
108
|
+
get_flow_execution_details: READ,
|
|
109
|
+
get_flow_logs: READ,
|
|
110
|
+
// Terminates a running execution; whatever it had not yet done is lost.
|
|
111
|
+
cancel_flow: OVERWRITE,
|
|
112
|
+
copy_flow: CREATE,
|
|
113
|
+
// ---- health
|
|
114
|
+
check_instance_health: READ,
|
|
115
|
+
// ---- knowledge
|
|
116
|
+
list_knowledge_bases: READ,
|
|
117
|
+
get_knowledge_base: READ,
|
|
118
|
+
list_kb_categories: READ,
|
|
119
|
+
create_kb_category: CREATE,
|
|
120
|
+
list_kb_articles: READ,
|
|
121
|
+
get_kb_article: READ,
|
|
122
|
+
create_kb_article: CREATE,
|
|
123
|
+
update_kb_article: OVERWRITE,
|
|
124
|
+
// A state transition to published; repeating leaves it published.
|
|
125
|
+
publish_kb_article: SET,
|
|
126
|
+
// ---- lookups
|
|
127
|
+
lookup_app: READ,
|
|
128
|
+
lookup_columns: READ,
|
|
129
|
+
lookup_table: READ,
|
|
130
|
+
// ---- bulk query operations: dry-run by default, but confirm=true is the
|
|
131
|
+
// most destructive thing in the surface after execute_script.
|
|
132
|
+
query_update_records: OVERWRITE,
|
|
133
|
+
query_delete_records: OVERWRITE,
|
|
134
|
+
// ---- plain queries
|
|
135
|
+
query_syslog: READ,
|
|
136
|
+
query_table: READ,
|
|
137
|
+
// ---- schema
|
|
138
|
+
discover_table_schema: READ,
|
|
139
|
+
explain_field: READ,
|
|
140
|
+
validate_catalog: READ,
|
|
141
|
+
// ---- scope
|
|
142
|
+
get_current_scope: READ,
|
|
143
|
+
list_scoped_apps: READ,
|
|
144
|
+
set_current_scope: SET,
|
|
145
|
+
// ---- script sync
|
|
146
|
+
// Writes to the LOCAL filesystem and will overwrite an existing file. Read-only
|
|
147
|
+
// with respect to ServiceNow, but "read-only" means the environment, not the
|
|
148
|
+
// instance.
|
|
149
|
+
pull_script: OVERWRITE,
|
|
150
|
+
// Overwrites the script record on the instance.
|
|
151
|
+
push_script: OVERWRITE,
|
|
152
|
+
// ---- tasks: field updates and appends
|
|
153
|
+
find_task: READ,
|
|
154
|
+
// Appends; calling twice leaves two comments.
|
|
155
|
+
add_task_comment: CREATE,
|
|
156
|
+
assign_task: SET,
|
|
157
|
+
resolve_incident: SET,
|
|
158
|
+
close_incident: SET,
|
|
159
|
+
approve_change: SET,
|
|
160
|
+
// ---- update sets
|
|
161
|
+
get_current_update_set: READ,
|
|
162
|
+
list_update_sets: READ,
|
|
163
|
+
inspect_update_set: READ,
|
|
164
|
+
create_update_set: CREATE,
|
|
165
|
+
set_current_update_set: SET,
|
|
166
|
+
clone_update_set: CREATE,
|
|
167
|
+
// Relocates customisations out of one update set into another.
|
|
168
|
+
move_update_set_records: OVERWRITE,
|
|
169
|
+
// ---- workflow
|
|
170
|
+
create_workflow: CREATE,
|
|
171
|
+
// ---- XML
|
|
172
|
+
export_record_xml: READ,
|
|
173
|
+
// Imports can update existing records, matched by sys_id.
|
|
174
|
+
import_records_xml: OVERWRITE_ONCE,
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Annotations for a tool.
|
|
178
|
+
*
|
|
179
|
+
* Throws on an unknown name rather than returning a permissive default. An
|
|
180
|
+
* unannotated tool would silently inherit the spec defaults — `readOnlyHint`
|
|
181
|
+
* false, `destructiveHint` TRUE — which is safe, but it would also mean a new
|
|
182
|
+
* tool could ship with no deliberate classification and nobody would notice.
|
|
183
|
+
* Failing at registration makes that impossible.
|
|
184
|
+
*/
|
|
185
|
+
export function annotationsFor(toolName) {
|
|
186
|
+
const annotations = TOOL_ANNOTATIONS[toolName];
|
|
187
|
+
if (!annotations) {
|
|
188
|
+
throw new Error(`No annotations defined for tool "${toolName}". Add it to TOOL_ANNOTATIONS ` +
|
|
189
|
+
`in src/common/annotations.ts — every tool must declare whether it is read-only.`);
|
|
190
|
+
}
|
|
191
|
+
return annotations;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../src/common/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,8BAA8B;AAC9B,MAAM,IAAI,GAAoB,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAErD,+EAA+E;AAC/E,MAAM,MAAM,GAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAEvG,+EAA+E;AAC/E,MAAM,GAAG,GAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAEnG,0EAA0E;AAC1E,MAAM,SAAS,GAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAExG,4DAA4D;AAC5D,MAAM,c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AA6E;IAC7E,YAAY;IACZ,WAAW,EAAE,SAAS;IACtB,gDAAgD;IAChD,WAAW,EAAE,SAAS;IAEtB,wCAAwC;IACxC,SAAS,EAAE,IAAI;IACf,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM;IACxB,WAAW,EAAE,GAAG;IAChB,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,GAAG;IACnB,cAAc,EAAE,GAAG;IAEnB,mBAAmB;IACnB,sBAAsB,EAAE,IAAI;IAC5B,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,MAAM;IACzB,sBAAsB,EAAE,GAAG;IAC3B,gBAAgB,EAAE,MAAM;IACxB,+DAA+D;IAC/D,uBAAuB,EAAE,SAAS;IAElC,gBAAgB;IAChB,eAAe,EAAE,MAAM;IAEvB,WAAW;IACX,iBAAiB,EAAE,IAAI;IACvB,0DAA0D;IAC1D,kBAAkB,EAAE,cAAc;CACrC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC3C,MAAM,WAAW,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACX,oCAAoC,QAAQ,gCAAgC;YACxE,iFAAiF,CACxF,CAAC;IACN,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges core's `onProgress` callbacks to MCP `notifications/progress`.
|
|
3
|
+
*
|
|
4
|
+
* Long-running tools were silent until they returned, which is indistinguishable
|
|
5
|
+
* from a hang for both the model and the user. Core already reports progress on
|
|
6
|
+
* several operations — batch create/update, query update/delete, update-set clone,
|
|
7
|
+
* complete-workflow creation — via an `onProgress?: (message: string) => void`
|
|
8
|
+
* callback that the MCP layer simply discarded.
|
|
9
|
+
*
|
|
10
|
+
* Progress is only sent when the CLIENT asked for it by supplying a progressToken
|
|
11
|
+
* in the request `_meta`. Per the MCP spec a server must not send progress
|
|
12
|
+
* notifications unsolicited, and most callers do not want them.
|
|
13
|
+
*
|
|
14
|
+
* Core reports free-text messages with no notion of completion, so these are
|
|
15
|
+
* INDETERMINATE notifications: `progress` increments per message and `total` is
|
|
16
|
+
* left undefined. Inventing a percentage from a message count would be a lie that
|
|
17
|
+
* gets less accurate the longer an operation runs.
|
|
18
|
+
*/
|
|
19
|
+
import type { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
20
|
+
import type { ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
21
|
+
export type ToolExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
22
|
+
/** Signature core expects. Matches BatchCreateOptions.onProgress and friends. */
|
|
23
|
+
export type ProgressCallback = (message: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Returns an `onProgress` callback to hand to core, or `undefined` when the client
|
|
26
|
+
* did not request progress.
|
|
27
|
+
*
|
|
28
|
+
* `undefined` rather than a no-op is deliberate: core's options are optional, and
|
|
29
|
+
* passing a callback that does nothing would still make core do the work of
|
|
30
|
+
* building progress strings for nobody.
|
|
31
|
+
*/
|
|
32
|
+
export declare function progressReporter(extra: ToolExtra | undefined): ProgressCallback | undefined;
|
|
33
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/common/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAE5F,MAAM,MAAM,SAAS,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAE/E,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CA8B3F"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges core's `onProgress` callbacks to MCP `notifications/progress`.
|
|
3
|
+
*
|
|
4
|
+
* Long-running tools were silent until they returned, which is indistinguishable
|
|
5
|
+
* from a hang for both the model and the user. Core already reports progress on
|
|
6
|
+
* several operations — batch create/update, query update/delete, update-set clone,
|
|
7
|
+
* complete-workflow creation — via an `onProgress?: (message: string) => void`
|
|
8
|
+
* callback that the MCP layer simply discarded.
|
|
9
|
+
*
|
|
10
|
+
* Progress is only sent when the CLIENT asked for it by supplying a progressToken
|
|
11
|
+
* in the request `_meta`. Per the MCP spec a server must not send progress
|
|
12
|
+
* notifications unsolicited, and most callers do not want them.
|
|
13
|
+
*
|
|
14
|
+
* Core reports free-text messages with no notion of completion, so these are
|
|
15
|
+
* INDETERMINATE notifications: `progress` increments per message and `total` is
|
|
16
|
+
* left undefined. Inventing a percentage from a message count would be a lie that
|
|
17
|
+
* gets less accurate the longer an operation runs.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Returns an `onProgress` callback to hand to core, or `undefined` when the client
|
|
21
|
+
* did not request progress.
|
|
22
|
+
*
|
|
23
|
+
* `undefined` rather than a no-op is deliberate: core's options are optional, and
|
|
24
|
+
* passing a callback that does nothing would still make core do the work of
|
|
25
|
+
* building progress strings for nobody.
|
|
26
|
+
*/
|
|
27
|
+
export function progressReporter(extra) {
|
|
28
|
+
const token = extra?._meta?.progressToken;
|
|
29
|
+
// `== null` rather than a truthiness check: progressToken may be a number,
|
|
30
|
+
// and 0 is a legitimate token that `!token` would silently discard.
|
|
31
|
+
if (extra === undefined || token == null) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
// Captured after the guard so the closure below holds a narrowed reference.
|
|
35
|
+
// TypeScript cannot carry the narrowing on `extra` across the function
|
|
36
|
+
// boundary on its own.
|
|
37
|
+
const sink = extra;
|
|
38
|
+
let sent = 0;
|
|
39
|
+
return (message) => {
|
|
40
|
+
sent += 1;
|
|
41
|
+
// Fire-and-forget. A failed notification must never fail the operation that
|
|
42
|
+
// was reporting progress — the work itself is what the caller asked for.
|
|
43
|
+
void sink.sendNotification({
|
|
44
|
+
method: "notifications/progress",
|
|
45
|
+
params: {
|
|
46
|
+
progressToken: token,
|
|
47
|
+
progress: sent,
|
|
48
|
+
message,
|
|
49
|
+
},
|
|
50
|
+
}).catch((error) => {
|
|
51
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
52
|
+
// stderr, never stdout: stdout is the JSON-RPC transport.
|
|
53
|
+
console.error(`[progress] failed to send notification: ${detail}`);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/common/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IACzD,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC;IAC1C,2EAA2E;IAC3E,oEAAoE;IACpE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,4EAA4E;IAC5E,uEAAuE;IACvE,uBAAuB;IACvB,MAAM,IAAI,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,CAAC,OAAe,EAAE,EAAE;QACvB,IAAI,IAAI,CAAC,CAAC;QACV,4EAA4E;QAC5E,yEAAyE;QACzE,KAAK,IAAI,CAAC,gBAAgB,CAAC;YACvB,MAAM,EAAE,wBAAwB;YAChC,MAAM,EAAE;gBACJ,aAAa,EAAE,KAAK;gBACpB,QAAQ,EAAE,IAAI;gBACd,OAAO;aACV;SACJ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACxB,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtE,0DAA0D;YAC1D,OAAO,CAAC,KAAK,CAAC,2CAA2C,MAAM,EAAE,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The version this server reports to clients during the initialize handshake.
|
|
3
|
+
*
|
|
4
|
+
* Read from package.json rather than hard-coded. The literal previously here had
|
|
5
|
+
* drifted to "1.0.0-alpha.0" while the package was on 4.x, so every client was
|
|
6
|
+
* told the wrong version of the server it was talking to — and semantic-release,
|
|
7
|
+
* which owns the real version, had no way to correct it.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from index.ts so it is reachable from a test. index.ts constructs and
|
|
10
|
+
* connects a server as a side effect of import, so it cannot be imported to
|
|
11
|
+
* assert on; without this seam the only coverage was a manual handshake probe.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readServerVersion(): string;
|
|
14
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/common/version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAS1C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
/**
|
|
3
|
+
* The version this server reports to clients during the initialize handshake.
|
|
4
|
+
*
|
|
5
|
+
* Read from package.json rather than hard-coded. The literal previously here had
|
|
6
|
+
* drifted to "1.0.0-alpha.0" while the package was on 4.x, so every client was
|
|
7
|
+
* told the wrong version of the server it was talking to — and semantic-release,
|
|
8
|
+
* which owns the real version, had no way to correct it.
|
|
9
|
+
*
|
|
10
|
+
* Extracted from index.ts so it is reachable from a test. index.ts constructs and
|
|
11
|
+
* connects a server as a side effect of import, so it cannot be imported to
|
|
12
|
+
* assert on; without this seam the only coverage was a manual handshake probe.
|
|
13
|
+
*/
|
|
14
|
+
export function readServerVersion() {
|
|
15
|
+
const pkg = createRequire(import.meta.url)("../../package.json");
|
|
16
|
+
if (typeof pkg.version !== "string" || pkg.version.length === 0) {
|
|
17
|
+
// Better to be obviously wrong than quietly wrong: a client that sees
|
|
18
|
+
// "0.0.0-unknown" can be diagnosed, one that sees a plausible stale
|
|
19
|
+
// number cannot.
|
|
20
|
+
return "0.0.0-unknown";
|
|
21
|
+
}
|
|
22
|
+
return pkg.version;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/common/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB;IAC7B,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAyB,CAAC;IACzF,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9D,sEAAsE;QACtE,oEAAoE;QACpE,iBAAiB;QACjB,OAAO,eAAe,CAAC;IAC3B,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC;AACvB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// non-interactive child process, where the keyring cannot be unlocked.
|
|
5
5
|
import "./common/credstore-boot.js";
|
|
6
6
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import { readServerVersion } from "./common/version.js";
|
|
7
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
9
|
import { registerExecuteScriptTool } from "./tools/execute-script.js";
|
|
9
10
|
import { registerRunAtfTestTool, registerRunAtfTestSuiteTool, } from "./tools/atf.js";
|
|
@@ -34,7 +35,16 @@ import { registerListCatalogItemsTool, registerGetCatalogItemTool, registerListC
|
|
|
34
35
|
import { registerExecuteFlowTool, registerExecuteSubflowTool, registerExecuteActionTool, registerGetFlowContextStatusTool, registerGetFlowOutputsTool, registerGetFlowErrorTool, registerCancelFlowTool, registerTestFlowTool, registerCopyFlowTool, registerGetFlowExecutionDetailsTool, registerGetFlowLogsTool, } from "./tools/flow.js";
|
|
35
36
|
const server = new McpServer({
|
|
36
37
|
name: "now-sdk-ext-mcp",
|
|
37
|
-
version:
|
|
38
|
+
version: readServerVersion(),
|
|
39
|
+
}, {
|
|
40
|
+
// Declared explicitly rather than inferred from what happens to get registered.
|
|
41
|
+
//
|
|
42
|
+
// Note progress is NOT a capability — it is base protocol, driven entirely by
|
|
43
|
+
// the client putting a progressToken in a request's _meta. So there is nothing
|
|
44
|
+
// to advertise for it; the server just has to honour the token when it is sent.
|
|
45
|
+
capabilities: {
|
|
46
|
+
tools: {},
|
|
47
|
+
},
|
|
38
48
|
});
|
|
39
49
|
// Register tools
|
|
40
50
|
registerExecuteScriptTool(server);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,iFAAiF;AACjF,uEAAuE;AACvE,uEAAuE;AACvE,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,SAA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,CAAC;AAC5C,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAEhC,mEAAmE;AACnE,mDAAmD;AACnD,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE;IAC1C,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,sCAAsC;AACtC,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC3D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoEhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsHlE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiJpE"}
|
package/dist/tools/aggregate.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AggregateQuery } from "@sonisoft/now-sdk-ext-core";
|
|
3
3
|
import { withConnectionRetry } from "../common/connection.js";
|
|
4
|
+
import { annotationsFor } from "../common/annotations.js";
|
|
4
5
|
/**
|
|
5
6
|
* Registers the count_records tool on the MCP server.
|
|
6
7
|
*
|
|
@@ -8,6 +9,7 @@ import { withConnectionRetry } from "../common/connection.js";
|
|
|
8
9
|
*/
|
|
9
10
|
export function registerCountRecordsTool(server) {
|
|
10
11
|
server.registerTool("count_records", {
|
|
12
|
+
annotations: annotationsFor("count_records"),
|
|
11
13
|
title: "Count Records",
|
|
12
14
|
description: "Count records on any ServiceNow table, optionally filtered by an encoded query. " +
|
|
13
15
|
"Uses the Stats API for efficient server-side counting — much faster than querying " +
|
|
@@ -66,6 +68,7 @@ export function registerCountRecordsTool(server) {
|
|
|
66
68
|
*/
|
|
67
69
|
export function registerAggregateQueryTool(server) {
|
|
68
70
|
server.registerTool("aggregate_query", {
|
|
71
|
+
annotations: annotationsFor("aggregate_query"),
|
|
69
72
|
title: "Aggregate Query",
|
|
70
73
|
description: "Run aggregate functions (COUNT, AVG, MIN, MAX, SUM) on any ServiceNow table " +
|
|
71
74
|
"using the Stats API. Returns computed statistics without returning individual records.\n\n" +
|
|
@@ -160,6 +163,7 @@ export function registerAggregateQueryTool(server) {
|
|
|
160
163
|
*/
|
|
161
164
|
export function registerAggregateGroupedTool(server) {
|
|
162
165
|
server.registerTool("aggregate_grouped", {
|
|
166
|
+
annotations: annotationsFor("aggregate_grouped"),
|
|
163
167
|
title: "Grouped Aggregate Query",
|
|
164
168
|
description: "Run aggregate functions (COUNT, AVG, MIN, MAX, SUM) grouped by a field on any " +
|
|
165
169
|
"ServiceNow table. Returns per-group statistics — ideal for breakdowns and dashboards.\n\n" +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EAAE,cAAc,CAAC,eAAe,CAAC;QAC5C,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,kFAAkF;YAClF,oFAAoF;YACpF,2CAA2C;YAC3C,4EAA4E;YAC5E,4DAA4D;QAC9D,WAAW,EAAE;YACX,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,4CAA4C;gBAC1C,qDAAqD;gBACrD,4CAA4C,CAC/C;YACH,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,CACP,mEAAmE;gBACjE,gCAAgC,CACnC;YACH,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,+DAA+D;gBAC7D,kDAAkD;gBAClD,8CAA8C,CACjD;SACJ;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,E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AC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,oCAAoC,OAAO,EAAE;qBACpD;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-manager.d.ts","sourceRoot":"","sources":["../../src/tools/app-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"app-manager.d.ts","sourceRoot":"","sources":["../../src/tools/app-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwFjE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuGtE;AAWD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2GnE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8HnE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0GnE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyGlE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4HtE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2GpE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ApplicationManager, CompanyApplications, AppRepoApplication, BatchDefinition, BatchInstallation, } from "@sonisoft/now-sdk-ext-core";
|
|
3
3
|
import { withConnectionRetry } from "../common/connection.js";
|
|
4
|
+
import { annotationsFor } from "../common/annotations.js";
|
|
4
5
|
/**
|
|
5
6
|
* Registers the get_app_details tool on the MCP server.
|
|
6
7
|
*
|
|
@@ -8,6 +9,7 @@ import { withConnectionRetry } from "../common/connection.js";
|
|
|
8
9
|
*/
|
|
9
10
|
export function registerGetAppDetailsTool(server) {
|
|
10
11
|
server.registerTool("get_app_details", {
|
|
12
|
+
annotations: annotationsFor("get_app_details"),
|
|
11
13
|
title: "Get Application Details",
|
|
12
14
|
description: "Get detailed information about a ServiceNow application by its sys_id. " +
|
|
13
15
|
"Returns version, install status, update availability, scope, vendor, " +
|
|
@@ -89,6 +91,7 @@ export function registerGetAppDetailsTool(server) {
|
|
|
89
91
|
*/
|
|
90
92
|
export function registerValidateAppInstallTool(server) {
|
|
91
93
|
server.registerTool("validate_app_install", {
|
|
94
|
+
annotations: annotationsFor("validate_app_install"),
|
|
92
95
|
title: "Validate Application Installation",
|
|
93
96
|
description: "Validate whether a set of applications are installed at the expected versions. " +
|
|
94
97
|
"Reports which apps are valid, need installation, need upgrade, or have " +
|
|
@@ -181,6 +184,7 @@ function formatDuration(startMs) {
|
|
|
181
184
|
*/
|
|
182
185
|
export function registerSearchStoreAppsTool(server) {
|
|
183
186
|
server.registerTool("search_store_apps", {
|
|
187
|
+
annotations: annotationsFor("search_store_apps"),
|
|
184
188
|
title: "Search Store Applications",
|
|
185
189
|
description: "Search or browse ServiceNow store applications by category.\n\n" +
|
|
186
190
|
"Tab contexts:\n" +
|
|
@@ -277,6 +281,7 @@ export function registerSearchStoreAppsTool(server) {
|
|
|
277
281
|
*/
|
|
278
282
|
export function registerListCompanyAppsTool(server) {
|
|
279
283
|
server.registerTool("list_company_apps", {
|
|
284
|
+
annotations: annotationsFor("list_company_apps"),
|
|
280
285
|
title: "List Company Applications",
|
|
281
286
|
description: "List company-internal applications shared within your organization. " +
|
|
282
287
|
"Returns application metadata including name, scope, version, install " +
|
|
@@ -390,6 +395,7 @@ export function registerListCompanyAppsTool(server) {
|
|
|
390
395
|
*/
|
|
391
396
|
export function registerInstallStoreAppTool(server) {
|
|
392
397
|
server.registerTool("install_store_app", {
|
|
398
|
+
annotations: annotationsFor("install_store_app"),
|
|
393
399
|
title: "Install Store Application",
|
|
394
400
|
description: "Install a ServiceNow store application on the target instance. " +
|
|
395
401
|
"This is a MUTATIVE, LONG-RUNNING operation that blocks until " +
|
|
@@ -480,6 +486,7 @@ export function registerInstallStoreAppTool(server) {
|
|
|
480
486
|
*/
|
|
481
487
|
export function registerUpdateStoreAppTool(server) {
|
|
482
488
|
server.registerTool("update_store_app", {
|
|
489
|
+
annotations: annotationsFor("update_store_app"),
|
|
483
490
|
title: "Update Store Application",
|
|
484
491
|
description: "Update an installed ServiceNow store application to a newer version. " +
|
|
485
492
|
"This is a MUTATIVE, LONG-RUNNING operation that blocks until " +
|
|
@@ -569,6 +576,7 @@ export function registerUpdateStoreAppTool(server) {
|
|
|
569
576
|
*/
|
|
570
577
|
export function registerInstallFromAppRepoTool(server) {
|
|
571
578
|
server.registerTool("install_from_app_repo", {
|
|
579
|
+
annotations: annotationsFor("install_from_app_repo"),
|
|
572
580
|
title: "Install from App Repository",
|
|
573
581
|
description: "Install an application from the company's ServiceNow application " +
|
|
574
582
|
"repository using the CI/CD API. This is a MUTATIVE, LONG-RUNNING " +
|
|
@@ -667,6 +675,7 @@ export function registerInstallFromAppRepoTool(server) {
|
|
|
667
675
|
*/
|
|
668
676
|
export function registerPublishToAppRepoTool(server) {
|
|
669
677
|
server.registerTool("publish_to_app_repo", {
|
|
678
|
+
annotations: annotationsFor("publish_to_app_repo"),
|
|
670
679
|
title: "Publish to App Repository",
|
|
671
680
|
description: "Publish an application to the company's ServiceNow application " +
|
|
672
681
|
"repository using the CI/CD API. This is a MUTATIVE, LONG-RUNNING " +
|