@sonisoft/now-sdk-ext-mcp 4.3.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.
- package/README.md +2 -1
- package/dist/common/annotations.d.ts +8 -2
- package/dist/common/annotations.d.ts.map +1 -1
- package/dist/common/annotations.js +32 -15
- package/dist/common/annotations.js.map +1 -1
- package/dist/common/connection.d.ts +10 -0
- package/dist/common/connection.d.ts.map +1 -1
- package/dist/common/connection.js +11 -0
- package/dist/common/connection.js.map +1 -1
- package/dist/common/tool-packages.d.ts +37 -0
- package/dist/common/tool-packages.d.ts.map +1 -0
- package/dist/common/tool-packages.js +128 -0
- package/dist/common/tool-packages.js.map +1 -0
- package/dist/config/tool-packages.d.ts +37 -0
- package/dist/config/tool-packages.d.ts.map +1 -0
- package/dist/config/tool-packages.js +197 -0
- package/dist/config/tool-packages.js.map +1 -0
- package/dist/index.js +19 -114
- package/dist/index.js.map +1 -1
- package/dist/resources/servicenow.d.ts +32 -0
- package/dist/resources/servicenow.d.ts.map +1 -0
- package/dist/resources/servicenow.js +165 -0
- package/dist/resources/servicenow.js.map +1 -0
- package/dist/tools/registry.d.ts +24 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +164 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/tool-packages.d.ts +13 -0
- package/dist/tools/tool-packages.d.ts.map +1 -0
- package/dist/tools/tool-packages.js +50 -0
- package/dist/tools/tool-packages.js.map +1 -0
- package/package.json +1 -1
|
@@ -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,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CACN,4EAA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