@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
package/dist/index.js
CHANGED
|
@@ -4,35 +4,12 @@
|
|
|
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 { 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";
|
|
7
11
|
import { readServerVersion } from "./common/version.js";
|
|
8
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
-
import { registerExecuteScriptTool } from "./tools/execute-script.js";
|
|
10
|
-
import { registerRunAtfTestTool, registerRunAtfTestSuiteTool, } from "./tools/atf.js";
|
|
11
|
-
import { registerQueryTableTool } from "./tools/query-table.js";
|
|
12
|
-
import { registerFindAtfTestsTool } from "./tools/find-atf-tests.js";
|
|
13
|
-
import { registerQuerySyslogTool } from "./tools/query-syslog.js";
|
|
14
|
-
import { registerLookupAppTool } from "./tools/lookup-app.js";
|
|
15
|
-
import { registerLookupTableTool } from "./tools/lookup-table.js";
|
|
16
|
-
import { registerLookupColumnsTool } from "./tools/lookup-columns.js";
|
|
17
|
-
import { registerCodeSearchTool, registerListCodeSearchGroupsTool, registerListCodeSearchTablesTool, registerAddCodeSearchTableTool, } from "./tools/codesearch.js";
|
|
18
|
-
import { registerDiscoverTableSchemaTool, registerExplainFieldTool, registerValidateCatalogTool, } from "./tools/schema.js";
|
|
19
|
-
import { registerGetCurrentScopeTool, registerSetCurrentScopeTool, registerListScopedAppsTool, } from "./tools/scope.js";
|
|
20
|
-
import { registerGetCurrentUpdateSetTool, registerListUpdateSetsTool, registerCreateUpdateSetTool, registerSetCurrentUpdateSetTool, registerInspectUpdateSetTool, registerCloneUpdateSetTool, registerMoveUpdateSetRecordsTool, } from "./tools/updateset.js";
|
|
21
|
-
import { registerAddTaskCommentTool, registerAssignTaskTool, registerResolveIncidentTool, registerCloseIncidentTool, registerApproveChangeTool, registerFindTaskTool, } from "./tools/task.js";
|
|
22
|
-
import { registerBatchCreateRecordsTool, registerBatchUpdateRecordsTool, } from "./tools/batch.js";
|
|
23
|
-
import { registerListAttachmentsTool, registerGetAttachmentInfoTool, registerUploadAttachmentTool, } from "./tools/attachment.js";
|
|
24
|
-
import { registerGetAppDetailsTool, registerValidateAppInstallTool, registerSearchStoreAppsTool, registerListCompanyAppsTool, registerInstallStoreAppTool, registerUpdateStoreAppTool, registerInstallFromAppRepoTool, registerPublishToAppRepoTool, } from "./tools/app-manager.js";
|
|
25
|
-
import { registerCreateWorkflowTool } from "./tools/workflow.js";
|
|
26
|
-
import { registerPullScriptTool, registerPushScriptTool, } from "./tools/scriptsync.js";
|
|
27
|
-
import { registerCountRecordsTool, registerAggregateQueryTool, registerAggregateGroupedTool, } from "./tools/aggregate.js";
|
|
28
|
-
import { registerCheckInstanceHealthTool } from "./tools/health.js";
|
|
29
|
-
import { registerGetCmdbRelationshipsTool, registerTraverseCmdbGraphTool, } from "./tools/cmdb.js";
|
|
30
|
-
import { registerListInstanceTablesTool, registerListPluginsTool, } from "./tools/discovery.js";
|
|
31
|
-
import { registerQueryUpdateRecordsTool, registerQueryDeleteRecordsTool, } from "./tools/query-batch.js";
|
|
32
|
-
import { registerExportRecordXmlTool, registerImportRecordsXmlTool, } from "./tools/xml-record.js";
|
|
33
|
-
import { registerListKnowledgeBasesTool, registerGetKnowledgeBaseTool, registerListKbCategoriesTool, registerCreateKbCategoryTool, registerListKbArticlesTool, registerGetKbArticleTool, registerCreateKbArticleTool, registerUpdateKbArticleTool, registerPublishKbArticleTool, } from "./tools/knowledge.js";
|
|
34
|
-
import { registerListCatalogItemsTool, registerGetCatalogItemTool, registerListCatalogCategoriesTool, registerGetCatalogCategoryTool, registerListCatalogItemVariablesTool, registerSubmitCatalogRequestTool, } from "./tools/catalog.js";
|
|
35
|
-
import { registerExecuteFlowTool, registerExecuteSubflowTool, registerExecuteActionTool, registerGetFlowContextStatusTool, registerGetFlowOutputsTool, registerGetFlowErrorTool, registerCancelFlowTool, registerTestFlowTool, registerCopyFlowTool, registerGetFlowExecutionDetailsTool, registerGetFlowLogsTool, } from "./tools/flow.js";
|
|
36
13
|
const server = new McpServer({
|
|
37
14
|
name: "now-sdk-ext-mcp",
|
|
38
15
|
version: readServerVersion(),
|
|
@@ -44,95 +21,23 @@ const server = new McpServer({
|
|
|
44
21
|
// to advertise for it; the server just has to honour the token when it is sent.
|
|
45
22
|
capabilities: {
|
|
46
23
|
tools: {},
|
|
24
|
+
resources: {},
|
|
47
25
|
},
|
|
48
26
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
registerDiscoverTableSchemaTool(server);
|
|
64
|
-
registerExplainFieldTool(server);
|
|
65
|
-
registerValidateCatalogTool(server);
|
|
66
|
-
registerGetCurrentScopeTool(server);
|
|
67
|
-
registerSetCurrentScopeTool(server);
|
|
68
|
-
registerListScopedAppsTool(server);
|
|
69
|
-
registerGetCurrentUpdateSetTool(server);
|
|
70
|
-
registerListUpdateSetsTool(server);
|
|
71
|
-
registerCreateUpdateSetTool(server);
|
|
72
|
-
registerSetCurrentUpdateSetTool(server);
|
|
73
|
-
registerInspectUpdateSetTool(server);
|
|
74
|
-
registerAddTaskCommentTool(server);
|
|
75
|
-
registerAssignTaskTool(server);
|
|
76
|
-
registerResolveIncidentTool(server);
|
|
77
|
-
registerCloseIncidentTool(server);
|
|
78
|
-
registerApproveChangeTool(server);
|
|
79
|
-
registerFindTaskTool(server);
|
|
80
|
-
registerBatchCreateRecordsTool(server);
|
|
81
|
-
registerBatchUpdateRecordsTool(server);
|
|
82
|
-
registerListAttachmentsTool(server);
|
|
83
|
-
registerGetAttachmentInfoTool(server);
|
|
84
|
-
registerGetAppDetailsTool(server);
|
|
85
|
-
registerValidateAppInstallTool(server);
|
|
86
|
-
registerSearchStoreAppsTool(server);
|
|
87
|
-
registerListCompanyAppsTool(server);
|
|
88
|
-
registerInstallStoreAppTool(server);
|
|
89
|
-
registerUpdateStoreAppTool(server);
|
|
90
|
-
registerInstallFromAppRepoTool(server);
|
|
91
|
-
registerPublishToAppRepoTool(server);
|
|
92
|
-
registerCreateWorkflowTool(server);
|
|
93
|
-
registerPullScriptTool(server);
|
|
94
|
-
registerPushScriptTool(server);
|
|
95
|
-
registerCountRecordsTool(server);
|
|
96
|
-
registerAggregateQueryTool(server);
|
|
97
|
-
registerAggregateGroupedTool(server);
|
|
98
|
-
registerCheckInstanceHealthTool(server);
|
|
99
|
-
registerGetCmdbRelationshipsTool(server);
|
|
100
|
-
registerTraverseCmdbGraphTool(server);
|
|
101
|
-
registerListInstanceTablesTool(server);
|
|
102
|
-
registerListPluginsTool(server);
|
|
103
|
-
registerQueryUpdateRecordsTool(server);
|
|
104
|
-
registerQueryDeleteRecordsTool(server);
|
|
105
|
-
registerCloneUpdateSetTool(server);
|
|
106
|
-
registerMoveUpdateSetRecordsTool(server);
|
|
107
|
-
registerUploadAttachmentTool(server);
|
|
108
|
-
registerExportRecordXmlTool(server);
|
|
109
|
-
registerImportRecordsXmlTool(server);
|
|
110
|
-
registerListKnowledgeBasesTool(server);
|
|
111
|
-
registerGetKnowledgeBaseTool(server);
|
|
112
|
-
registerListKbCategoriesTool(server);
|
|
113
|
-
registerCreateKbCategoryTool(server);
|
|
114
|
-
registerListKbArticlesTool(server);
|
|
115
|
-
registerGetKbArticleTool(server);
|
|
116
|
-
registerCreateKbArticleTool(server);
|
|
117
|
-
registerUpdateKbArticleTool(server);
|
|
118
|
-
registerPublishKbArticleTool(server);
|
|
119
|
-
registerListCatalogItemsTool(server);
|
|
120
|
-
registerGetCatalogItemTool(server);
|
|
121
|
-
registerListCatalogCategoriesTool(server);
|
|
122
|
-
registerGetCatalogCategoryTool(server);
|
|
123
|
-
registerListCatalogItemVariablesTool(server);
|
|
124
|
-
registerSubmitCatalogRequestTool(server);
|
|
125
|
-
registerExecuteFlowTool(server);
|
|
126
|
-
registerExecuteSubflowTool(server);
|
|
127
|
-
registerExecuteActionTool(server);
|
|
128
|
-
registerGetFlowContextStatusTool(server);
|
|
129
|
-
registerGetFlowOutputsTool(server);
|
|
130
|
-
registerGetFlowErrorTool(server);
|
|
131
|
-
registerCancelFlowTool(server);
|
|
132
|
-
registerTestFlowTool(server);
|
|
133
|
-
registerCopyFlowTool(server);
|
|
134
|
-
registerGetFlowExecutionDetailsTool(server);
|
|
135
|
-
registerGetFlowLogsTool(server);
|
|
27
|
+
registerServiceNowResources(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);
|
|
136
41
|
// Prevent the process from crashing silently on unexpected errors.
|
|
137
42
|
// Log to stderr (stdout is reserved for JSON-RPC).
|
|
138
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,
|
|
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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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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only MCP resources over `servicenow://` URIs.
|
|
3
|
+
*
|
|
4
|
+
* Resources are for stable, addressable reference data a client may want to
|
|
5
|
+
* attach directly — table schemas, the current scope, the alias list. Tools stay
|
|
6
|
+
* for actions. Before this, every one of those required a tool call, which costs
|
|
7
|
+
* a round trip and puts transient reference data into the conversation as tool
|
|
8
|
+
* output.
|
|
9
|
+
*
|
|
10
|
+
* TWO RULES SHAPE EVERYTHING HERE:
|
|
11
|
+
*
|
|
12
|
+
* 1. Each resource is backed by the SAME core manager as its equivalent tool,
|
|
13
|
+
* and goes through `withConnectionRetry` exactly as tools do. A parallel
|
|
14
|
+
* fetch path is how you end up with a resource that returns nothing for
|
|
15
|
+
* users of the recommended credential setup while the tool beside it works.
|
|
16
|
+
*
|
|
17
|
+
* 2. Errors PROPAGATE rather than being returned as content. Tools return
|
|
18
|
+
* `{isError: true}` so a failure is visible in-band to a model that is
|
|
19
|
+
* reasoning about the result; a resource is attached, not reasoned over, so a
|
|
20
|
+
* failed read is a protocol error and the client decides how to surface it.
|
|
21
|
+
* Returning a JSON body describing a failure would look like successfully
|
|
22
|
+
* attached content that happens to say "failed".
|
|
23
|
+
*
|
|
24
|
+
* 3. The alias is part of the URI, not an implicit default. Tools take an
|
|
25
|
+
* optional `instance` argument; a resource has only its URI, so the instance
|
|
26
|
+
* has to be addressable — `servicenow://dev/schema/incident` is a different
|
|
27
|
+
* resource from `servicenow://prod/schema/incident`, and conflating them
|
|
28
|
+
* would be the cross-instance confusion the core guard exists to prevent.
|
|
29
|
+
*/
|
|
30
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
31
|
+
export declare function registerServiceNowResources(server: McpServer): void;
|
|
32
|
+
//# sourceMappingURL=servicenow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servicenow.d.ts","sourceRoot":"","sources":["../../src/resources/servicenow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAqJtF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+CnE"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only MCP resources over `servicenow://` URIs.
|
|
3
|
+
*
|
|
4
|
+
* Resources are for stable, addressable reference data a client may want to
|
|
5
|
+
* attach directly — table schemas, the current scope, the alias list. Tools stay
|
|
6
|
+
* for actions. Before this, every one of those required a tool call, which costs
|
|
7
|
+
* a round trip and puts transient reference data into the conversation as tool
|
|
8
|
+
* output.
|
|
9
|
+
*
|
|
10
|
+
* TWO RULES SHAPE EVERYTHING HERE:
|
|
11
|
+
*
|
|
12
|
+
* 1. Each resource is backed by the SAME core manager as its equivalent tool,
|
|
13
|
+
* and goes through `withConnectionRetry` exactly as tools do. A parallel
|
|
14
|
+
* fetch path is how you end up with a resource that returns nothing for
|
|
15
|
+
* users of the recommended credential setup while the tool beside it works.
|
|
16
|
+
*
|
|
17
|
+
* 2. Errors PROPAGATE rather than being returned as content. Tools return
|
|
18
|
+
* `{isError: true}` so a failure is visible in-band to a model that is
|
|
19
|
+
* reasoning about the result; a resource is attached, not reasoned over, so a
|
|
20
|
+
* failed read is a protocol error and the client decides how to surface it.
|
|
21
|
+
* Returning a JSON body describing a failure would look like successfully
|
|
22
|
+
* attached content that happens to say "failed".
|
|
23
|
+
*
|
|
24
|
+
* 3. The alias is part of the URI, not an implicit default. Tools take an
|
|
25
|
+
* optional `instance` argument; a resource has only its URI, so the instance
|
|
26
|
+
* has to be addressable — `servicenow://dev/schema/incident` is a different
|
|
27
|
+
* resource from `servicenow://prod/schema/incident`, and conflating them
|
|
28
|
+
* would be the cross-instance confusion the core guard exists to prevent.
|
|
29
|
+
*/
|
|
30
|
+
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
31
|
+
import { ScopeManager, UpdateSetManager, SchemaDiscovery } from "@sonisoft/now-sdk-ext-core";
|
|
32
|
+
import { listAliases } from "@sonisoft/sn-credstore";
|
|
33
|
+
import { withConnectionRetry, isCredStoreActive } from "../common/connection.js";
|
|
34
|
+
/**
|
|
35
|
+
* Projects an alias onto exactly the fields intended for publication.
|
|
36
|
+
*
|
|
37
|
+
* `listAliases` is documented as returning metadata only, and today it does.
|
|
38
|
+
* This does not rely on that. It is a positive allowlist rather than a filter,
|
|
39
|
+
* so a field added upstream is omitted by default instead of published by
|
|
40
|
+
* default — and this is the single most attachable resource in the server, the
|
|
41
|
+
* one most likely to be pasted wholesale into a conversation.
|
|
42
|
+
*/
|
|
43
|
+
function publicAliasFields(alias) {
|
|
44
|
+
return {
|
|
45
|
+
alias: alias.alias,
|
|
46
|
+
isDefault: alias.isDefault,
|
|
47
|
+
type: alias.type,
|
|
48
|
+
instanceUrl: alias.instanceUrl,
|
|
49
|
+
...(alias.username === undefined ? {} : { username: alias.username }),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function json(uri, body) {
|
|
53
|
+
return {
|
|
54
|
+
contents: [
|
|
55
|
+
{
|
|
56
|
+
uri,
|
|
57
|
+
mimeType: "application/json",
|
|
58
|
+
text: JSON.stringify(body, null, 2),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `servicenow://instances` — which instances this server can serve.
|
|
65
|
+
*
|
|
66
|
+
* Deliberately reports WHICH STORE it read. When the sn-credstore shim is not
|
|
67
|
+
* active the SDK's OS keyring is authoritative, and that cannot be enumerated —
|
|
68
|
+
* so the alias list is reported as unavailable rather than as empty. An empty
|
|
69
|
+
* list would read as "no credentials configured", which is precisely the
|
|
70
|
+
* ambiguity sn-credstore exists to remove.
|
|
71
|
+
*
|
|
72
|
+
* Contains no secret material: `listAliases` returns metadata only.
|
|
73
|
+
*/
|
|
74
|
+
function registerInstancesResource(server) {
|
|
75
|
+
server.registerResource("instances", "servicenow://instances", {
|
|
76
|
+
title: "Configured ServiceNow instances",
|
|
77
|
+
description: "Aliases this server can connect to, the alias used when a tool omits one, " +
|
|
78
|
+
"and which credential store those aliases were read from. Contains no secrets.",
|
|
79
|
+
mimeType: "application/json",
|
|
80
|
+
}, async (uri) => {
|
|
81
|
+
const shimActive = isCredStoreActive();
|
|
82
|
+
const defaultAlias = process.env.SN_AUTH_ALIAS ?? null;
|
|
83
|
+
if (!shimActive) {
|
|
84
|
+
return json(uri.href, {
|
|
85
|
+
defaultAlias,
|
|
86
|
+
credentialStore: "os-keyring",
|
|
87
|
+
aliases: null,
|
|
88
|
+
note: "The sn-credstore shim is not active, so credentials come from the OS " +
|
|
89
|
+
"keyring, which cannot be enumerated. This is not the same as having no " +
|
|
90
|
+
"credentials. Set SN_CRED_STORE_ENABLE=1 to read from sn-credstore instead.",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const summary = await listAliases();
|
|
95
|
+
return json(uri.href, {
|
|
96
|
+
defaultAlias,
|
|
97
|
+
credentialStore: "sn-credstore",
|
|
98
|
+
aliases: summary.aliases.map(publicAliasFields),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
// A store that cannot be read is a finding to report, not an
|
|
103
|
+
// empty list to hand back.
|
|
104
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
105
|
+
return json(uri.href, {
|
|
106
|
+
defaultAlias,
|
|
107
|
+
credentialStore: "sn-credstore",
|
|
108
|
+
aliases: null,
|
|
109
|
+
error: message,
|
|
110
|
+
remediation: error?.remediation,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Registers one alias-scoped resource template.
|
|
117
|
+
*
|
|
118
|
+
* `list` is explicitly `undefined` rather than omitted: the SDK requires the key
|
|
119
|
+
* so that forgetting to enumerate is a decision rather than an oversight. These
|
|
120
|
+
* cannot be enumerated anyway — listing every table on an instance would be a
|
|
121
|
+
* very expensive `resources/list`.
|
|
122
|
+
*/
|
|
123
|
+
function registerAliasScopedResource(server, name, uriTemplate, title, description, read) {
|
|
124
|
+
server.registerResource(name, new ResourceTemplate(uriTemplate, { list: undefined }), { title, description, mimeType: "application/json" }, async (uri, vars) => {
|
|
125
|
+
// UriTemplate yields string | string[] per variable; these templates
|
|
126
|
+
// only ever declare single-valued segments.
|
|
127
|
+
const flat = {};
|
|
128
|
+
for (const [k, v] of Object.entries(vars)) {
|
|
129
|
+
flat[k] = Array.isArray(v) ? v[0] : v;
|
|
130
|
+
}
|
|
131
|
+
const alias = flat.alias;
|
|
132
|
+
// The URI owning the alias is the headline guarantee of this module,
|
|
133
|
+
// and without this it would rest on an SDK implementation detail:
|
|
134
|
+
// resolveAlias() in connection.ts falls back on a FALSY alias
|
|
135
|
+
// (`authAlias || process.env.SN_AUTH_ALIAS`), so an empty capture
|
|
136
|
+
// would silently resolve against the ambient default — the exact
|
|
137
|
+
// cross-instance confusion this design prevents.
|
|
138
|
+
//
|
|
139
|
+
// Verified that the current SDK matcher returns null rather than an
|
|
140
|
+
// empty capture for `servicenow:///scope/current`, so this is not
|
|
141
|
+
// reachable today. It is here so the guarantee is local rather than
|
|
142
|
+
// dependent on that staying true.
|
|
143
|
+
if (!alias) {
|
|
144
|
+
throw new Error(`Resource URI ${uri.href} has no instance alias. ` +
|
|
145
|
+
`Use servicenow://<alias>/... — the alias is never inferred from the environment.`);
|
|
146
|
+
}
|
|
147
|
+
return json(uri.href, await read(alias, flat));
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
export function registerServiceNowResources(server) {
|
|
151
|
+
registerInstancesResource(server);
|
|
152
|
+
registerAliasScopedResource(server, "current-scope", "servicenow://{alias}/scope/current", "Current application scope", "The application scope currently selected on the instance, as get_current_scope reports it.", async (alias) => withConnectionRetry(alias, async (snInstance) => new ScopeManager(snInstance).getCurrentApplication()));
|
|
153
|
+
registerAliasScopedResource(server, "current-update-set", "servicenow://{alias}/update-set/current", "Current update set", "The update set currently capturing changes, as get_current_update_set reports it.", async (alias) => withConnectionRetry(alias, async (snInstance) => new UpdateSetManager(snInstance).getCurrentUpdateSet()));
|
|
154
|
+
registerAliasScopedResource(server, "table-schema", "servicenow://{alias}/schema/{table}", "Table schema", "Fields, types and references for a table. Mirrors discover_table_schema with its " +
|
|
155
|
+
"optional sections off, so this stays cheap enough to attach as context.", async (alias, vars) => withConnectionRetry(alias, async (snInstance) => new SchemaDiscovery(snInstance).discoverTableSchema(vars.table, {
|
|
156
|
+
// The expensive sections are opt-in on the tool for good reason;
|
|
157
|
+
// a resource is attached rather than deliberately invoked, so it
|
|
158
|
+
// should not silently pull choices and business rules too.
|
|
159
|
+
includeChoiceTables: false,
|
|
160
|
+
includeRelationships: false,
|
|
161
|
+
includeUIPolicies: false,
|
|
162
|
+
includeBusinessRules: false,
|
|
163
|
+
})));
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=servicenow.js.map
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AAY,CAAC,UAAU,CAAC,CAAC,qBAAqB,EAAE,CACvD,CACR,CAAC;IAEF,2BAA2B,CACvB,MAAM,EACN,oBAAoB,EACpB,yCAAyC,EACzC,oBAAoB,EACpB,mFAAmF,EACnF,KAAK,EAAE,KAAK,EAAE,EAAE,CACZ,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAC5C,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC,mBAAmB,EAAE,CACzD,CACR,CAAC;IAEF,2BAA2B,CACvB,MAAM,EACN,cAAc,EACd,qCAAqC,EACrC,cAAc,EACd,mFAAmF;QAC/E,yEAAyE,EAC7E,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAClB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAC5C,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,EAAE;QAC5D,iEAAiE;QACjE,iEAAiE;QACjE,2DAA2D;QAC3D,mBAAmB,EAAE,KAAK;QAC1B,oBAAoB,EAAE,KAAK;QAC3B,iBAAiB,EAAE,KAAK;QACxB,oBAAoB,EAAE,KAAK;KAC9B,CAAC,CACL,CACR,CAAC;AACN,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,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,8BAA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AE,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"}
|