@sonisoft/now-sdk-ext-mcp 4.4.0 → 4.5.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.
@@ -27,8 +27,14 @@
27
27
  * - `idempotentHint` — repeating the call with identical arguments leaves the
28
28
  * same end state. True for "set this field to X"; false for "append a comment"
29
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.
30
+ * - `openWorldHint` — TRUE FOR EVERY TOOL HERE, and set explicitly rather than
31
+ * left to the spec's default. All of them talk to a live ServiceNow instance,
32
+ * which is exactly what the spec means by an open world. It was tempting to use
33
+ * it to single out arbitrary code execution, but that would have been wrong in
34
+ * both directions: the spec default is already `true`, so the marking would
35
+ * have been a no-op, and leaving it off the other 80-odd would have implied
36
+ * they were closed-world when they are not. MCP has no hint for "runs
37
+ * caller-supplied logic" — the tool description carries that.
32
38
  */
33
39
  export interface ToolAnnotations {
34
40
  readOnlyHint?: boolean;
@@ -1 +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"}
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/common/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;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;AA2BD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAwJ5D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAchE"}
@@ -27,27 +27,39 @@
27
27
  * - `idempotentHint` — repeating the call with identical arguments leaves the
28
28
  * same end state. True for "set this field to X"; false for "append a comment"
29
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.
30
+ * - `openWorldHint` — TRUE FOR EVERY TOOL HERE, and set explicitly rather than
31
+ * left to the spec's default. All of them talk to a live ServiceNow instance,
32
+ * which is exactly what the spec means by an open world. It was tempting to use
33
+ * it to single out arbitrary code execution, but that would have been wrong in
34
+ * both directions: the spec default is already `true`, so the marking would
35
+ * have been a no-op, and leaving it off the other 80-odd would have implied
36
+ * they were closed-world when they are not. MCP has no hint for "runs
37
+ * caller-supplied logic" — the tool description carries that.
32
38
  */
33
39
  /** Cannot modify anything. */
34
- const READ = { readOnlyHint: true };
40
+ const READ = { readOnlyHint: true, openWorldHint: true };
35
41
  /** Adds something new; nothing pre-existing is lost. Repeating accumulates. */
36
- const CREATE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false };
42
+ const CREATE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
37
43
  /** Sets state to a given value. Nothing is destroyed; repeating is a no-op. */
38
- const SET = { readOnlyHint: false, destructiveHint: false, idempotentHint: true };
44
+ const SET = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true };
39
45
  /** Overwrites or removes data that already existed. Repeating settles. */
