@velaro/mcp-server 2.0.23 → 2.0.24

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": "@velaro/mcp-server",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "Velaro MCP server — connect Claude and other AI agents directly to your Velaro account: KB, workflows, bots, conversations, contacts, routing, and more.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
- // velaro part-finder: the per-site Part Finder (one ordered lookup). Site scope comes from the credential only, never from arguments.
2
- // Parity module (CLI group `part-finder` -> MCP tools). Needs the Part Finder package (EnablePartFinder).
1
+ // velaro part-finder (alias smart-match): Smart Match, the per-site ordered lookup (internal name Part Finder, tool names are live contracts). Site scope comes from the credential only, never from arguments.
2
+ // Parity module (CLI group `part-finder` -> MCP tools). Needs the Smart Match package (EnablePartFinder).
3
3
 
4
4
  const need = (a, ...ks) => { for (const k of ks) if (a[k] === undefined || a[k] === null || a[k] === '') throw new Error(k + ' is required'); };
5
5
  /** Body for POST /PartFinder/Sources. Pure so it is unit tested: shareUrl required and https, upload refused, no fileName sent. */
@@ -18,17 +18,25 @@ function buildSourceBody(a) {
18
18
  if (typeof a.autoApproveRows === 'boolean') body.autoApproveRows = a.autoApproveRows;
19
19
  return body;
20
20
  }
21
+ /** itemNoun rule shared with messaging: trimmed, letters digits space hyphen, max 40; empty means the default (item). */
22
+ function validItemNoun(v) {
23
+ const t = String(v ?? '').trim();
24
+ if (t === '') return 'item';
25
+ if (t.length > 40) throw new Error('itemNoun must be 40 characters or fewer');
26
+ if (!/^[\p{L}\p{N} -]+$/u.test(t)) throw new Error('itemNoun can use letters, digits, spaces and hyphens only');
27
+ return t;
28
+ }
21
29
  const pid = (v, n = 'id') => { const x = Number(v); if (!Number.isInteger(x) || x <= 0) throw new Error(n + ' must be a positive integer'); return x; };
22
30
 
23
31
  export const tools = [
24
32
  {
25
33
  name: 'part_finder_find',
26
- description: 'Run the Part Finder lookup the bot uses for a part number, competitor model or description: approved matrix, connected business system, own catalog, then labelled possible matches. Returns status (confirmed, candidates, no_result), source, recommendations, candidates, handoff and the per-step trace. Calls POST /PartFinder/Find.',
34
+ description: 'Run the Smart Match lookup the bot uses for anything a customer names (a part number, product, service, plan, competitor name or description): approved matrix, connected business system, own catalog, then labelled possible matches. Returns status (confirmed, candidates, no_result), source, recommendations, candidates, handoff and the per-step trace. Calls POST /PartFinder/Find.',
27
35
  inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The part number, model or description as the customer wrote it' } }, required: ['query'] },
28
36
  },
29
37
  {
30
38
  name: 'part_finder_config',
31
- description: 'Read the Part Finder settings, or change them when any field is given: enabled, steps (ordered list of {id: matrix|erp|catalog_exact|spec_search, enabled, timeoutMs}), minConfidence (0 to 1), noResultAction (handoff|categories|handoff_and_categories|capture_lead). Matrix and catalog_exact cannot both be off. Calls GET or PUT /PartFinder/Config.',
39
+ description: 'Read the Smart Match settings, or change them when any field is given: enabled, steps (ordered list of {id: matrix|erp|catalog_exact|spec_search, enabled, timeoutMs}), minConfidence (0 to 1), noResultAction (handoff|categories|handoff_and_categories|capture_lead), itemNoun (what the business calls the things customers look for, default item; letters, digits, spaces and hyphens, max 40). Matrix and catalog_exact cannot both be off. Calls GET or PUT /PartFinder/Config.',
32
40
  inputSchema: {
33
41
  type: 'object',
34
42
  properties: {
@@ -36,12 +44,13 @@ export const tools = [
36
44
  steps: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, enabled: { type: 'boolean' }, timeoutMs: { type: 'number' } }, required: ['id'] } },
37
45
  minConfidence: { type: 'number' },
38
46
  noResultAction: { type: 'string' },
47
+ itemNoun: { type: 'string', description: 'What the business calls the things customers look for: part, product, service, plan, policy, course. Default item. Letters, digits, spaces and hyphens, max 40.' },
39
48
  },
40
49
  },
41
50
  },
42
51
  {
43
52
  name: 'part_finder_sources',
44
- description: 'List the matrix sources (SharePoint, OneDrive) with load mode and last sync status. Calls GET /PartFinder/Sources.',
53
+ description: 'List the Smart Match matrix sources (SharePoint, OneDrive) with load mode and last sync status. Calls GET /PartFinder/Sources.',
45
54
  inputSchema: { type: 'object', properties: {} },
46
55
  },
47
56
  {
@@ -112,6 +121,7 @@ export const handlers = {
112
121
  patch.minConfidence = v;
113
122
  }
114
123
  if (a.noResultAction !== undefined) patch.noResultAction = String(a.noResultAction);
124
+ if (a.itemNoun !== undefined) patch.itemNoun = validItemNoun(a.itemNoun);
115
125
  if (Object.keys(patch).length === 0) return ctx.messagingGet('/PartFinder/Config');
116
126
  return ctx.messagingPut('/PartFinder/Config', patch);
117
127
  },