@velaro/mcp-server 2.0.43 → 2.0.45

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.43",
3
+ "version": "2.0.45",
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
@@ -690,6 +690,11 @@ const TOOLS = [
690
690
  description: 'Teams the caller can review canned message learning for: every site team for a site supervisor, only managed teams for a team manager. Use the ids as teamId on the other canned_learning tools.',
691
691
  inputSchema: { type: 'object', properties: {} },
692
692
  },
693
+ {
694
+ name: 'canned_learning_usage',
695
+ description: 'Canned message analyses used this month out of the amount included in the plan, and when the allowance resets. Each AI rewrite suggestion counts as one analysis; canned_learning_generate stops at the limit.',
696
+ inputSchema: { type: 'object', properties: {} },
697
+ },
693
698
  {
694
699
  name: 'canned_learning_record_edit',
695
700
  description: 'Record that an agent edited a canned response before sending. The sent text is PII-redacted and length-capped server-side; the site comes from the session. Rows are capped per site and expire after 90 days.',
@@ -2344,7 +2349,7 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
2344
2349
  },
2345
2350
  {
2346
2351
  name: 'report_performance_by_country_get',
2347
- description: 'Performance by Country report (US vs Canada vs Europe vs Other): engagements (handled, missed, abandoned), performance (first response, handle time, bot containment, transfers, service level) and scores (CSAT, sentiment) per country bucket and per agent. attribution: visitor (visitor GeoIP country, default) | agent (country on the agent profile) | group (the site saved group-to-bucket map).',
2352
+ description: 'Performance by Country report (US vs Canada vs Europe vs Other): engagements (handled, missed, abandoned), performance (first response, handle time, bot containment, transfers, service level) and scores (CSAT, sentiment) per country bucket and per agent, plus a concordance block (how often the visitor country matches the country of the team or agent that handled the chat, with visitor-bucket by handled-bucket engagement counts, a 95% range, a small-sample flag, chats with no detected location, chats not assigned to anyone (excluded from the rate, with a by-visitor-region breakdown), a by-handling-group table, a daily match-rate trend, and a matched-vs-mismatched comparison of response, handle time, transfers and CSAT; use it to answer questions like how many Poland chats went to the US team). attribution: visitor (visitor GeoIP country, default) | agent (country on the agent profile) | group (the site saved group-to-bucket map).',
2348
2353
  inputSchema: {
2349
2354
  type: 'object',
2350
2355
  properties: {
@@ -5353,6 +5358,8 @@ async function handleTool(name, args) {
5353
5358
  return await messagingPost('/CannedLearning/generate', { teamId: args.teamId ?? null });
5354
5359
  case 'canned_learning_teams':
5355
5360
  return await messagingGet('/CannedLearning/teams');
5361
+ case 'canned_learning_usage':
5362
+ return await messagingGet('/CannedLearning/usage');
5356
5363
  case 'canned_learning_approve':
5357
5364
  return await messagingPost(`/CannedLearning/suggestions/${args.suggestionId}/approve`, { editedText: args.editedText ?? null });
5358
5365
  case 'canned_learning_reject':
@@ -6803,7 +6810,26 @@ reply: ${r?.reply}`;
6803
6810
  const f = (v, s = '') => (v == null ? '-' : `${v}${s}`);
6804
6811
  const row = x => `${(x.agentName || x.bucket).padEnd(24)} eng ${x.engagements} | handled ${x.handled} | missed ${x.missed} | abandoned ${x.abandoned} | bot containment ${f(x.botContainmentPct, '%')} | transfers ${x.transfersToAgent} | 1st resp ${f(x.avgFirstResponseSeconds, 's')} | handle ${f(x.avgHandleTimeMinutes, 'm')} | SL ${f(x.serviceLevelPct, '%')} | CSAT ${f(x.csatAvg)} (${x.csatCount}) | positive ${f(x.sentimentPositivePct, '%')}`;
6805
6812
  return [`=== Performance by Country (${r.attribution}) ===`, ...(r.buckets || []).map(row), '', 'By agent:',
6806
- ...((r.agents || []).map(a => row(a) + (a.agentCountryNotSet ? ' [agent country not set]' : '')))].join('\n');
6813
+ ...((r.agents || []).map(a => row(a) + (a.agentCountryNotSet ? ' [agent country not set]' : ''))),
6814
+ ...(r.concordance ? (() => {
6815
+ const c = r.concordance;
6816
+ const who = c.handledBasis === 'agentCountry' ? 'agent' : 'team';
6817
+ // Rates may be 0-1 fractions or 0-100 percents; the exact counts decide. Null rate is a dash, never an estimate.
6818
+ const frac = c.matchRate != null && c.totalEngagements ? Math.abs(c.matchRate - c.matchedEngagements / c.totalEngagements) < 0.005 : (c.matchRate != null && c.matchRate <= 1);
6819
+ const p = v => (v == null ? '-' : `${Math.round((frac ? v * 100 : v) * 10) / 10}%`);
6820
+ const rate = c.matchRate == null || !c.totalEngagements ? '-' : p(c.matchRate);
6821
+ const range = c.matchRateCi && rate !== '-' ? ` (95% range ${p(c.matchRateCi.low)} to ${p(c.matchRateCi.high)})` : '';
6822
+ const side = (n, s) => (s ? ` ${n}: chats ${f(s.engagements)} | 1st resp ${f(s.avgFirstResponseSeconds, 's')} | handle ${f(s.avgHandleTimeSeconds, 's')} | transfers ${f(s.transfers)} | CSAT ${f(s.csatAvg)} (${s.csatCount ?? 0})` : null);
6823
+ return ['', `Concordance (visitor country vs ${who} country): ${rate} matched${range} (${c.matchedEngagements} of ${c.totalEngagements})`,
6824
+ ...(c.lowSample ? [' Small sample, treat as a rough guide.'] : []),
6825
+ ...(c.unassigned > 0 ? [` Not assigned to anyone: ${c.unassigned} chats (not counted).${Array.isArray(c.unassignedByVisitorBucket) && c.unassignedByVisitorBucket.some(u => u.engagements > 0) ? ` By visitor region: ${c.unassignedByVisitorBucket.filter(u => u.engagements > 0).map(u => `${u.visitorBucket} ${u.engagements}`).join(', ')}.` : ''}`] : []),
6826
+ ...(c.unknownLocation > 0 ? [` No location detected: ${c.unknownLocation} chats (not counted).`] : []),
6827
+ ...(c.rows || []).map(x => ` ${x.visitorBucket} visitors -> ${x.handledBucket} ${who}: ${x.engagements}`),
6828
+ ...(Array.isArray(c.byHandledGroup) && c.byHandledGroup.length ? ['', 'By handling group:', ...c.byHandledGroup.map(g => ` ${g.group} (${g.bucket || '-'}): chats ${g.total} | matched ${g.matched} | rate ${p(g.matchRate)}${g.ci ? ` | range ${p(g.ci.low)} to ${p(g.ci.high)}` : ''}`)] : []),
6829
+ ...(Array.isArray(c.trend) && c.trend.length ? ['', 'Daily match rate:', ...c.trend.map(d => ` ${String(d.date).slice(0, 10)}: ${p(d.matchRate)} (${d.matched} of ${d.total})`)] : []),
6830
+ ...(c.comparison ? ['', 'Matched vs mismatched chats:', side('matched', c.comparison.matched), side('mismatched', c.comparison.mismatched)].filter(x => x !== null) : []),
6831
+ '', 'Concordance JSON: ' + JSON.stringify(c)];
6832
+ })() : [])].join('\n');
6807
6833
  }
6808
6834
 
6809
6835
  case 'report_performance_by_country_set_groups': {
@@ -48,7 +48,7 @@ const READ_ONLY_EXPLICIT = new Set([
48
48
  'focus_get_draft_pregeneration_report', 'teams_push_settings_get', 'call_center_team_breakdown',
49
49
  'call_center_channel_breakdown', 'outbound_activity_for_contact', 'integration_skill_logs',
50
50
  'magento_activity_logs', 'chat_intelligence_themes', 'chat_intelligence_recommendations',
51
- 'index_move_preview', 'index_split_preview', 'canned_learning_suggestions', 'canned_learning_teams',
51
+ 'index_move_preview', 'index_split_preview', 'canned_learning_suggestions', 'canned_learning_teams', 'canned_learning_usage',
52
52
  'canned_learning_edit_summary', 'chat_topics_group_suggestions', 'chat_topics_suggestions',
53
53
  'enterprise_reports', 'recruiting_ats_failures', 'jobboard_application_history',
54
54
  'recruiting_download_resume', 'routing_inactivity_transfers', 'compliance_attestation',