40
- const OVERWRITE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true };
46
+ const OVERWRITE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true };
41
47
  /** 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
- };
48
+ const OVERWRITE_ONCE = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
49
+ /**
50
+ * Runs caller-supplied logic — a script or a flow someone else authored.
51
+ *
52
+ * Structurally identical to OVERWRITE_ONCE, because MCP has no hint that means
53
+ * "unbounded effect". Kept as a separate name purely so this table records which
54
+ * tools are in that category; the warning that actually reaches the model is in
55
+ * the tool description.
56
+ */
57
+ const ARBITRARY = OVERWRITE_ONCE;
50
58
  export const TOOL_ANNOTATIONS = {
59
+ // ---- meta: reports this server's own configuration, touches no instance.
60
+ // Registered outside TOOL_REGISTRY because it is always available regardless
61
+ // of the active package.
62
+ list_tool_packages: READ,
51
63
  // ---- aggregate: server-side counts, no writes
52
64
  count_records: READ,
53
65
  aggregate_query: READ,
@@ -183,7 +195,12 @@ export const TOOL_ANNOTATIONS = {
183
195
  * Failing at registration makes that impossible.
184
196
  */
185
197
  export function annotationsFor(toolName) {
186
- const annotations = TOOL_ANNOTATIONS[toolName];
198
+ // hasOwnProperty, not bracket access: TOOL_ANNOTATIONS["constructor"] would
199
+ // otherwise return the Object constructor — truthy — and this would hand back
200
+ // a function instead of throwing.
201
+ const annotations = Object.prototype.hasOwnProperty.call(TOOL_ANNOTATIONS, toolName)
202
+ ? TOOL_ANNOTATIONS[toolName]
203
+ : undefined;
187
204
  if (!annotations) {
188
205
  throw new Error(`No annotations defined for tool "${toolName}". Add it to TOOL_ANNOTATIONS ` +
189
206
  `in src/common/annotations.ts — every tool must declare whether it is read-only.`);
@@ -1 +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,cAAc,GAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAE9G,mFAAmF;AACnF,MAAM,SAAS,GAAoB;IAC/B,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAoC;IAC7D,gDAAgD;IAChD,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,IAAI;IAEvB,qBAAqB;IACrB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,oEAAoE;IACpE,oBAAoB,EAAE,IAAI;IAC1B,6EAA6E;IAC7E,6EAA6E;IAC7E,iB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G;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,4EAA4E;IAC5E,8EAA8E;IAC9E,kCAAkC;IAClC,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC;QAChF,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5B,CAAC,CAAC,SAAS,CAAC;IAChB,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,37 @@
1
+ /**
2
+ * Resolves MCP_TOOL_PACKAGE into the set of tools to register.
3
+ *
4
+ * Every failure mode here degrades toward MORE tools, never fewer. A typo in the
5
+ * env var that silently exposed a smaller surface would look like the server was
6
+ * broken — tools simply missing, with no error to search for. Falling back to
7
+ * `full` and saying so on stderr is the recoverable direction.
8
+ */
9
+ export interface ResolvedPackage {
10
+ /** Package names that were actually applied. */
11
+ names: string[];
12
+ /** Tool names to register, already filtered to ones that exist. */
13
+ tools: string[];
14
+ /** Requested names that matched no package. */
15
+ unknownPackages: string[];
16
+ /** Tools named by a package that this server does not have. */
17
+ unknownTools: string[];
18
+ /** True when the requested selection could not be used and `full` was substituted. */
19
+ fellBack: boolean;
20
+ }
21
+ /**
22
+ * Resolves a selection into a concrete tool set.
23
+ *
24
+ * `selection` is the raw env value: one package name, or several comma-separated,
25
+ * in which case the result is their UNION. Union rather than intersection because
26
+ * combining packages is how someone expresses "I do service desk work AND change
27
+ * approvals" — an intersection of two role packages is almost always empty.
28
+ */
29
+ export declare function resolveToolPackage(selection: string | undefined): ResolvedPackage;
30
+ /**
31
+ * Reports the resolution on stderr.
32
+ *
33
+ * stderr, never stdout — stdout is the JSON-RPC transport, and a stray byte
34
+ * there breaks the client's parser.
35
+ */
36
+ export declare function reportResolution(resolved: ResolvedPackage): void;
37
+ //# sourceMappingURL=tool-packages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.d.ts","sourceRoot":"","sources":["../../src/common/tool-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,MAAM,WAAW,eAAe;IAC5B,gDAAgD;IAChD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mEAAmE;IACnE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,+DAA+D;IAC/D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,sFAAsF;IACtF,QAAQ,EAAE,OAAO,CAAC;CACrB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,CAuEjF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAuBhE"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Resolves MCP_TOOL_PACKAGE into the set of tools to register.
3
+ *
4
+ * Every failure mode here degrades toward MORE tools, never fewer. A typo in the
5
+ * env var that silently exposed a smaller surface would look like the server was
6
+ * broken — tools simply missing, with no error to search for. Falling back to
7
+ * `full` and saying so on stderr is the recoverable direction.
8
+ */
9
+ import { TOOL_PACKAGES, DEFAULT_PACKAGE } from "../config/tool-packages.js";
10
+ import { TOOL_ANNOTATIONS } from "./annotations.js";
11
+ import { allToolNames } from "../tools/registry.js";
12
+ /** Sentinel in a package's `tools` meaning "everything". */
13
+ const ALL = "*";
14
+ /** Sentinel meaning "every tool annotated readOnlyHint: true". */
15
+ const READONLY = "@readonly";
16
+ /**
17
+ * Tools annotated as read-only. Derived, so it cannot drift from the annotations.
18
+ *
19
+ * Filtered to the registry deliberately. TOOL_ANNOTATIONS covers one tool the
20
+ * registry does not — `list_tool_packages`, which is registered unconditionally —
21
+ * and returning it here would put a name in the resolved set that has no
22
+ * registrar, crashing startup on `TOOL_REGISTRY[name](server)`.
23
+ */
24
+ function readonlyTools(known) {
25
+ return Object.entries(TOOL_ANNOTATIONS)
26
+ .filter(([name, a]) => a.readOnlyHint === true && known.has(name))
27
+ .map(([name]) => name);
28
+ }
29
+ /**
30
+ * Resolves a selection into a concrete tool set.
31
+ *
32
+ * `selection` is the raw env value: one package name, or several comma-separated,
33
+ * in which case the result is their UNION. Union rather than intersection because
34
+ * combining packages is how someone expresses "I do service desk work AND change
35
+ * approvals" — an intersection of two role packages is almost always empty.
36
+ */
37
+ export function resolveToolPackage(selection) {
38
+ const known = new Set(allToolNames());
39
+ const requested = (selection ?? "")
40
+ .split(",")
41
+ .map((s) => s.trim())
42
+ .filter((s) => s.length > 0);
43
+ if (requested.length === 0) {
44
+ return {
45
+ names: [DEFAULT_PACKAGE],
46
+ tools: allToolNames(),
47
+ unknownPackages: [],
48
+ unknownTools: [],
49
+ fellBack: false,
50
+ };
51
+ }
52
+ const names = [];
53
+ const unknownPackages = [];
54
+ const selected = new Set();
55
+ const namedButMissing = new Set();
56
+ for (const name of requested) {
57
+ // hasOwnProperty, not bracket access. TOOL_PACKAGES is an object literal,
58
+ // so TOOL_PACKAGES["constructor"] returns the Object constructor — truthy,
59
+ // with no `.tools` — and `for (const t of pkg.tools)` then throws at module
60
+ // load, before the uncaughtException handler exists. MCP_TOOL_PACKAGE=
61
+ // constructor would crash the server rather than falling back, which is the
62
+ // exact opposite of this file's stated invariant.
63
+ const pkg = Object.prototype.hasOwnProperty.call(TOOL_PACKAGES, name)
64
+ ? TOOL_PACKAGES[name]
65
+ : undefined;
66
+ if (!pkg) {
67
+ unknownPackages.push(name);
68
+ continue;
69
+ }
70
+ names.push(name);
71
+ for (const tool of pkg.tools) {
72
+ if (tool === ALL) {
73
+ allToolNames().forEach((t) => selected.add(t));
74
+ }
75
+ else if (tool === READONLY) {
76
+ readonlyTools(known).forEach((t) => selected.add(t));
77
+ }
78
+ else if (known.has(tool)) {
79
+ selected.add(tool);
80
+ }
81
+ else {
82
+ // Expected for packages naming tools from open tickets; still
83
+ // reported, because the same path catches a genuine typo.
84
+ namedButMissing.add(tool);
85
+ }
86
+ }
87
+ }
88
+ // Nothing usable was requested. Fall back rather than register an empty
89
+ // server: a server with no tools is indistinguishable from a broken one.
90
+ if (names.length === 0) {
91
+ return {
92
+ names: [DEFAULT_PACKAGE],
93
+ tools: allToolNames(),
94
+ unknownPackages,
95
+ unknownTools: [],
96
+ fellBack: true,
97
+ };
98
+ }
99
+ return {
100
+ names,
101
+ tools: [...selected].sort(),
102
+ unknownPackages,
103
+ unknownTools: [...namedButMissing].sort(),
104
+ fellBack: false,
105
+ };
106
+ }
107
+ /**
108
+ * Reports the resolution on stderr.
109
+ *
110
+ * stderr, never stdout — stdout is the JSON-RPC transport, and a stray byte
111
+ * there breaks the client's parser.
112
+ */
113
+ export function reportResolution(resolved) {
114
+ const { names, tools, unknownPackages, unknownTools, fellBack } = resolved;
115
+ if (unknownPackages.length > 0) {
116
+ const available = Object.keys(TOOL_PACKAGES).sort().join(", ");
117
+ console.error(`[tool-packages] unknown package(s): ${unknownPackages.join(", ")}. ` +
118
+ `Available: ${available}.` +
119
+ (fellBack ? ` Falling back to "${DEFAULT_PACKAGE}".` : ""));
120
+ }
121
+ if (unknownTools.length > 0) {
122
+ console.error(`[tool-packages] ${unknownTools.length} tool(s) named by a package do not exist ` +
123
+ `on this server and were skipped: ${unknownTools.join(", ")}. ` +
124
+ `This is expected for tools from work that has not landed yet.`);
125
+ }
126
+ console.error(`[tool-packages] active: ${names.join(", ")} — ${tools.length} of ${allToolNames().length} tools registered`);
127
+ }
128
+ //# sourceMappingURL=tool-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.js","sourceRoot":"","sources":["../../src/common/tool-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,4DAA4D;AAC5D,MAAM,GAAG,GAAG,GAAG,CAAC;AAEhB,kEAAkE;AAClE,MAAM,QAAQ,GAAG,WAAW,CAAC;AAe7B;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,KAAkB;IACrC,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACjE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA6B;IAC5D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;SAC9B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC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AO,CAAC,KAAK,CACT,uCAAuC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACjE,cAAc,SAAS,GAAG;YAC1B,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CACjE,CAAC;IACN,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,KAAK,CACT,mBAAmB,YAAY,CAAC,MAAM,2CAA2C;YAC7E,oCAAoC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC/D,+DAA+D,CACtE,CAAC;IACN,CAAC;IAED,OAAO,CAAC,KAAK,CACT,2BAA2B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,OAAO,YAAY,EAAE,CAAC,MAAM,mBAAmB,CAC/G,CAAC;AACN,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tool packages — named subsets of the tool surface.
3
+ *
4
+ * All 86 tools are registered by default, and their descriptions are long by
5
+ * design (`execute_script`'s runs to about thirteen lines, because it has to
6
+ * teach scoped-vs-global name qualification). That is a fixed cost paid on every
7
+ * session, and model tool-selection accuracy degrades as the option count grows.
8
+ * A user doing service-desk work does not need Flow Designer, ATF, or app
9
+ * publishing in front of them.
10
+ *
11
+ * Selected with MCP_TOOL_PACKAGE. Unset means "full", so the default behaviour
12
+ * is unchanged.
13
+ *
14
+ * ---
15
+ *
16
+ * ON NAMING TOOLS THAT DO NOT EXIST YET
17
+ *
18
+ * Packages may reference tools this server does not have. That is deliberate,
19
+ * not sloppiness: NEX-38 (user and group tools), NEX-39 (incident and change
20
+ * tools) and NEX-46 (workflow execution) are all open, and their tools belong in
21
+ * these packages the day they land. Naming them now means the package is already
22
+ * right rather than something someone has to remember to revisit.
23
+ *
24
+ * Unknown names are reported once at startup and skipped. They are a warning
25
+ * rather than an error precisely because forward references are expected — but
26
+ * they are still surfaced, because the same warning catches a genuine typo.
27
+ */
28
+ export interface ToolPackage {
29
+ /** Shown by list_tool_packages, so write it for whoever picks a package. */
30
+ description: string;
31
+ /** Tool names, or ["*"] for everything. May name tools that do not exist yet. */
32
+ tools: string[];
33
+ }
34
+ export declare const TOOL_PACKAGES: Record<string, ToolPackage>;
35
+ /** The package used when MCP_TOOL_PACKAGE is unset or unusable. */
36
+ export declare const DEFAULT_PACKAGE = "full";
37
+ //# sourceMappingURL=tool-packages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.d.ts","sourceRoot":"","sources":["../../src/config/tool-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,WAAW;IACxB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAkLrD,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,eAAe,SAAS,CAAC"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Tool packages — named subsets of the tool surface.
3
+ *
4
+ * All 86 tools are registered by default, and their descriptions are long by
5
+ * design (`execute_script`'s runs to about thirteen lines, because it has to
6
+ * teach scoped-vs-global name qualification). That is a fixed cost paid on every
7
+ * session, and model tool-selection accuracy degrades as the option count grows.
8
+ * A user doing service-desk work does not need Flow Designer, ATF, or app
9
+ * publishing in front of them.
10
+ *
11
+ * Selected with MCP_TOOL_PACKAGE. Unset means "full", so the default behaviour
12
+ * is unchanged.
13
+ *
14
+ * ---
15
+ *
16
+ * ON NAMING TOOLS THAT DO NOT EXIST YET
17
+ *
18
+ * Packages may reference tools this server does not have. That is deliberate,
19
+ * not sloppiness: NEX-38 (user and group tools), NEX-39 (incident and change
20
+ * tools) and NEX-46 (workflow execution) are all open, and their tools belong in
21
+ * these packages the day they land. Naming them now means the package is already
22
+ * right rather than something someone has to remember to revisit.
23
+ *
24
+ * Unknown names are reported once at startup and skipped. They are a warning
25
+ * rather than an error precisely because forward references are expected — but
26
+ * they are still surfaced, because the same warning catches a genuine typo.
27
+ */
28
+ export const TOOL_PACKAGES = {
29
+ full: {
30
+ description: "Every tool. The default when MCP_TOOL_PACKAGE is unset.",
31
+ tools: ["*"],
32
+ },
33
+ readonly: {
34
+ description: "Only tools that cannot modify anything — safe to expose when the session " +
35
+ "should be able to investigate but never change the instance. Derived from " +
36
+ "the readOnlyHint annotations rather than hand-listed, so it cannot drift.",
37
+ // Resolved dynamically; see resolveReadonlyPackage in common/tool-packages.ts.
38
+ tools: ["@readonly"],
39
+ },
40
+ developer: {
41
+ description: "Building and debugging on an instance: scripts, schema, source sync, " +
42
+ "update sets, scope, logs and code search.",
43
+ tools: [
44
+ "execute_script",
45
+ "query_table",
46
+ "query_syslog",
47
+ "count_records",
48
+ "aggregate_query",
49
+ "aggregate_grouped",
50
+ "discover_table_schema",
51
+ "explain_field",
52
+ "lookup_table",
53
+ "lookup_columns",
54
+ "lookup_app",
55
+ "list_instance_tables",
56
+ "pull_script",
57
+ "push_script",
58
+ "code_search",
59
+ "list_code_search_groups",
60
+ "list_code_search_tables",
61
+ "add_code_search_table",
62
+ "get_current_update_set",
63
+ "list_update_sets",
64
+ "create_update_set",
65
+ "set_current_update_set",
66
+ "inspect_update_set",
67
+ "clone_update_set",
68
+ "move_update_set_records",
69
+ "get_current_scope",
70
+ "set_current_scope",
71
+ "list_scoped_apps",
72
+ "check_instance_health",
73
+ "find_task",
74
+ "export_record_xml",
75
+ "import_records_xml",
76
+ ],
77
+ },
78
+ service_desk: {
79
+ description: "Working tickets: find and update tasks, read knowledge, raise catalog " +
80
+ "requests. No scripting, no schema, no app lifecycle.",
81
+ tools: [
82
+ "find_task",
83
+ "query_table",
84
+ "add_task_comment",
85
+ "assign_task",
86
+ "resolve_incident",
87
+ "close_incident",
88
+ "approve_change",
89
+ "list_knowledge_bases",
90
+ "list_kb_articles",
91
+ "get_kb_article",
92
+ "list_catalog_items",
93
+ "get_catalog_item",
94
+ "list_catalog_item_variables",
95
+ "submit_catalog_request",
96
+ "list_attachments",
97
+ "get_attachment_info",
98
+ // Pending NEX-39.
99
+ "create_incident",
100
+ "update_incident",
101
+ "add_work_note",
102
+ ],
103
+ },
104
+ admin: {
105
+ description: "Instance administration: users and groups, plugins, health, logs, and " +
106
+ "scripting. Deliberately includes execute_script — an admin package " +
107
+ "without it is not an admin package.",
108
+ tools: [
109
+ "query_table",
110
+ "query_syslog",
111
+ "count_records",
112
+ "find_task",
113
+ "execute_script",
114
+ "list_plugins",
115
+ "list_instance_tables",
116
+ "check_instance_health",
117
+ "list_scoped_apps",
118
+ "get_app_details",
119
+ "list_company_apps",
120
+ "search_store_apps",
121
+ "validate_app_install",
122
+ "install_store_app",
123
+ "update_store_app",
124
+ // Pending NEX-38.
125
+ "find_user",
126
+ "list_users",
127
+ "create_user",
128
+ "update_user",
129
+ "list_groups",
130
+ "get_group_members",
131
+ "add_group_members",
132
+ "remove_group_members",
133
+ "assign_user_role",
134
+ "remove_user_role",
135
+ ],
136
+ },
137
+ change_manager: {
138
+ description: "Change and release work: change approvals, update sets, flows and " +
139
+ "workflows, and the app repo.",
140
+ tools: [
141
+ "find_task",
142
+ "query_table",
143
+ "approve_change",
144
+ "add_task_comment",
145
+ "get_current_update_set",
146
+ "list_update_sets",
147
+ "create_update_set",
148
+ "set_current_update_set",
149
+ "inspect_update_set",
150
+ "clone_update_set",
151
+ "move_update_set_records",
152
+ "execute_flow",
153
+ "get_flow_context_status",
154
+ "get_flow_outputs",
155
+ "get_flow_error",
156
+ "get_flow_logs",
157
+ "cancel_flow",
158
+ "create_workflow",
159
+ "install_from_app_repo",
160
+ "publish_to_app_repo",
161
+ // Pending NEX-39 and NEX-46.
162
+ "create_change_request",
163
+ "update_change_request",
164
+ "get_change_details",
165
+ "add_change_task",
166
+ "get_workflow_versions",
167
+ "execute_workflow",
168
+ ],
169
+ },
170
+ flow_developer: {
171
+ description: "Flow Designer work end to end: run, test, copy, inspect and diagnose " +
172
+ "flows, plus the schema and logs needed to debug them.",
173
+ tools: [
174
+ "execute_flow",
175
+ "execute_subflow",
176
+ "execute_action",
177
+ "test_flow",
178
+ "copy_flow",
179
+ "cancel_flow",
180
+ "get_flow_context_status",
181
+ "get_flow_outputs",
182
+ "get_flow_error",
183
+ "get_flow_execution_details",
184
+ "get_flow_logs",
185
+ "query_table",
186
+ "query_syslog",
187
+ "discover_table_schema",
188
+ "lookup_table",
189
+ "get_current_scope",
190
+ "set_current_scope",
191
+ "list_scoped_apps",
192
+ ],
193
+ },
194
+ };
195
+ /** The package used when MCP_TOOL_PACKAGE is unset or unusable. */
196
+ export const DEFAULT_PACKAGE = "full";
197
+ //# sourceMappingURL=tool-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.js","sourceRoot":"","sources":["../../src/config/tool-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH,MAAM,CAAC,MAAM,aAAa,GAAgC;IACtD,IAAI,EAAE;QACF,WAAW,EAAE,yDAAyD;QACtE,KAAK,EAAE,CAAC,GAAG,CAAC;KACf;IAED,QAAQ,EAAE;QACN,WAAW,EACP,2EAA2E;YAC3E,4EAA4E;YAC5E,2EAA2E;QAC/E,+EAA+E;QAC/E,KAAK,EAAE,CAAC,WAAW,CAAC;KACvB;IAED,SAAS,EAAE;QACP,WAAW,EACP,uEAAuE;YACvE,2CAA2C;QAC/C,KAAK,EAAE;YACH,gBAAgB;YAChB,aAAa;YACb,cAAc;YACd,eAAe;YACf,iBAAiB;YACjB,mBAAmB;YACnB,uBAAuB;YACvB,eAAe;YACf,cAAc;YACd,gBAAgB;YAChB,YAAY;YACZ,sBAAsB;YACtB,aAAa;YACb,aAAa;YACb,aAAa;YACb,yBAAyB;YACzB,yBAAyB;YACzB,uBAAuB;YACvB,wBAAwB;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c;YACd,yBAAyB;YACzB,kBAAkB;YAClB,gBAAgB;YAChB,eAAe;YACf,aAAa;YACb,iBAAiB;YACjB,uBAAuB;YACvB,qBAAqB;YACrB,6BAA6B;YAC7B,uBAAuB;YACvB,uBAAuB;YACvB,oBAAoB;YACpB,iBAAiB;YACjB,uBAAuB;YACvB,kBAAkB;SACrB;KACJ;IAED,cAAc,EAAE;QACZ,WAAW,EACP,uEAAuE;YACvE,uDAAuD;QAC3D,KAAK,EAAE;YACH,cAAc;YACd,iBAAiB;YACjB,gBAAgB;YAChB,WAAW;YACX,WAAW;YACX,aAAa;YACb,yBAAyB;YACzB,kBAAkB;YAClB,gBAAgB;YAChB,4BAA4B;YAC5B,eAAe;YACf,aAAa;YACb,cAAc;YACd,uBAAuB;YACvB,cAAc;YACd,mBAAmB;YACnB,mBAAmB;YACnB,kBAAkB;SACrB;KACJ;CACJ,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -5,35 +5,11 @@
5
5
  import "./common/credstore-boot.js";
6
6
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
7
  import { registerServiceNowResources } from "./resources/servicenow.js";
8
+ import { TOOL_REGISTRY } from "./tools/registry.js";
9
+ import { registerListToolPackagesTool } from "./tools/tool-packages.js";
10
+ import { resolveToolPackage, reportResolution } from "./common/tool-packages.js";
8
11
  import { readServerVersion } from "./common/version.js";
9
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
- import { registerExecuteScriptTool } from "./tools/execute-script.js";
11
- import { registerRunAtfTestTool, registerRunAtfTestSuiteTool, } from "./tools/atf.js";
12
- import { registerQueryTableTool } from "./tools/query-table.js";
13
- import { registerFindAtfTestsTool } from "./tools/find-atf-tests.js";
14
- import { registerQuerySyslogTool } from "./tools/query-syslog.js";
15
- import { registerLookupAppTool } from "./tools/lookup-app.js";
16
- import { registerLookupTableTool } from "./tools/lookup-table.js";
17
- import { registerLookupColumnsTool } from "./tools/lookup-columns.js";
18
- import { registerCodeSearchTool, registerListCodeSearchGroupsTool, registerListCodeSearchTablesTool, registerAddCodeSearchTableTool, } from "./tools/codesearch.js";
19
- import { registerDiscoverTableSchemaTool, registerExplainFieldTool, registerValidateCatalogTool, } from "./tools/schema.js";
20
- import { registerGetCurrentScopeTool, registerSetCurrentScopeTool, registerListScopedAppsTool, } from "./tools/scope.js";
21
- import { registerGetCurrentUpdateSetTool, registerListUpdateSetsTool, registerCreateUpdateSetTool, registerSetCurrentUpdateSetTool, registerInspectUpdateSetTool, registerCloneUpdateSetTool, registerMoveUpdateSetRecordsTool, } from "./tools/updateset.js";
22
- import { registerAddTaskCommentTool, registerAssignTaskTool, registerResolveIncidentTool, registerCloseIncidentTool, registerApproveChangeTool, registerFindTaskTool, } from "./tools/task.js";
23
- import { registerBatchCreateRecordsTool, registerBatchUpdateRecordsTool, } from "./tools/batch.js";
24
- import { registerListAttachmentsTool, registerGetAttachmentInfoTool, registerUploadAttachmentTool, } from "./tools/attachment.js";
25
- import { registerGetAppDetailsTool, registerValidateAppInstallTool, registerSearchStoreAppsTool, registerListCompanyAppsTool, registerInstallStoreAppTool, registerUpdateStoreAppTool, registerInstallFromAppRepoTool, registerPublishToAppRepoTool, } from "./tools/app-manager.js";
26
- import { registerCreateWorkflowTool } from "./tools/workflow.js";
27
- import { registerPullScriptTool, registerPushScriptTool, } from "./tools/scriptsync.js";
28
- import { registerCountRecordsTool, registerAggregateQueryTool, registerAggregateGroupedTool, } from "./tools/aggregate.js";
29
- import { registerCheckInstanceHealthTool } from "./tools/health.js";
30
- import { registerGetCmdbRelationshipsTool, registerTraverseCmdbGraphTool, } from "./tools/cmdb.js";
31
- import { registerListInstanceTablesTool, registerListPluginsTool, } from "./tools/discovery.js";
32
- import { registerQueryUpdateRecordsTool, registerQueryDeleteRecordsTool, } from "./tools/query-batch.js";
33
- import { registerExportRecordXmlTool, registerImportRecordsXmlTool, } from "./tools/xml-record.js";
34
- import { registerListKnowledgeBasesTool, registerGetKnowledgeBaseTool, registerListKbCategoriesTool, registerCreateKbCategoryTool, registerListKbArticlesTool, registerGetKbArticleTool, registerCreateKbArticleTool, registerUpdateKbArticleTool, registerPublishKbArticleTool, } from "./tools/knowledge.js";
35
- import { registerListCatalogItemsTool, registerGetCatalogItemTool, registerListCatalogCategoriesTool, registerGetCatalogCategoryTool, registerListCatalogItemVariablesTool, registerSubmitCatalogRequestTool, } from "./tools/catalog.js";
36
- import { registerExecuteFlowTool, registerExecuteSubflowTool, registerExecuteActionTool, registerGetFlowContextStatusTool, registerGetFlowOutputsTool, registerGetFlowErrorTool, registerCancelFlowTool, registerTestFlowTool, registerCopyFlowTool, registerGetFlowExecutionDetailsTool, registerGetFlowLogsTool, } from "./tools/flow.js";
37
13
  const server = new McpServer({
38
14
  name: "now-sdk-ext-mcp",
39
15
  version: readServerVersion(),
@@ -49,93 +25,19 @@ const server = new McpServer({
49
25
  },
50
26
  });
51
27
  registerServiceNowResources(server);
52
- // Register tools
53
- registerExecuteScriptTool(server);
54
- registerRunAtfTestTool(server);
55
- registerRunAtfTestSuiteTool(server);
56
- registerQueryTableTool(server);
57
- registerFindAtfTestsTool(server);
58
- registerQuerySyslogTool(server);
59
- registerLookupAppTool(server);
60
- registerLookupTableTool(server);
61
- registerLookupColumnsTool(server);
62
- registerCodeSearchTool(server);
63
- registerListCodeSearchGroupsTool(server);
64
- registerListCodeSearchTablesTool(server);
65
- registerAddCodeSearchTableTool(server);
66
- registerDiscoverTableSchemaTool(server);
67
- registerExplainFieldTool(server);
68
- registerValidateCatalogTool(server);
69
- registerGetCurrentScopeTool(server);
70
- registerSetCurrentScopeTool(server);
71
- registerListScopedAppsTool(server);
72
- registerGetCurrentUpdateSetTool(server);
73
- registerListUpdateSetsTool(server);
74
- registerCreateUpdateSetTool(server);
75
- registerSetCurrentUpdateSetTool(server);
76
- registerInspectUpdateSetTool(server);
77
- registerAddTaskCommentTool(server);
78
- registerAssignTaskTool(server);
79
- registerResolveIncidentTool(server);
80
- registerCloseIncidentTool(server);
81
- registerApproveChangeTool(server);
82
- registerFindTaskTool(server);
83
- registerBatchCreateRecordsTool(server);
84
- registerBatchUpdateRecordsTool(server);
85
- registerListAttachmentsTool(server);
86
- registerGetAttachmentInfoTool(server);
87
- registerGetAppDetailsTool(server);
88
- registerValidateAppInstallTool(server);
89
- registerSearchStoreAppsTool(server);
90
- registerListCompanyAppsTool(server);
91
- registerInstallStoreAppTool(server);
92
- registerUpdateStoreAppTool(server);
93
- registerInstallFromAppRepoTool(server);
94
- registerPublishToAppRepoTool(server);
95
- registerCreateWorkflowTool(server);
96
- registerPullScriptTool(server);
97
- registerPushScriptTool(server);
98
- registerCountRecordsTool(server);
99
- registerAggregateQueryTool(server);
100
- registerAggregateGroupedTool(server);
101
- registerCheckInstanceHealthTool(server);
102
- registerGetCmdbRelationshipsTool(server);
103
- registerTraverseCmdbGraphTool(server);
104
- registerListInstanceTablesTool(server);
105
- registerListPluginsTool(server);
106
- registerQueryUpdateRecordsTool(server);
107
- registerQueryDeleteRecordsTool(server);
108
- registerCloneUpdateSetTool(server);
109
- registerMoveUpdateSetRecordsTool(server);
110
- registerUploadAttachmentTool(server);
111
- registerExportRecordXmlTool(server);
112
- registerImportRecordsXmlTool(server);
113
- registerListKnowledgeBasesTool(server);
114
- registerGetKnowledgeBaseTool(server);
115
- registerListKbCategoriesTool(server);
116
- registerCreateKbCategoryTool(server);
117
- registerListKbArticlesTool(server);
118
- registerGetKbArticleTool(server);
119
- registerCreateKbArticleTool(server);
120
- registerUpdateKbArticleTool(server);
121
- registerPublishKbArticleTool(server);
122
- registerListCatalogItemsTool(server);
123
- registerGetCatalogItemTool(server);
124
- registerListCatalogCategoriesTool(server);
125
- registerGetCatalogCategoryTool(server);
126
- registerListCatalogItemVariablesTool(server);
127
- registerSubmitCatalogRequestTool(server);
128
- registerExecuteFlowTool(server);
129
- registerExecuteSubflowTool(server);
130
- registerExecuteActionTool(server);
131
- registerGetFlowContextStatusTool(server);
132
- registerGetFlowOutputsTool(server);
133
- registerGetFlowErrorTool(server);
134
- registerCancelFlowTool(server);
135
- registerTestFlowTool(server);
136
- registerCopyFlowTool(server);
137
- registerGetFlowExecutionDetailsTool(server);
138
- registerGetFlowLogsTool(server);
28
+ // Tools are registered through the registry rather than 86 direct calls, so a
29
+ // package can select a subset. Resolution happens once, before registration —
30
+ // filtering after the fact would still pay the import cost and still advertise
31
+ // the tools in tools/list.
32
+ const activePackage = resolveToolPackage(process.env.MCP_TOOL_PACKAGE);
33
+ reportResolution(activePackage);
34
+ for (const name of activePackage.tools) {
35
+ TOOL_REGISTRY[name](server);
36
+ }
37
+ // Always registered, whatever the package. A filtered session otherwise has no
38
+ // way to tell "this server cannot do that" from "that tool is filtered out of
39
+ // this session".
40
+ registerListToolPackagesTool(server, activePackage);
139
41
  // Prevent the process from crashing silently on unexpected errors.
140
42
  // Log to stderr (stdout is reserved for JSON-RPC).
141
43
  process.on("uncaughtException", (error) => {
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,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE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AAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AACvE,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAEhC,KAAK,MAAM,IAAI,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;IACvC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,+EAA+E;AAC/E,8EAA8E;AAC9E,iBAAiB;AACjB,4BAA4B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAGpD,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"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Tool name -> registration function.
3
+ *
4
+ * index.ts used to call all 86 registration functions directly, which meant the
5
+ * only way to know which tools exist was to read 86 lines of imports. Nothing
6
+ * could ask "which tools are there?" without registering them.
7
+ *
8
+ * This table makes the set addressable, so a package can name a subset and
9
+ * something can register exactly that. It is the same shape as TOOL_ANNOTATIONS
10
+ * in common/annotations.ts — deliberately, since they are keyed identically and
11
+ * a test asserts they cover the same set. Two tables that must agree are worth
12
+ * having only if something checks that they do.
13
+ *
14
+ * GENERATED-ISH: derived from src/tools/*.ts, but checked in and maintained by
15
+ * hand. A new tool has to be added here or it cannot be registered at all —
16
+ * which is the point, and is asserted by a test rather than left to memory.
17
+ */
18
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
19
+ /** Registers exactly one tool on the server. */
20
+ export type ToolRegistrar = (server: McpServer) => void;
21
+ export declare const TOOL_REGISTRY: Record<string, ToolRegistrar>;
22
+ /** Every tool name this server knows how to register. */
23
+ export declare function allToolNames(): string[];
24
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+IpE,gDAAgD;AAChD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;AAExD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAkHvD,CAAC;AAEF,yDAAyD;AACzD,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Tool name -> registration function.
3
+ *
4
+ * index.ts used to call all 86 registration functions directly, which meant the
5
+ * only way to know which tools exist was to read 86 lines of imports. Nothing
6
+ * could ask "which tools are there?" without registering them.
7
+ *
8
+ * This table makes the set addressable, so a package can name a subset and
9
+ * something can register exactly that. It is the same shape as TOOL_ANNOTATIONS
10
+ * in common/annotations.ts — deliberately, since they are keyed identically and
11
+ * a test asserts they cover the same set. Two tables that must agree are worth
12
+ * having only if something checks that they do.
13
+ *
14
+ * GENERATED-ISH: derived from src/tools/*.ts, but checked in and maintained by
15
+ * hand. A new tool has to be added here or it cannot be registered at all —
16
+ * which is the point, and is asserted by a test rather than left to memory.
17
+ */
18
+ import { registerAggregateGroupedTool, registerAggregateQueryTool, registerCountRecordsTool, } from "../tools/aggregate.js";
19
+ import { registerGetAppDetailsTool, registerInstallFromAppRepoTool, registerInstallStoreAppTool, registerListCompanyAppsTool, registerPublishToAppRepoTool, registerSearchStoreAppsTool, registerUpdateStoreAppTool, registerValidateAppInstallTool, } from "../tools/app-manager.js";
20
+ import { registerRunAtfTestSuiteTool, registerRunAtfTestTool, } from "../tools/atf.js";
21
+ import { registerGetAttachmentInfoTool, registerListAttachmentsTool, registerUploadAttachmentTool, } from "../tools/attachment.js";
22
+ import { registerBatchCreateRecordsTool, registerBatchUpdateRecordsTool, } from "../tools/batch.js";
23
+ import { registerGetCatalogCategoryTool, registerGetCatalogItemTool, registerListCatalogCategoriesTool, registerListCatalogItemVariablesTool, registerListCatalogItemsTool, registerSubmitCatalogRequestTool, } from "../tools/catalog.js";
24
+ import { registerGetCmdbRelationshipsTool, registerTraverseCmdbGraphTool, } from "../tools/cmdb.js";
25
+ import { registerAddCodeSearchTableTool, registerCodeSearchTool, registerListCodeSearchGroupsTool, registerListCodeSearchTablesTool, } from "../tools/codesearch.js";
26
+ import { registerListInstanceTablesTool, registerListPluginsTool, } from "../tools/discovery.js";
27
+ import { registerExecuteScriptTool, } from "../tools/execute-script.js";
28
+ import { registerFindAtfTestsTool, } from "../tools/find-atf-tests.js";
29
+ import { registerCancelFlowTool, registerCopyFlowTool, registerExecuteActionTool, registerExecuteFlowTool, registerExecuteSubflowTool, registerGetFlowContextStatusTool, registerGetFlowErrorTool, registerGetFlowExecutionDetailsTool, registerGetFlowLogsTool, registerGetFlowOutputsTool, registerTestFlowTool, } from "../tools/flow.js";
30
+ import { registerCheckInstanceHealthTool, } from "../tools/health.js";
31
+ import { registerCreateKbArticleTool, registerCreateKbCategoryTool, registerGetKbArticleTool, registerGetKnowledgeBaseTool, registerListKbArticlesTool, registerListKbCategoriesTool, registerListKnowledgeBasesTool, registerPublishKbArticleTool, registerUpdateKbArticleTool, } from "../tools/knowledge.js";
32
+ import { registerLookupAppTool, } from "../tools/lookup-app.js";
33
+ import { registerLookupColumnsTool, } from "../tools/lookup-columns.js";
34
+ import { registerLookupTableTool, } from "../tools/lookup-table.js";
35
+ import { registerQueryDeleteRecordsTool, registerQueryUpdateRecordsTool, } from "../tools/query-batch.js";
36
+ import { registerQuerySyslogTool, } from "../tools/query-syslog.js";
37
+ import { registerQueryTableTool, } from "../tools/query-table.js";
38
+ import { registerDiscoverTableSchemaTool, registerExplainFieldTool, registerValidateCatalogTool, } from "../tools/schema.js";
39
+ import { registerGetCurrentScopeTool, registerListScopedAppsTool, registerSetCurrentScopeTool, } from "../tools/scope.js";
40
+ import { registerPullScriptTool, registerPushScriptTool, } from "../tools/scriptsync.js";
41
+ import { registerAddTaskCommentTool, registerApproveChangeTool, registerAssignTaskTool, registerCloseIncidentTool, registerFindTaskTool, registerResolveIncidentTool, } from "../tools/task.js";
42
+ import { registerCloneUpdateSetTool, registerCreateUpdateSetTool, registerGetCurrentUpdateSetTool, registerInspectUpdateSetTool, registerListUpdateSetsTool, registerMoveUpdateSetRecordsTool, registerSetCurrentUpdateSetTool, } from "../tools/updateset.js";
43
+ import { registerCreateWorkflowTool, } from "../tools/workflow.js";
44
+ import { registerExportRecordXmlTool, registerImportRecordsXmlTool, } from "../tools/xml-record.js";
45
+ export const TOOL_REGISTRY = {
46
+ // ---- aggregate
47
+ aggregate_grouped: registerAggregateGroupedTool,
48
+ aggregate_query: registerAggregateQueryTool,
49
+ count_records: registerCountRecordsTool,
50
+ // ---- app-manager
51
+ get_app_details: registerGetAppDetailsTool,
52
+ install_from_app_repo: registerInstallFromAppRepoTool,
53
+ install_store_app: registerInstallStoreAppTool,
54
+ list_company_apps: registerListCompanyAppsTool,
55
+ publish_to_app_repo: registerPublishToAppRepoTool,
56
+ search_store_apps: registerSearchStoreAppsTool,
57
+ update_store_app: registerUpdateStoreAppTool,
58
+ validate_app_install: registerValidateAppInstallTool,
59
+ // ---- atf
60
+ run_atf_test: registerRunAtfTestTool,
61
+ run_atf_test_suite: registerRunAtfTestSuiteTool,
62
+ // ---- attachment
63
+ get_attachment_info: registerGetAttachmentInfoTool,
64
+ list_attachments: registerListAttachmentsTool,
65
+ upload_attachment: registerUploadAttachmentTool,
66
+ // ---- batch
67
+ batch_create_records: registerBatchCreateRecordsTool,
68
+ batch_update_records: registerBatchUpdateRecordsTool,
69
+ // ---- catalog
70
+ get_catalog_category: registerGetCatalogCategoryTool,
71
+ get_catalog_item: registerGetCatalogItemTool,
72
+ list_catalog_categories: registerListCatalogCategoriesTool,
73
+ list_catalog_item_variables: registerListCatalogItemVariablesTool,
74
+ list_catalog_items: registerListCatalogItemsTool,
75
+ submit_catalog_request: registerSubmitCatalogRequestTool,
76
+ // ---- cmdb
77
+ get_cmdb_relationships: registerGetCmdbRelationshipsTool,
78
+ traverse_cmdb_graph: registerTraverseCmdbGraphTool,
79
+ // ---- codesearch
80
+ add_code_search_table: registerAddCodeSearchTableTool,
81
+ code_search: registerCodeSearchTool,
82
+ list_code_search_groups: registerListCodeSearchGroupsTool,
83
+ list_code_search_tables: registerListCodeSearchTablesTool,
84
+ // ---- discovery
85
+ list_instance_tables: registerListInstanceTablesTool,
86
+ list_plugins: registerListPluginsTool,
87
+ // ---- execute-script
88
+ execute_script: registerExecuteScriptTool,
89
+ // ---- find-atf-tests
90
+ find_atf_tests: registerFindAtfTestsTool,
91
+ // ---- flow
92
+ cancel_flow: registerCancelFlowTool,
93
+ copy_flow: registerCopyFlowTool,
94
+ execute_action: registerExecuteActionTool,
95
+ execute_flow: registerExecuteFlowTool,
96
+ execute_subflow: registerExecuteSubflowTool,
97
+ get_flow_context_status: registerGetFlowContextStatusTool,
98
+ get_flow_error: registerGetFlowErrorTool,
99
+ get_flow_execution_details: registerGetFlowExecutionDetailsTool,
100
+ get_flow_logs: registerGetFlowLogsTool,
101
+ get_flow_outputs: registerGetFlowOutputsTool,
102
+ test_flow: registerTestFlowTool,
103
+ // ---- health
104
+ check_instance_health: registerCheckInstanceHealthTool,
105
+ // ---- knowledge
106
+ create_kb_article: registerCreateKbArticleTool,
107
+ create_kb_category: registerCreateKbCategoryTool,
108
+ get_kb_article: registerGetKbArticleTool,
109
+ get_knowledge_base: registerGetKnowledgeBaseTool,
110
+ list_kb_articles: registerListKbArticlesTool,
111
+ list_kb_categories: registerListKbCategoriesTool,
112
+ list_knowledge_bases: registerListKnowledgeBasesTool,
113
+ publish_kb_article: registerPublishKbArticleTool,
114
+ update_kb_article: registerUpdateKbArticleTool,
115
+ // ---- lookup-app
116
+ lookup_app: registerLookupAppTool,
117
+ // ---- lookup-columns
118
+ lookup_columns: registerLookupColumnsTool,
119
+ // ---- lookup-table
120
+ lookup_table: registerLookupTableTool,
121
+ // ---- query-batch
122
+ query_delete_records: registerQueryDeleteRecordsTool,
123
+ query_update_records: registerQueryUpdateRecordsTool,
124
+ // ---- query-syslog
125
+ query_syslog: registerQuerySyslogTool,
126
+ // ---- query-table
127
+ query_table: registerQueryTableTool,
128
+ // ---- schema
129
+ discover_table_schema: registerDiscoverTableSchemaTool,
130
+ explain_field: registerExplainFieldTool,
131
+ validate_catalog: registerValidateCatalogTool,
132
+ // ---- scope
133
+ get_current_scope: registerGetCurrentScopeTool,
134
+ list_scoped_apps: registerListScopedAppsTool,
135
+ set_current_scope: registerSetCurrentScopeTool,
136
+ // ---- scriptsync
137
+ pull_script: registerPullScriptTool,
138
+ push_script: registerPushScriptTool,
139
+ // ---- task
140
+ add_task_comment: registerAddTaskCommentTool,
141
+ approve_change: registerApproveChangeTool,
142
+ assign_task: registerAssignTaskTool,
143
+ close_incident: registerCloseIncidentTool,
144
+ find_task: registerFindTaskTool,
145
+ resolve_incident: registerResolveIncidentTool,
146
+ // ---- updateset
147
+ clone_update_set: registerCloneUpdateSetTool,
148
+ create_update_set: registerCreateUpdateSetTool,
149
+ get_current_update_set: registerGetCurrentUpdateSetTool,
150
+ inspect_update_set: registerInspectUpdateSetTool,
151
+ list_update_sets: registerListUpdateSetsTool,
152
+ move_update_set_records: registerMoveUpdateSetRecordsTool,
153
+ set_current_update_set: registerSetCurrentUpdateSetTool,
154
+ // ---- workflow
155
+ create_workflow: registerCreateWorkflowTool,
156
+ // ---- xml-record
157
+ export_record_xml: registerExportRecordXmlTool,
158
+ import_records_xml: registerImportRecordsXmlTool,
159
+ };
160
+ /** Every tool name this server knows how to register. */
161
+ export function allToolNames() {
162
+ return Object.keys(TOOL_REGISTRY);
163
+ }
164
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,iCAAiC,EACjC,oCAAoC,EACpC,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAC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WAAW,EAAE,sBAAsB;IACnC,cAAc;IACd,qBAAqB,EAAE,+BAA+B;IACtD,aAAa,EAAE,wBAAwB;IACvC,gBAAgB,EAAE,2BAA2B;IAC7C,aAAa;IACb,iBAAiB,EAAE,2BAA2B;IAC9C,gBAAgB,EAAE,0BAA0B;IAC5C,iBAAiB,EAAE,2BAA2B;IAC9C,kBAAkB;IAClB,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,sBAAsB;IACnC,YAAY;IACZ,gBAAgB,EAAE,0BAA0B;IAC5C,cAAc,EAAE,yBAAyB;IACzC,WAAW,EAAE,sBAAsB;IACnC,cAAc,EAAE,yBAAyB;IACzC,SAAS,EAAE,oBAAoB;IAC/B,gBAAgB,EAAE,2BAA2B;IAC7C,iBAAiB;IACjB,gBAAgB,EAAE,0BAA0B;IAC5C,iBAAiB,EAAE,2BAA2B;IAC9C,sBAAsB,EAAE,+BAA+B;IACvD,kBAAkB,EAAE,4BAA4B;IAChD,gBAAgB,EAAE,0BAA0B;IAC5C,uBAAuB,EAAE,gCAAgC;IACzD,sBAAsB,EAAE,+BAA+B;IACvD,gBAAgB;IAChB,eAAe,EAAE,0BAA0B;IAC3C,kBAAkB;IAClB,iBAAiB,EAAE,2BAA2B;IAC9C,kBAAkB,EAAE,4BAA4B;CACjD,CAAC;AAEF,yDAAyD;AACzD,MAAM,UAAU,YAAY;IACxB,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ResolvedPackage } from "../common/tool-packages.js";
3
+ /**
4
+ * `list_tool_packages` — what is loaded, and what else could be.
5
+ *
6
+ * Registered regardless of the active package, deliberately. If a filtered
7
+ * session could not see this, a model working with a reduced surface would have
8
+ * no way to tell whether a tool is genuinely absent from the server or merely
9
+ * filtered out of this session — and would report "that capability does not
10
+ * exist" when the truth is "ask your administrator for a different package".
11
+ */
12
+ export declare function registerListToolPackagesTool(server: McpServer, active: ResolvedPackage): void;
13
+ //# sourceMappingURL=tool-packages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.d.ts","sourceRoot":"","sources":["../../src/tools/tool-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAsB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIjF;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA8C7F"}
@@ -0,0 +1,50 @@
1
+ import { TOOL_PACKAGES } from "../config/tool-packages.js";
2
+ import { resolveToolPackage } from "../common/tool-packages.js";
3
+ import { allToolNames } from "./registry.js";
4
+ import { annotationsFor } from "../common/annotations.js";
5
+ /**
6
+ * `list_tool_packages` — what is loaded, and what else could be.
7
+ *
8
+ * Registered regardless of the active package, deliberately. If a filtered
9
+ * session could not see this, a model working with a reduced surface would have
10
+ * no way to tell whether a tool is genuinely absent from the server or merely
11
+ * filtered out of this session — and would report "that capability does not
12
+ * exist" when the truth is "ask your administrator for a different package".
13
+ */
14
+ export function registerListToolPackagesTool(server, active) {
15
+ server.registerTool("list_tool_packages", {
16
+ annotations: annotationsFor("list_tool_packages"),
17
+ title: "List Tool Packages",
18
+ description: "Show which tool package this session is running and what other packages exist. " +
19
+ "Use this when a capability you expected is missing: the tool may exist on the " +
20
+ "server but be filtered out of this session, in which case the answer is a " +
21
+ "different MCP_TOOL_PACKAGE rather than a missing feature.",
22
+ inputSchema: {},
23
+ }, () => {
24
+ const total = allToolNames().length;
25
+ const lines = [];
26
+ lines.push("=== Active ===");
27
+ lines.push(`Package(s): ${active.names.join(", ")}`);
28
+ lines.push(`Tools: ${active.tools.length} of ${total}`);
29
+ if (active.fellBack) {
30
+ lines.push(`NOTE: the requested package was not recognised, so "full" was substituted.`);
31
+ }
32
+ if (active.unknownPackages.length > 0) {
33
+ lines.push(`Unrecognised request(s): ${active.unknownPackages.join(", ")}`);
34
+ }
35
+ lines.push("");
36
+ lines.push("=== Available ===");
37
+ for (const [name, pkg] of Object.entries(TOOL_PACKAGES).sort(([a], [b]) => a.localeCompare(b))) {
38
+ // Resolve each so the count reflects what would actually register,
39
+ // not how many names the config happens to list.
40
+ const resolved = resolveToolPackage(name);
41
+ const marker = active.names.includes(name) ? " (active)" : "";
42
+ lines.push(`${name}${marker} — ${resolved.tools.length} tools`);
43
+ lines.push(` ${pkg.description}`);
44
+ }
45
+ lines.push("");
46
+ lines.push("Set MCP_TOOL_PACKAGE to change this. Comma-separated names are unioned.");
47
+ return { content: [{ type: "text", text: lines.join("\n") }] };
48
+ });
49
+ }
50
+ //# sourceMappingURL=tool-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-packages.js","sourceRoot":"","sources":["../../src/tools/tool-packages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAmB,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAuB;IACnF,MAAM,CAAC,YAAY,CACf,oBAAoB,EACpB;QACI,WAAW,EAAE,cAAc,CAAC,oBAAoB,CAAC;QACjD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACP,iFAAiF;YACjF,gFAAgF;YAChF,4EAA4E;YAC5E,2DAA2D;QAC/D,WAAW,EAAE,EAAE;KAClB,EACD,GAAG,EAAE;QACD,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC,MAAM,CAAC;QACpC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,KAAK,CAAC,IAAI,CAAC,gBAAgB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CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAEtF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IAC5E,CAAC,CACJ,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonisoft/now-sdk-ext-mcp",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "MCP server for interacting with ServiceNow instances via @sonisoft/now-sdk-ext-core",
5
5
  "keywords": [
6
6
  "servicenow",