@velaro/mcp-server 2.0.50 → 2.0.52

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/package.json +1 -1
  3. package/server.js +56 -7
package/README.md CHANGED
@@ -119,6 +119,7 @@ This works with any MCP client that supports HTTP/SSE transport — including Cl
119
119
  | `bot_get` | Get full bot config including system prompt |
120
120
  | `bot_update_prompt` | Update a bot's system prompt |
121
121
  | `ai_config_set_reply_format` | Set reply format: global (plain text), plain, or markdown |
122
+ | `ai_config_set_message_speed` | Set bot Message Speed: instant, fixed (0-5s) or human; typed chat channels only |
122
123
  | `ai_config_channel_overrides_get` | List per-channel overrides incl. selection presentation settings ("All" row = bot default) |
123
124
  | `ai_config_selection_presentation_set` | Set how choice lists are shown for a channel or the "All" default: carousel/list/text, cap 1-25, repeat, Tell me more, follow-up chips (null = inherit) |
124
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.50",
3
+ "version": "2.0.52",
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": {
package/server.js CHANGED
@@ -245,6 +245,24 @@ async function skillRoutingCrud(resource, args, fields) {
245
245
  }
246
246
  }
247
247
 
248
+ // Magento search routes need ?configId= (the connected store) and ?query=; the old ?q= form always
249
+ // answered 404 "Config not found". Same rule as cli/lib/commands/magento-search.js.
250
+ async function magentoSearchPath(kind, query, configId) {
251
+ const configs = await api('GET', '/Magento/Configs');
252
+ const list = Array.isArray(configs) ? configs : [];
253
+ let id = configId === undefined || configId === null || configId === '' ? configId : Number(configId);
254
+ if (id === undefined || id === null) {
255
+ const active = list.filter(c => c.enabled !== false && c.isActive !== false);
256
+ if (active.length === 0) throw new Error('No active Magento store connected.');
257
+ if (active.length > 1) throw new Error('More than one Magento store is connected. Pass configId. Stores: ' + active.map(c => `${c.id} (${c.displayName ?? c.storeUrl})`).join(', '));
258
+ id = active[0].id;
259
+ } else if (!list.some(c => c.id === id)) {
260
+ throw new Error(`No connected Magento store has id ${id}.`);
261
+ }
262
+ const route = { customers: 'Customers', orders: 'Orders', products: 'Products' }[kind];
263
+ return `/Magento/${route}/Search?configId=${encodeURIComponent(id)}&query=${encodeURIComponent(query)}`;
264
+ }
265
+
248
266
  async function api(method, path, body, base = API_BASE) {
249
267
  // Normalize: a path without a leading slash would glue onto the host ("...comScraperJobs/...") and fail as "fetch failed".
250
268
  if (!path.startsWith('/')) path = '/' + path;
@@ -1265,6 +1283,19 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
1265
1283
  required: ['aiConfigId', 'mode'],
1266
1284
  },
1267
1285
  },
1286
+ {
1287
+ name: 'ai_config_set_message_speed',
1288
+ description: 'Set a bot\'s Message Speed (Admin UI: Bots > General > Message Speed). mode: instant (no pause) | fixed (set delay, seconds 0-5) | human (random 0.5-2.5s). It is a MINIMUM time from the start of the bot\'s turn to its reply (a slow AI call adds no extra wait), applied once per turn on typed chat channels only (Web, Apple Messages, WhatsApp, SMS, RCS, Facebook, Instagram, TikTok, Twitter, Teams). Voice (IVR, click-to-call) and email/tickets are never paced. Separate from the workflow "Set Message Speed" node.',
1289
+ inputSchema: {
1290
+ type: 'object',
1291
+ properties: {
1292
+ aiConfigId: { type: 'number', description: 'AI configuration ID (from bot_list)' },
1293
+ mode: { type: 'string', enum: ['instant', 'fixed', 'human'], description: 'Message speed mode' },
1294
+ seconds: { type: 'number', description: 'Fixed-mode delay in seconds (0-5). Ignored for instant and human.' },
1295
+ },
1296
+ required: ['aiConfigId', 'mode'],
1297
+ },
1298
+ },
1268
1299
  {
1269
1300
  name: 'ai_config_channel_overrides_get',
1270
1301
  description: 'List a bot\'s per-channel overrides including the selection presentation settings (how product/choice lists are shown). Rows: conversationSource Web, AppleMessages, WhatsApp, TwilioSms, TwilioIvr, etc., plus "All" = the bot/site default row. Resolution: channel row, then the "All" row, then the platform default (carousel; caps 10 web / 3 Apple / 3 SMS; repeat always; tell-me-more on; chips on). Admin UI: Bots > AI Settings > Channel Overrides.',
@@ -3284,6 +3315,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3284
3315
  type: 'object',
3285
3316
  properties: {
3286
3317
  email: { type: 'string', description: 'Customer email to look up' },
3318
+ configId: { type: 'number', description: 'Connected store id (magento_list_stores). Optional when only one store is connected.' },
3287
3319
  },
3288
3320
  required: ['email'],
3289
3321
  },
@@ -3295,6 +3327,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3295
3327
  type: 'object',
3296
3328
  properties: {
3297
3329
  orderId: { type: 'string', description: 'Magento order increment ID, e.g. "000001234"' },
3330
+ configId: { type: 'number', description: 'Connected store id (magento_list_stores). Optional when only one store is connected.' },
3298
3331
  },
3299
3332
  required: ['orderId'],
3300
3333
  },
@@ -3307,6 +3340,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3307
3340
  properties: {
3308
3341
  email: { type: 'string', description: 'Customer email address' },
3309
3342
  limit: { type: 'number', description: 'Max results (default: 10, max: 50)' },
3343
+ configId: { type: 'number', description: 'Connected store id (magento_list_stores). Optional when only one store is connected.' },
3310
3344
  },
