@abgov/adsp-sdk-mcp-server 1.31.0 → 1.32.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/adsp-sdk-mcp-server",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - MCP server for ADSP documentation and Node SDK reference lookup.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
package/provenance.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "kind": "release",
3
- "builtAt": "2026-11-16T20:18:04.243Z",
4
- "sourceCommit": "07509c700ab7b8f13e7a6c68e2a782c5827ff79a",
5
- "latestRelease": "1.30.0",
3
+ "builtAt": "2026-11-16T20:45:14.221Z",
4
+ "sourceCommit": "28fe0a13bc27cd1fa75ba8de0ef435cba5f16715",
5
+ "latestRelease": "1.31.0",
6
6
  "docsCommit": "f5ec796791f7d2f031ce8973881d8511d04ea92b",
7
7
  "sdk": {
8
8
  "version": "2.36.1",
@@ -0,0 +1,44 @@
1
+ /** One ADSP service in the capability catalog (`capabilities.json`, generated by `scripts/capabilities.mjs`). */
2
+ export interface CatalogService {
3
+ id: string;
4
+ name: string;
5
+ /** The service index's "Use it to" line. */
6
+ use: string;
7
+ /** The service guide, as a path for `read_adsp_doc`. */
8
+ doc: string;
9
+ /** Whether project-planner-service has a specialist for the service. Without one, there is no purpose or fit questions. */
10
+ specialist: boolean;
11
+ purpose: string | null;
12
+ fitQuestions: string[];
13
+ dependsOn: string[];
14
+ risks: string[];
15
+ /** `ServiceRegistration` fields that the SDK writes to this service's configuration. */
16
+ registrationFields: string[];
17
+ /** The planner patterns that map this service, with each pattern's reason for it. */
18
+ patterns: {
19
+ pattern: string;
20
+ reason: string;
21
+ }[];
22
+ }
23
+ /** A need no ADSP service covers, as a planner pattern records it. */
24
+ export interface KnownGap {
25
+ requirement: string;
26
+ reason: string;
27
+ suggestedApproach: string;
28
+ keywords: string[];
29
+ }
30
+ export interface CatalogPattern {
31
+ id: string;
32
+ name: string;
33
+ domainLanguage: string[];
34
+ signals: string[];
35
+ commonFeatures: string[];
36
+ services: string[];
37
+ unsupported: KnownGap[];
38
+ }
39
+ export interface CapabilityCatalog {
40
+ sources: string[];
41
+ services: CatalogService[];
42
+ patterns: CatalogPattern[];
43
+ }
44
+ export declare function loadCapabilityCatalog(path: string): CapabilityCatalog;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadCapabilityCatalog = loadCapabilityCatalog;
4
+ const fs_1 = require("fs");
5
+ function loadCapabilityCatalog(path) {
6
+ return JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
7
+ }
8
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/capabilities/catalog.ts"],"names":[],"mappings":";;AA8CA,sDAEC;AAhDD,2BAAkC;AA8ClC,SAAgB,qBAAqB,CAAC,IAAY;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { CapabilityCatalog, CatalogService, KnownGap } from './catalog';
2
+ export type Fit = 'strong' | 'partial' | 'weak';
3
+ export interface ServiceMatch {
4
+ service: CatalogService;
5
+ fit: Fit;
6
+ score: number;
7
+ /** The catalog sentence that best explains the match. */
8
+ reason: string;
9
+ }
10
+ export interface NeedResult {
11
+ need: string;
12
+ matches: ServiceMatch[];
13
+ /** True when no service is a strong fit, or more than one is: the agent should ask the user instead of choosing. */
14
+ ask: boolean;
15
+ /** What to ask the user when `ask` is true. */
16
+ fitQuestions: string[];
17
+ /** Set when no service fits the need. */
18
+ noMatch?: {
19
+ reason: string;
20
+ knownGap?: Omit<KnownGap, 'keywords'>;
21
+ };
22
+ }
23
+ /**
24
+ * A crude stem, so "attach", "attached" and "attaching" meet. A final "e" is dropped too, so "certificate",
25
+ * "certificates" and "updated" meet "certificat" and "updat". Short words are left alone.
26
+ */
27
+ export declare function stem(word: string): string;
28
+ export declare function terms(text: string): string[];
29
+ /** Ranks ADSP services for product needs over the capability catalog. Deterministic, and makes no calls. */
30
+ export declare class ServiceFinder {
31
+ private readonly services;
32
+ private readonly patterns;
33
+ private readonly knownGaps;
34
+ private readonly idf;
35
+ /** A term no service mentions still counts as rare, so it scores in patterns. */
36
+ private readonly maxIdf;
37
+ constructor(catalog: CapabilityCatalog);
38
+ private weight;
39
+ private patternBoost;
40
+ private explain;
41
+ private knownGap;
42
+ find(need: string): NeedResult;
43
+ }
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceFinder = void 0;
4
+ exports.stem = stem;
5
+ exports.terms = terms;
6
+ // prettier-ignore
7
+ const STOP_WORDS = new Set([
8
+ 'a', 'an', 'the', 'to', 'of', 'in', 'on', 'for', 'and', 'or', 'is', 'are', 'how', 'do', 'does', 'i', 'what',
9
+ 'with', 'from', 'this', 'that', 'it', 'be', 'by', 'as', 'at', 'their', 'they', 'them', 'when', 'who', 'which',
10
+ 'can', 'may', 'should', 'any', 'each', 'its', 'into', 'before', 'after', 'than', 'not', 'out', 'up', 'so', 'has',
11
+ 'have', 'will', 'was', 'were', 'such', 'our', 'your', 'we', 'us', 'need', 'needs', 'want', 'let', 'lets',
12
+ ]);
13
+ const SUFFIXES = ['ations', 'ation', 'ings', 'ing', 'ies', 'ers', 'er', 'ed', 'es', 's'];
14
+ /**
15
+ * A crude stem, so "attach", "attached" and "attaching" meet. A final "e" is dropped too, so "certificate",
16
+ * "certificates" and "updated" meet "certificat" and "updat". Short words are left alone.
17
+ */
18
+ function stem(word) {
19
+ const suffix = SUFFIXES.find((candidate) => word.length > candidate.length + 3 && word.endsWith(candidate));
20
+ const base = suffix ? word.slice(0, -suffix.length) + (suffix === 'ies' ? 'y' : '') : word;
21
+ return base.length > 4 && base.endsWith('e') ? base.slice(0, -1) : base;
22
+ }
23
+ function terms(text) {
24
+ return (text.toLowerCase().match(/[a-z0-9]+/g) ?? []).filter((word) => !STOP_WORDS.has(word)).map(stem);
25
+ }
26
+ // How much a query term found in each part of a service's entry counts. The index line and the specialist's purpose
27
+ // say what the service is for; pattern reasons say what it is used for in a kind of product; questions and risks are
28
+ // weaker evidence. The pattern boost credits services a matching pattern maps, for needs worded in the pattern's
29
+ // domain language rather than the service's.
30
+ const FIELD_WEIGHTS = { use: 3, purpose: 3, reasons: 1.5, fitQuestions: 1, risks: 0.5 };
31
+ const PATTERN_BOOST = 0.5;
32
+ // Fit is relative to the best match for the same need, so it does not depend on how long the need is. A strong fit
33
+ // must also account for enough of the need's own words: matching on one shared word, such as "model" or "time", is
34
+ // not enough evidence to choose without asking. A best match below MIN_SCORE is no match at all.
35
+ const STRONG_RATIO = 0.75;
36
+ const PARTIAL_RATIO = 0.4;
37
+ const STRONG_COVERAGE = 0.3;
38
+ const MIN_SCORE = 4;
39
+ const MAX_MATCHES = 5;
40
+ function counts(tokens) {
41
+ const map = new Map();
42
+ for (const token of tokens)
43
+ map.set(token, (map.get(token) ?? 0) + 1);
44
+ return map;
45
+ }
46
+ /** Ranks ADSP services for product needs over the capability catalog. Deterministic, and makes no calls. */
47
+ class ServiceFinder {
48
+ services;
49
+ patterns;
50
+ knownGaps;
51
+ idf = new Map();
52
+ /** A term no service mentions still counts as rare, so it scores in patterns. */
53
+ maxIdf;
54
+ constructor(catalog) {
55
+ this.services = catalog.services.map((service) => {
56
+ const fields = {
57
+ use: counts(terms(service.use)),
58
+ purpose: counts(terms(service.purpose ?? '')),
59
+ reasons: counts(terms(service.patterns.map(({ reason }) => reason).join(' '))),
60
+ fitQuestions: counts(terms(service.fitQuestions.join(' '))),
61
+ risks: counts(terms(service.risks.join(' '))),
62
+ };
63
+ return {
64
+ service,
65
+ fields,
66
+ vocabulary: new Set(Object.values(fields).flatMap((field) => [...field.keys()])),
67
+ explanations: [service.use, ...(service.purpose ? [service.purpose] : []), ...service.patterns.map(({ reason }) => reason)],
68
+ };
69
+ });
70
+ const documentFrequency = new Map();
71
+ for (const { vocabulary } of this.services) {
72
+ for (const term of vocabulary)
73
+ documentFrequency.set(term, (documentFrequency.get(term) ?? 0) + 1);
74
+ }
75
+ const total = this.services.length;
76
+ for (const [term, frequency] of documentFrequency)
77
+ this.idf.set(term, Math.log(1 + total / frequency));
78
+ this.maxIdf = Math.log(1 + total);
79
+ this.patterns = catalog.patterns.map((pattern) => ({
80
+ vocabulary: new Set(terms([pattern.name, ...pattern.domainLanguage, ...pattern.signals, ...pattern.commonFeatures].join(' '))),
81
+ reasons: catalog.services.flatMap(({ id, patterns }) => patterns.filter((mapping) => mapping.pattern === pattern.id).map(({ reason }) => ({ service: id, terms: new Set(terms(reason)) }))),
82
+ }));
83
+ const gaps = new Map();
84
+ for (const gap of catalog.patterns.flatMap(({ unsupported }) => unsupported))
85
+ gaps.set(gap.requirement, gap);
86
+ this.knownGaps = [...gaps.values()];
87
+ }
88
+ weight(term) {
89
+ return this.idf.get(term) ?? this.maxIdf;
90
+ }
91
+ patternBoost(query) {
92
+ const boost = new Map();
93
+ for (const { vocabulary, reasons } of this.patterns) {
94
+ const patternScore = [...query].filter((term) => vocabulary.has(term)).reduce((sum, term) => sum + this.weight(term), 0);
95
+ if (patternScore === 0)
96
+ continue;
97
+ for (const { service, terms: reasonTerms } of reasons) {
98
+ const overlap = [...query].filter((term) => reasonTerms.has(term)).length;
99
+ if (overlap > 0)
100
+ boost.set(service, (boost.get(service) ?? 0) + patternScore * overlap);
101
+ }
102
+ }
103
+ return boost;
104
+ }
105
+ explain({ explanations }, query) {
106
+ let best = explanations[0];
107
+ let bestOverlap = 0;
108
+ for (const sentence of explanations) {
109
+ const overlap = new Set(terms(sentence).filter((term) => query.has(term))).size;
110
+ if (overlap > bestOverlap) {
111
+ best = sentence;
112
+ bestOverlap = overlap;
113
+ }
114
+ }
115
+ return best;
116
+ }
117
+ knownGap(need) {
118
+ const text = need.toLowerCase();
119
+ return this.knownGaps.find(({ keywords }) => keywords.some((keyword) => text.includes(keyword.toLowerCase())));
120
+ }
121
+ find(need) {
122
+ const query = new Set(terms(need));
123
+ const boost = this.patternBoost(query);
124
+ const scored = this.services
125
+ .map((indexed) => {
126
+ let score = PATTERN_BOOST * (boost.get(indexed.service.id) ?? 0);
127
+ for (const field of Object.keys(FIELD_WEIGHTS)) {
128
+ for (const term of query) {
129
+ const count = indexed.fields[field].get(term);
130
+ if (count)
131
+ score += FIELD_WEIGHTS[field] * this.weight(term) * (1 + Math.log(count));
132
+ }
133
+ }
134
+ return { indexed, score };
135
+ })
136
+ .filter(({ score }) => score > 0)
137
+ .sort((a, b) => b.score - a.score || a.indexed.service.id.localeCompare(b.indexed.service.id));
138
+ const best = scored[0]?.score ?? 0;
139
+ const gap = this.knownGap(need);
140
+ if (best < MIN_SCORE) {
141
+ return {
142
+ need,
143
+ matches: [],
144
+ ask: false,
145
+ fitQuestions: [],
146
+ noMatch: {
147
+ reason: gap?.reason ?? 'No ADSP service in the catalog covers this need.',
148
+ ...(gap && { knownGap: { requirement: gap.requirement, reason: gap.reason, suggestedApproach: gap.suggestedApproach } }),
149
+ },
150
+ };
151
+ }
152
+ const matches = scored.slice(0, MAX_MATCHES).map(({ indexed, score }) => {
153
+ const coverage = [...query].filter((term) => indexed.vocabulary.has(term)).length / query.size;
154
+ const fit = score >= STRONG_RATIO * best && coverage >= STRONG_COVERAGE ? 'strong' : score >= PARTIAL_RATIO * best ? 'partial' : 'weak';
155
+ return { service: indexed.service, score: Math.round(score * 10) / 10, fit, reason: this.explain(indexed, query) };
156
+ });
157
+ const strong = matches.filter(({ fit }) => fit === 'strong');
158
+ const ask = strong.length !== 1;
159
+ return {
160
+ need,
161
+ matches,
162
+ ask,
163
+ fitQuestions: ask ? fitQuestions(matches.filter(({ fit }) => fit !== 'weak')) : [],
164
+ ...(gap && {
165
+ noMatch: {
166
+ reason: `Part of this need is a known gap: ${gap.reason}`,
167
+ knownGap: { requirement: gap.requirement, reason: gap.reason, suggestedApproach: gap.suggestedApproach },
168
+ },
169
+ }),
170
+ };
171
+ }
172
+ }
173
+ exports.ServiceFinder = ServiceFinder;
174
+ /** The questions that tell the candidates apart: each candidate's own fit questions, or what it is used for. */
175
+ function fitQuestions(candidates) {
176
+ const questions = candidates.flatMap(({ service }) => service.fitQuestions.length > 0 ? service.fitQuestions : [`Is this a need to ${lowerFirst(service.use.replace(/\.$/, ''))} (${service.id})?`]);
177
+ return [...new Set(questions)];
178
+ }
179
+ function lowerFirst(text) {
180
+ return text.charAt(0).toLowerCase() + text.slice(1);
181
+ }
182
+ //# sourceMappingURL=findServices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findServices.js","sourceRoot":"","sources":["../../../../../libs/adsp-sdk-mcp-server/src/capabilities/findServices.ts"],"names":[],"mappings":";;;AAqCA,oBAIC;AAED,sBAEC;AAtBD,kBAAkB;AAClB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAC3G,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAC7G,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,O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Digital Service Platform). Pick the tool by the question:',
11
- '- What ADSP offers, which service fits a need, platform concepts or how-tos: search_adsp_docs, then read_adsp_doc.',
12
- ' Search matches words, not meaning. If a need described in product terms finds nothing useful, search again with',
13
- ' the capability\'s name (e.g. "file", "calendar", "notification") or browse services/ with list_adsp_docs.',
11
+ '- Before designing or building any capability of an ADSP app, call find_adsp_services with the need. If a result',
12
+ ' has ask set, put its fitQuestions to the user rather than picking a service yourself. noMatch: no service fits.',
13
+ '- Platform concepts or how-tos: search_adsp_docs, then read_adsp_doc. Browse services/ with list_adsp_docs.',
14
14
  '- Writing a Node service: get_platform_quickstart first, then search_sdk_reference for a specific symbol.',
15
15
  "- Calling a service's REST API: search_service_endpoints, then read_service_endpoint.",
16
16
  '- Roles a service account needs, or the configuration a platform service accepts from yours: list_service_roles,',
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/instructions.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;IACjC,uHAAuH;IACvH,oHAAoH;IACpH,mHAAmH;IACnH,6GAA6G;IAC7G,2GAA2G;IAC3G,uFAAuF;IACvF,kHAAkH;IAClH,+FAA+F;IAC/F,2GAA2G;IAC3G,8GAA8G;IAC9G,gDAAgD;CACjD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/instructions.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;IACjC,uHAAuH;IACvH,kHAAkH;IAClH,mHAAmH;IACnH,6GAA6G;IAC7G,2GAA2G;IAC3G,uFAAuF;IACvF,kHAAkH;IAClH,+FAA+F;IAC/F,2GAA2G;IAC3G,8GAA8G;IAC9G,gDAAgD;CACjD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
package/src/server.d.ts CHANGED
@@ -5,6 +5,8 @@ export interface CreateAdspMcpServerOptions {
5
5
  docsRoot?: string;
6
6
  /** Root directory of bundled OpenAPI specs. Defaults to the assets copied alongside the built package. */
7
7
  apiSpecsRoot?: string;
8
+ /** The capability catalog find_adsp_services ranks. Defaults to the one bundled with the package. */
9
+ capabilitiesPath?: string;
8
10
  }
9
11
  export interface AdspMcpTools {
10
12
  tools: (ToolDefinition | LiveToolDefinition)[];
package/src/server.js CHANGED
@@ -7,6 +7,7 @@ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
7
7
  const path_1 = require("path");
8
8
  const perf_hooks_1 = require("perf_hooks");
9
9
  const apiSpecsRepository_1 = require("./api-specs/apiSpecsRepository");
10
+ const catalog_1 = require("./capabilities/catalog");
10
11
  const docsRepository_1 = require("./docs/docsRepository");
11
12
  const instructions_1 = require("./instructions");
12
13
  const metrics_1 = require("./metrics");
@@ -14,6 +15,7 @@ const registerApiTools_1 = require("./tools/registerApiTools");
14
15
  const registerConfigurationSchemaTool_1 = require("./tools/registerConfigurationSchemaTool");
15
16
  const liveToolLimit_1 = require("./tools/liveToolLimit");
16
17
  const registerDocsTools_1 = require("./tools/registerDocsTools");
18
+ const registerFindServicesTool_1 = require("./tools/registerFindServicesTool");
17
19
  const registerQuickstartTool_1 = require("./tools/registerQuickstartTool");
18
20
  const registerServiceRolesTool_1 = require("./tools/registerServiceRolesTool");
19
21
  const registerSdkTools_1 = require("./tools/registerSdkTools");
@@ -22,6 +24,8 @@ const version_1 = require("./version");
22
24
  // Compiled output places this file under dist/.../src/, while the docs asset copy lands one level up at dist/.../assets/docs.
23
25
  const DEFAULT_DOCS_ROOT = (0, path_1.join)(__dirname, '..', 'assets', 'docs');
24
26
  const DEFAULT_API_SPECS_ROOT = (0, path_1.join)(__dirname, '..', 'assets', 'api-specs');
27
+ // Generated into the library's own assets/ folder, so this resolves from source as well as from the build.
28
+ const DEFAULT_CAPABILITIES_PATH = (0, path_1.join)(__dirname, '..', 'assets', 'capabilities.json');
25
29
  const toolsByRoots = new Map();
26
30
  function lazy(create) {
27
31
  let value;
@@ -30,7 +34,8 @@ function lazy(create) {
30
34
  function loadAdspMcpTools(options = {}) {
31
35
  const docsRoot = (0, path_1.resolve)(options.docsRoot ?? DEFAULT_DOCS_ROOT);
32
36
  const apiSpecsRoot = (0, path_1.resolve)(options.apiSpecsRoot ?? DEFAULT_API_SPECS_ROOT);
33
- const cacheKey = `${docsRoot}\0${apiSpecsRoot}`;
37
+ const capabilitiesPath = (0, path_1.resolve)(options.capabilitiesPath ?? DEFAULT_CAPABILITIES_PATH);
38
+ const cacheKey = `${docsRoot}\0${apiSpecsRoot}\0${capabilitiesPath}`;
34
39
  const cached = toolsByRoots.get(cacheKey);
35
40
  if (cached) {
36
41
  return cached;
@@ -38,6 +43,7 @@ function loadAdspMcpTools(options = {}) {
38
43
  const started = perf_hooks_1.performance.now();
39
44
  const docs = new docsRepository_1.DocsRepository(docsRoot);
40
45
  const tools = [
46
+ ...(0, registerFindServicesTool_1.createFindServicesTool)(lazy(() => (0, catalog_1.loadCapabilityCatalog)(capabilitiesPath))),
41
47
  ...(0, registerDocsTools_1.createDocsTools)(docs),
42
48
  ...(0, registerSdkTools_1.createSdkTools)(),
43
49
  ...(0, registerQuickstartTool_1.createQuickstartTool)(),
@@ -63,11 +69,12 @@ function createAdspMcpServer(options = {}) {
63
69
  // args with zod as a plain value (see tools/*.ts), never passing a schema through the SDK's type machinery.
64
70
  const server = new index_js_1.Server({ name: 'adsp-sdk-mcp-server', version: (0, version_1.readPackageVersion)() }, { capabilities: { tools: {} }, instructions: instructions_1.SERVER_INSTRUCTIONS });
65
71
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
66
- tools: tools.map(({ name, description, inputSchema, annotations }) => ({
67
- name,
68
- description,
69
- inputSchema,
70
- annotations,
72
+ tools: tools.map((tool) => ({
73
+ name: tool.name,
74
+ description: tool.description,
75
+ inputSchema: tool.inputSchema,
76
+ ...('outputSchema' in tool && tool.outputSchema && { outputSchema: tool.outputSchema }),
77
+ annotations: tool.annotations,
71
78
  })),
72
79
  }));
73
80
  server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => {
package/src/server.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../libs/adsp-sdk-mcp-server/src/server.ts"],"names":[],"mappings":";;AA0CA,4CAwBC;AAED,kDA8CC;AAlHD,wEAAmE;AACnE,iEAAmH;AACnH,+BAAqC;AACrC,2CAAyC;AACzC,uEAAoE;AACpE,0DAAuD;AACvD,iDAAqD;AACrD,uCAAsD;AACtD,+DAA0D;AAC1D,6FAAyF;AACzF,yDAAqD;AACrD,iEAA4D;AAC5D,2EAAsE;AACtE,+EAA2E;AAC3E,+DAA0D;AAC1D,2EAAsE;AAEtE,uCAA+C;AAc/C,8HAA8H;AAC9H,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClE,MAAM,sBAAsB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAE5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;AAErD,SAAS,IAAI,CAAI,MAAe;IAC9B,IAAI,KAAoB,CAAC;IACzB,OAAO,GAAG,EAAE,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,gBAAgB,CAAC,UAAsC,EAAE;IACvE,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,QAAQ,IAAI,iBAAiB,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,YAAY,IAAI,sBAAsB,CAAC,CAAC;IAC7E,MAAM,QAAQ,GAAG,GAAG,QAAQ,KAAK,YAAY,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,YAAY,CAAC,GA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EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YACrF,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,oBAAU,GAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;YAC3E,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,aAAa,CAAC,MAAsB;IAC3C,IAAI,IAAA,4BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,CAAC,wBAAW,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,126 @@
1
+ import { CapabilityCatalog } from '../capabilities/catalog';
2
+ import { ToolDefinition } from './types';
3
+ export declare const FIND_SERVICES_OUTPUT_SCHEMA: {
4
+ readonly type: "object";
5
+ readonly properties: {
6
+ readonly results: {
7
+ readonly type: "array";
8
+ readonly items: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly need: {
12
+ readonly type: "string";
13
+ };
14
+ readonly ask: {
15
+ readonly type: "boolean";
16
+ readonly description: "True when no service is a strong fit or more than one is. Ask the user instead of choosing.";
17
+ };
18
+ readonly fitQuestions: {
19
+ readonly type: "array";
20
+ readonly items: {
21
+ readonly type: "string";
22
+ };
23
+ readonly description: "What to ask when ask is true.";
24
+ };
25
+ readonly matches: {
26
+ readonly type: "array";
27
+ readonly items: {
28
+ readonly type: "object";
29
+ readonly properties: {
30
+ readonly service: {
31
+ readonly type: "string";
32
+ readonly description: "Service id, e.g. \"file-service\".";
33
+ };
34
+ readonly fit: {
35
+ readonly type: "string";
36
+ readonly enum: readonly ["strong", "partial", "weak"];
37
+ };
38
+ readonly reason: {
39
+ readonly type: "string";
40
+ readonly description: "The catalog sentence that best explains the match.";
41
+ };
42
+ readonly name: {
43
+ readonly type: "string";
44
+ };
45
+ readonly dependsOn: {
46
+ readonly type: "array";
47
+ readonly items: {
48
+ readonly type: "string";
49
+ };
50
+ readonly description: "Services to set up first.";
51
+ };
52
+ readonly registration: {
53
+ readonly type: "object";
54
+ readonly description: string;
55
+ readonly properties: {
56
+ readonly fields: {
57
+ readonly type: "array";
58
+ readonly items: {
59
+ readonly type: "string";
60
+ };
61
+ };
62
+ readonly serviceConfigurations: {
63
+ readonly type: "string";
64
+ };
65
+ };
66
+ readonly required: readonly ["fields", "serviceConfigurations"];
67
+ };
68
+ readonly doc: {
69
+ readonly type: "string";
70
+ readonly description: "Service guide path, for read_adsp_doc.";
71
+ };
72
+ readonly fitQuestions: {
73
+ readonly type: "array";
74
+ readonly items: {
75
+ readonly type: "string";
76
+ };
77
+ };
78
+ readonly risks: {
79
+ readonly type: "array";
80
+ readonly items: {
81
+ readonly type: "string";
82
+ };
83
+ };
84
+ readonly specialist: {
85
+ readonly type: "boolean";
86
+ readonly description: "False when project-planner-service has no specialist for the service, so it has no fit questions.";
87
+ };
88
+ };
89
+ readonly required: readonly ["service", "fit", "reason"];
90
+ };
91
+ };
92
+ readonly noMatch: {
93
+ readonly type: "object";
94
+ readonly properties: {
95
+ readonly need: {
96
+ readonly type: "string";
97
+ };
98
+ readonly reason: {
99
+ readonly type: "string";
100
+ };
101
+ readonly knownGap: {
102
+ readonly type: "object";
103
+ readonly properties: {
104
+ readonly requirement: {
105
+ readonly type: "string";
106
+ };
107
+ readonly reason: {
108
+ readonly type: "string";
109
+ };
110
+ readonly suggestedApproach: {
111
+ readonly type: "string";
112
+ };
113
+ };
114
+ readonly required: readonly ["requirement", "reason", "suggestedApproach"];
115
+ };
116
+ };
117
+ readonly required: readonly ["need", "reason"];
118
+ };
119
+ };
120
+ readonly required: readonly ["need", "ask", "fitQuestions", "matches"];
121
+ };
122
+ };
123
+ };
124
+ readonly required: readonly ["results"];
125
+ };
126
+ export declare function createFindServicesTool(catalog: () => CapabilityCatalog): ToolDefinition[];