@velaro/mcp-server 2.0.81 → 2.0.82

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +55 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.81",
3
+ "version": "2.0.82",
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
@@ -3067,6 +3067,41 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
3067
3067
  required: ['reportType'],
3068
3068
  },
3069
3069
  },
3070
+ {
3071
+ name: 'commerce_safety_get',
3072
+ description: 'Commerce Safety (money-action policy): how refunds, store credit and adjustments are handled for the caller site: mode, limits, allowed methods, per-store overrides, whether the platform-wide pause is active, and effective values. Scoped to the caller site.',
3073
+ inputSchema: { type: 'object', properties: {} },
3074
+ },
3075
+ {
3076
+ name: 'commerce_safety_set',
3077
+ description: 'Change the Commerce Safety policy. Propose-then-confirm: without confirmed=true it returns a preview and saves nothing; show the preview to the customer and call again with confirmed=true only after they agree. Omitted fields keep their value; null resets a field to the default. Scoped to the caller site.',
3078
+ inputSchema: {
3079
+ type: 'object',
3080
+ properties: {
3081
+ enabled: { type: 'boolean' },
3082
+ mode: { type: 'string', enum: ['disabled', 'propose_only_agent_approves', 'auto_up_to_limit', 'auto'] },
3083
+ maxAmountPerAction: { type: ['number', 'null'] },
3084
+ maxPerOrder: { type: ['number', 'null'] },
3085
+ maxPerConversation: { type: ['number', 'null'] },
3086
+ maxPerDayPerSite: { type: ['number', 'null'] },
3087
+ maxPerDayPerCustomer: { type: ['number', 'null'] },
3088
+ maxCountPerDay: { type: ['integer', 'null'] },
3089
+ allowedMethods: { type: 'array', items: { type: 'string', enum: ['original_payment', 'store_credit', 'adjustment_credit'] } },
3090
+ requireVerifiedCustomer: { type: 'boolean' },
3091
+ approvalThreshold: { type: ['number', 'null'] },
3092
+ allowedReasons: { type: 'array', items: { type: 'string' } },
3093
+ cooldownMinutes: { type: ['integer', 'null'] },
3094
+ currency: { type: 'string' },
3095
+ overrides: { type: 'object', description: 'Per-store partial policies keyed by shopify, magento, woocommerce, bigcommerce, square, netsuite or payments. null clears one.' },
3096
+ confirmed: { type: 'boolean', description: 'Must be true to save; set only after the customer approved the preview.' },
3097
+ },
3098
+ },
3099
+ },
3100
+ {
3101
+ name: 'commerce_safety_rollback',
3102
+ description: 'Restore the previous saved Commerce Safety policy. Requires confirmed=true; reports when no earlier version exists. Scoped to the caller site.',
3103
+ inputSchema: { type: 'object', properties: { confirmed: { type: 'boolean' } }, required: ['confirmed'] },
3104
+ },
3070
3105
  {
3071
3106
  name: 'experience_impact_report',
3072
3107
  description: 'Experience Impact report: shows how staffing and schedule adherence affect customer experience. Returns a 0-100 experience index (adherence 25, service level 30, missed-chat rate 20, CSAT 25), per-interval staffing vs chat demand (scheduled vs actual agents, missed chats, wait time, CSAT), per-agent rows, a bot-vs-human breakdown (bot only, bot-to-human handoff, human only, with wait, missed, CSAT and bot containment rate), and plain-language insights. Scoped to the caller site.',
@@ -8034,6 +8069,26 @@ reply: ${r?.reply}`;
8034
8069
  return JSON.stringify(await messagingGet('/api/enterprise-reports/' + seg + (q ? '?' + q : '')), null, 2);
8035
8070
  }
8036
8071
 
8072
+ case 'commerce_safety_get': {
8073
+ return JSON.stringify(await messagingGet('/api/Commerce/MoneyPolicy'), null, 2);
8074
+ }
8075
+
8076
+ case 'commerce_safety_set': {
8077
+ const keys = ['enabled', 'mode', 'maxAmountPerAction', 'maxPerOrder', 'maxPerConversation', 'maxPerDayPerSite', 'maxPerDayPerCustomer', 'maxCountPerDay', 'allowedMethods', 'requireVerifiedCustomer', 'approvalThreshold', 'allowedReasons', 'cooldownMinutes', 'currency', 'overrides'];
8078
+ const body = {};
8079
+ for (const k of keys) if (Object.prototype.hasOwnProperty.call(args, k)) body[k] = args[k];
8080
+ if (Object.keys(body).length === 0) return JSON.stringify({ success: false, error: 'Give at least one Commerce Safety setting to change.' });
8081
+ if (args.confirmed !== true) {
8082
+ return JSON.stringify({ success: true, saved: false, requires_confirmation: true, changes: body, next_step: 'Show these changes in plain English. If the customer agrees, call commerce_safety_set again with the same settings and confirmed=true.' }, null, 2);
8083
+ }
8084
+ return JSON.stringify({ success: true, saved: true, policy: await messagingPut('/api/Commerce/MoneyPolicy', body) }, null, 2);
8085
+ }
8086
+
8087
+ case 'commerce_safety_rollback': {
8088
+ if (args.confirmed !== true) return JSON.stringify({ success: false, error: 'Not restored: the customer must approve first (confirmed=true).' });
8089
+ return JSON.stringify({ success: true, saved: true, policy: await messagingPost('/api/Commerce/MoneyPolicy/rollback', {}) }, null, 2);
8090
+ }
8091
+
8037
8092
  case 'experience_impact_report': {
8038
8093
  const qs = new URLSearchParams();
8039
8094
  for (const k of ['from', 'to', 'teamId']) if (args[k] != null && args[k] !== '') qs.set(k, String(args[k]));