3311
3345
  required: ['email'],
3312
3346
  },
@@ -3317,6 +3351,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3317
3351
  inputSchema: {
3318
3352
  type: 'object',
3319
3353
  properties: {
3354
+ configId: { type: 'number', description: 'Connected store id (magento_list_stores). Optional when only one store is connected.' },
3320
3355
  query: { type: 'string', description: 'Product name search query' },
3321
3356
  limit: { type: 'number', description: 'Max results (default: 10, max: 50)' },
3322
3357
  },
@@ -3690,7 +3725,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3690
3725
  },
3691
3726
  {
3692
3727
  name: 'ivr_update_line',
3693
- description: 'Update an IVR phone line: set the default transfer (bridge) number and/or assign a different voice configuration. All changes are logged.',
3728
+ description: 'Update an IVR phone line: set the Fallback Transfer Number (IVR Settings; the bot cannot transfer a call without one) and/or assign a different voice configuration. All changes are logged.',
3694
3729
  inputSchema: {
3695
3730
  type: 'object',
3696
3731
  properties: {
@@ -5343,6 +5378,17 @@ async function handleTool(name, args) {
5343
5378
  return JSON.stringify(result, null, 2);
5344
5379
  }
5345
5380
 
5381
+ case 'ai_config_set_message_speed': {
5382
+ const all = (await messagingGet('/AIConfiguration/list')) ?? [];
5383
+ const bot = all.find(x => x.id === args.aiConfigId);
5384
+ if (!bot) return `AI configuration ${args.aiConfigId} not found.`;
5385
+ if (args.seconds !== undefined && (args.seconds < 0 || args.seconds > 5)) return 'seconds must be between 0 and 5.';
5386
+ const body = { ...bot, messageSpeedMode: args.mode };
5387
+ if (args.seconds !== undefined) body.messageSpeedSeconds = args.seconds;
5388
+ const r = await messagingPost('/AIConfiguration', body);
5389
+ return `Message speed set: [${args.aiConfigId}] ${r?.name ?? bot.name} mode=${r?.messageSpeedMode ?? args.mode} seconds=${r?.messageSpeedSeconds ?? '-'}`;
5390
+ }
5391
+
5346
5392
  case 'chat_intelligence_themes': {
5347
5393
  const qs = new URLSearchParams();
5348
5394
  if (args.startDate) qs.set('startDate', args.startDate);
@@ -7771,13 +7817,14 @@ reply: ${r?.reply}`;
7771
7817
  }
7772
7818
 
7773
7819
  case 'magento_search_customers': {
7774
- const r = await api('GET', `/Magento/Customers/Search?q=${encodeURIComponent(args.email)}`);
7775
- if (!r || !r.id) return `No Magento customer found for ${args.email}.`;
7776
- return `Customer: ${r.name ?? '(no name)'} | ${r.email} | Group: ${r.group ?? r.groupId ?? 'General'} | ID: ${r.id}`;
7820
+ const found = await api('GET', await magentoSearchPath('customers', args.email, args.configId));
7821
+ const customers = Array.isArray(found) ? found : (found && found.id ? [found] : []);
7822
+ if (!customers.length) return `No Magento customer found for ${args.email}.`;
7823
+ return customers.map(r => `Customer: ${r.name ?? ([r.firstName, r.lastName].filter(Boolean).join(' ') || '(no name)')} | ${r.email} | Group: ${r.group ?? r.groupId ?? 'General'} | ID: ${r.id}`).join('\n');
7777
7824
  }
7778
7825
 
7779
7826
  case 'magento_get_order': {
7780
- const r = await api('GET', `/Magento/Orders/Search?q=${encodeURIComponent(args.orderId)}`);
7827
+ const r = await api('GET', await magentoSearchPath('orders', args.orderId, args.configId));
7781
7828
  if (!Array.isArray(r) || !r.length) return `Order ${args.orderId} not found.`;
7782
7829
  const o = r[0];
7783
7830
  const lines = [
@@ -7792,7 +7839,8 @@ reply: ${r?.reply}`;
7792
7839
 
7793
7840
  case 'magento_search_orders': {
7794
7841
  const limit = Math.min(50, args.limit ?? 10);
7795
- const r = await api('GET', `/Magento/Orders/Search?q=${encodeURIComponent(args.email)}&limit=${limit}`);
7842
+ const found = await api('GET', await magentoSearchPath('orders', args.email, args.configId));
7843
+ const r = Array.isArray(found) ? found.slice(0, limit) : found;
7796
7844
  if (!Array.isArray(r) || !r.length) return `No orders found for ${args.email}.`;
7797
7845
  return r.map(o =>
7798
7846
  `[${o.incrementId ?? o.id}] ${o.status} — $${o.grandTotal} — ${o.createdAt?.slice(0, 10)}`
@@ -7801,7 +7849,8 @@ reply: ${r?.reply}`;
7801
7849
 
7802
7850
  case 'magento_search_products': {
7803
7851
  const limit = Math.min(50, args.limit ?? 10);
7804
- const r = await api('GET', `/Magento/Products/Search?q=${encodeURIComponent(args.query)}&limit=${limit}`);
7852
+ const found = await api('GET', await magentoSearchPath('products', args.query, args.configId));
7853
+ const r = Array.isArray(found) ? found.slice(0, limit) : found;
7805
7854
  if (!Array.isArray(r) || !r.length) return `No products found for "${args.query}".`;
7806
7855
  return r.map(p =>
7807
7856
  `[${p.sku}] ${p.name} — $${p.price} — ${p.status}`