@velaro/mcp-server 2.0.0 → 2.0.2
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/fetch-retry.js +23 -0
- package/messaging-base.js +1 -1
- package/package.json +3 -2
- package/parity/activity.customer.js +1 -1
- package/report-explain.json +232 -0
- package/server.js +182 -156
- package/tool-annotations.js +77 -75
- package/log-search.js +0 -252
package/fetch-retry.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// 429-aware fetch for the customer MCP (mcp/server.js). Same behavior as fetchRetry429 in
|
|
2
|
+
// mcp/log-search.js, which is staff-only and not published (log-search.js must stay byte-identical
|
|
3
|
+
// with cli/lib/log-search.js, so this small helper is a separate file rather than an import of it).
|
|
4
|
+
|
|
5
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* fetch that retries ONLY 429 (honouring Retry-After, seconds, capped at 30 s) for up to `retries` attempts and returns the final Response.
|
|
9
|
+
* `init` may be a function so each attempt gets a fresh AbortSignal.
|
|
10
|
+
*/
|
|
11
|
+
export async function fetchRetry429(url, init = {}, { retries = 3, fetchImpl = fetch, sleepImpl = sleep } = {}) {
|
|
12
|
+
for (let attempt = 0; ; attempt++) {
|
|
13
|
+
const res = await fetchImpl(url, typeof init === 'function' ? init() : init);
|
|
14
|
+
if (res.status === 429 && attempt < retries) {
|
|
15
|
+
// Number(null) is 0, which would turn a 429 without Retry-After into an immediate retry: a missing header means the 5 s default.
|
|
16
|
+
const raw = res.headers?.get?.('retry-after');
|
|
17
|
+
const ra = raw == null || raw === '' ? NaN : Number(raw);
|
|
18
|
+
await sleepImpl(Math.min(Number.isFinite(ra) && ra >= 0 ? ra : 5, 30) * 1000);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
return res;
|
|
22
|
+
}
|
|
23
|
+
}
|
package/messaging-base.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Resolves the velaro-messaging API base for the MCP server.
|
|
2
2
|
//
|
|
3
3
|
// Incident 2026-10-23: the staging MCP was configured with VELARO_ADMIN_API only. Every tool that
|
|
4
|
-
// lives in velaro-messaging (
|
|
4
|
+
// lives in velaro-messaging (the integration diagnose tools, ...) either threw
|
|
5
5
|
// "VELARO_MESSAGING_API is not configured" or, on older installs, called the ADMIN host and got a
|
|
6
6
|
// bare 404 for /diagnostics/test-magento. The messaging base is fully determined by which admin
|
|
7
7
|
// environment this process talks to, so derive it instead of requiring a second env var.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velaro/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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": {
|
|
@@ -43,11 +43,12 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"server.js",
|
|
45
45
|
"tool-annotations.js",
|
|
46
|
-
"
|
|
46
|
+
"fetch-retry.js",
|
|
47
47
|
"messaging-base.js",
|
|
48
48
|
"parity/loader.js",
|
|
49
49
|
"parity/*.customer.js",
|
|
50
50
|
"workflow-schedule.js",
|
|
51
|
+
"report-explain.json",
|
|
51
52
|
"server.json",
|
|
52
53
|
"README.md"
|
|
53
54
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// velaro activity: integration activity logs and settings audit trail for the authenticated site. The CLI --site staff
|
|
1
|
+
// velaro activity: integration activity logs and settings audit trail for the authenticated site. The CLI --site mode is staff-only and is not part of this package.
|
|
2
2
|
// Parity module (CLI group -> MCP tools).
|
|
3
3
|
|
|
4
4
|
const enc = encodeURIComponent;
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
{
|
|
2
|
+
"experience-impact": {
|
|
3
|
+
"name": "Experience Impact",
|
|
4
|
+
"answers": "How staffing and adherence affect what customers feel, as a 0 to 100 Experience Index.",
|
|
5
|
+
"sources": "Work Schedules and presence, chat queue timing, missed chats, and CSAT from ticket replies and 1-5 survey ratings (questions tagged csat or star_rating).",
|
|
6
|
+
"prerequisites": "Work Schedules for agents; a survey with a 1-5 CSAT or star question attached to post-chat or a workflow, or ticket CSAT requests turned on; chat traffic in range.",
|
|
7
|
+
"interpret": "Weights: service level 30, adherence 25, CSAT 25, missed chats 20; a signal with no data drops out. CSAT needs 5+ responses to count. Response rate = rated survey submissions / all survey submissions. Actual agents below scheduled while missed chats rise = staffing gap.",
|
|
8
|
+
"whyZero": "CSAT empty: no CSAT survey configured; survey exists but nobody answered; answers came in with no 1-5 rating question; fewer than 5 responses; or the range predates the survey. Surveyed but unrated? Managers run the CSAT backfill (survey ratings only, not ticket CSAT): preview, then apply, via the report banner, `velaro report-backfill csat`, or MCP report_backfill. Adherence empty: no Work Schedules.",
|
|
9
|
+
"fix": "Add a 1-5 star or CSAT question to the post-chat survey, enable ticket CSAT requests, widen the range, then fix the weakest component.",
|
|
10
|
+
"related": "Schedule Adherence, Service Level, Missed Chats, Surveys & NPS, Sentiment, Agent Performance"
|
|
11
|
+
},
|
|
12
|
+
"conversations": {
|
|
13
|
+
"name": "Conversations",
|
|
14
|
+
"answers": "How many conversations came in, on which channels and when.",
|
|
15
|
+
"sources": "Every conversation record on your account, grouped by channel, team, bot or agent, and time.",
|
|
16
|
+
"prerequisites": "At least one deployed channel (chat widget, SMS, email, voice, social).",
|
|
17
|
+
"interpret": "Overview shows totals and trend; Breakdown splits by channel, team and handler. Look at peaks by hour and day to plan staffing. Rising volume with flat staffing predicts longer waits.",
|
|
18
|
+
"whyZero": "No channel deployed or no traffic; the date range or team filter is too narrow; or you lack access to that team's data.",
|
|
19
|
+
"fix": "Widen the range, clear filters, confirm the deployment is live and the widget loads on your site.",
|
|
20
|
+
"related": "Service Level, Missed Chats, Visitor Traffic"
|
|
21
|
+
},
|
|
22
|
+
"missed": {
|
|
23
|
+
"name": "Missed Chats",
|
|
24
|
+
"answers": "Visitors who asked for help and got no live answer, and why.",
|
|
25
|
+
"sources": "Chat requests that ended without an agent or bot response, plus offline or unanswered conversations.",
|
|
26
|
+
"prerequisites": "Live chat deployed with agents or routing configured.",
|
|
27
|
+
"interpret": "Overview gives the missed count and rate. Breakdown shows time of day and team. Analysis groups likely causes such as nobody online, queue timeout, or visitor left. A missed spike at one hour points to a coverage gap.",
|
|
28
|
+
"whyZero": "Genuinely none, no chat traffic, or a bot answers everything so nothing reaches an agent queue.",
|
|
29
|
+
"fix": "Add agents or schedules for peak hours, review routing and after-hours behavior, enable offline message capture.",
|
|
30
|
+
"related": "Service Level, Experience Impact, Agent Availability"
|
|
31
|
+
},
|
|
32
|
+
"agent-performance": {
|
|
33
|
+
"name": "Agent Performance",
|
|
34
|
+
"answers": "How each agent handles conversations: volume, handle time, response speed and quality.",
|
|
35
|
+
"sources": "Conversations assigned to and handled by each agent, message timestamps, and survey scores where collected.",
|
|
36
|
+
"prerequisites": "Agents added to the account and handling chats.",
|
|
37
|
+
"interpret": "Compare an agent against the team over several weeks, not one day. Pair handle time with CSAT: fast and unhappy is a quality problem, slow and happy may be complex work.",
|
|
38
|
+
"whyZero": "Agent has no assigned chats in range, was not online, or the filter excludes their team. Quality scores need survey data.",
|
|
39
|
+
"fix": "Check routing assigns chats to that agent and that they set themselves available.",
|
|
40
|
+
"related": "Response Time, Agent Utilization, Surveys & NPS"
|
|
41
|
+
},
|
|
42
|
+
"response-time": {
|
|
43
|
+
"name": "Response Time",
|
|
44
|
+
"answers": "How quickly customers get a first reply and how long replies take afterwards.",
|
|
45
|
+
"sources": "Message timestamps between the customer's message and the first agent or bot reply.",
|
|
46
|
+
"prerequisites": "Chats with at least one reply.",
|
|
47
|
+
"interpret": "Look at the median and the slow tail together. A fine average with a long tail means some customers wait far too long.",
|
|
48
|
+
"whyZero": "No replies in range, or chats were only bot-handled and excluded from agent timing.",
|
|
49
|
+
"fix": "Add coverage at slow hours, turn on auto-greeting, review the routing capacity limit.",
|
|
50
|
+
"related": "Service Level, Agent Performance"
|
|
51
|
+
},
|
|
52
|
+
"service-level": {
|
|
53
|
+
"name": "Service Level",
|
|
54
|
+
"answers": "The share of chats answered within your target time.",
|
|
55
|
+
"sources": "Queue entry and first-answer timestamps compared with your configured service level threshold.",
|
|
56
|
+
"prerequisites": "A service level threshold in report settings and chats that enter an agent queue.",
|
|
57
|
+
"interpret": "A common target is 80 percent answered in 30 seconds. Check the trend by hour to find breaches.",
|
|
58
|
+
"whyZero": "No chats were queued for agents in the range, or no threshold is set.",
|
|
59
|
+
"fix": "Set the threshold, then staff to the hours that breach it.",
|
|
60
|
+
"related": "Response Time, Missed Chats, Experience Impact"
|
|
61
|
+
},
|
|
62
|
+
"sentiment": {
|
|
63
|
+
"name": "Sentiment",
|
|
64
|
+
"answers": "The overall tone of customer messages, by contact and by agent.",
|
|
65
|
+
"sources": "AI sentiment scoring of conversation messages.",
|
|
66
|
+
"prerequisites": "Sentiment reporting enabled on your plan and enough conversations to score.",
|
|
67
|
+
"interpret": "Watch the trend and the share of negative conversations. Use By Agent for coaching, By Contact to spot at-risk customers. Sentiment is inferred from text, so treat single scores as hints.",
|
|
68
|
+
"whyZero": "Feature not enabled, conversations too short to score, or scoring has not run yet for recent chats.",
|
|
69
|
+
"fix": "Confirm the plan includes it, widen the range, check again after the next processing cycle.",
|
|
70
|
+
"related": "Customer Health, Surveys & NPS, Experience Impact"
|
|
71
|
+
},
|
|
72
|
+
"health": {
|
|
73
|
+
"name": "Customer Health",
|
|
74
|
+
"answers": "Which contacts look healthy or at risk based on recent interactions.",
|
|
75
|
+
"sources": "Conversation frequency, sentiment, unresolved issues and survey results per contact.",
|
|
76
|
+
"prerequisites": "Contacts with conversation history.",
|
|
77
|
+
"interpret": "Low scores with rising contact frequency are the first to act on. Scores are relative to your own customers.",
|
|
78
|
+
"whyZero": "New account with little history, or sentiment data is not yet available.",
|
|
79
|
+
"fix": "Allow history to accumulate and enable surveys to add a direct signal.",
|
|
80
|
+
"related": "Sentiment, Surveys & NPS, Intelligence Suite"
|
|
81
|
+
},
|
|
82
|
+
"surveys": {
|
|
83
|
+
"name": "Surveys & NPS",
|
|
84
|
+
"answers": "What customers say in surveys: CSAT, NPS and custom questions, and how many respond.",
|
|
85
|
+
"sources": "Survey answers collected after chats, through workflows, standalone links or email.",
|
|
86
|
+
"prerequisites": "At least one active survey (post-chat CSAT, NPS or custom) delivered on a channel.",
|
|
87
|
+
"interpret": "Read the average with the response count and response rate. NPS is promoters minus detractors. Under about 30 responses, trends are noisy.",
|
|
88
|
+
"whyZero": "No survey enabled, survey not attached to the channel or workflow, nobody responded, or the range predates the survey. The visitor may close the chat before the survey shows.",
|
|
89
|
+
"fix": "Enable a short post-chat survey on every staffed channel, test it yourself, and keep questions to one or two.",
|
|
90
|
+
"related": "Experience Impact, Sentiment, Missed Chats"
|
|
91
|
+
},
|
|
92
|
+
"tickets": {
|
|
93
|
+
"name": "Tickets",
|
|
94
|
+
"answers": "Ticket volume, status, age and resolution speed.",
|
|
95
|
+
"sources": "Tickets created from email, forms, chats and manual entry.",
|
|
96
|
+
"prerequisites": "Ticketing or an email inbox connected.",
|
|
97
|
+
"interpret": "Watch open backlog and time to resolve. A growing backlog with steady intake means capacity is short.",
|
|
98
|
+
"whyZero": "Ticketing not enabled, no inbox connected, or no tickets in range.",
|
|
99
|
+
"fix": "Connect an inbox or enable ticket creation from forms and chat.",
|
|
100
|
+
"related": "Conversations, Agent Performance"
|
|
101
|
+
},
|
|
102
|
+
"calls": {
|
|
103
|
+
"name": "Calls",
|
|
104
|
+
"answers": "Phone call volume, duration, answered and missed calls.",
|
|
105
|
+
"sources": "Call records from your connected phone line or voice integration.",
|
|
106
|
+
"prerequisites": "A provisioned phone line or connected voice integration.",
|
|
107
|
+
"interpret": "Compare answered against missed by hour. Long durations may signal complexity or unresolved issues.",
|
|
108
|
+
"whyZero": "No phone line connected or no calls in range.",
|
|
109
|
+
"fix": "Connect a number and confirm it routes into Velaro.",
|
|
110
|
+
"related": "IVR, Voice"
|
|
111
|
+
},
|
|
112
|
+
"ivr": {
|
|
113
|
+
"name": "IVR",
|
|
114
|
+
"answers": "How callers move through your phone menus and where they drop off.",
|
|
115
|
+
"sources": "IVR call events for each menu step and outcome.",
|
|
116
|
+
"prerequisites": "An IVR configured on a phone line.",
|
|
117
|
+
"interpret": "A high drop-off at one step suggests a confusing prompt. Many transfers to an agent from one option shows demand to automate.",
|
|
118
|
+
"whyZero": "No IVR configured or no calls reached it.",
|
|
119
|
+
"fix": "Complete IVR setup, place a test call, then re-check.",
|
|
120
|
+
"related": "Calls, Voice"
|
|
121
|
+
},
|
|
122
|
+
"account-utilization": {
|
|
123
|
+
"name": "Account Utilization",
|
|
124
|
+
"answers": "How much of your plan (agents, bots, AI usage, channels) you are using.",
|
|
125
|
+
"sources": "Plan limits compared with measured usage on your account.",
|
|
126
|
+
"prerequisites": "Administrator or manager access.",
|
|
127
|
+
"interpret": "Near 100 percent means you may need a higher limit; very low usage means features you pay for are idle.",
|
|
128
|
+
"whyZero": "Feature not enabled yet or no usage in range.",
|
|
129
|
+
"fix": "Turn on unused features or request a limit increase.",
|
|
130
|
+
"related": "Agent Utilization"
|
|
131
|
+
},
|
|
132
|
+
"agent-availability": {
|
|
133
|
+
"name": "Agent Availability",
|
|
134
|
+
"answers": "When agents were online, away or offline.",
|
|
135
|
+
"sources": "Agent presence and status changes.",
|
|
136
|
+
"prerequisites": "Agents logging in to the workspace.",
|
|
137
|
+
"interpret": "Compare online time with scheduled time and chat demand to find coverage gaps.",
|
|
138
|
+
"whyZero": "Agents did not log in or the selected agents are not in range.",
|
|
139
|
+
"fix": "Confirm agents sign in and set their status to available.",
|
|
140
|
+
"related": "Schedule Adherence, Agent Utilization, Missed Chats"
|
|
141
|
+
},
|
|
142
|
+
"agent-utilization": {
|
|
143
|
+
"name": "Agent Utilization",
|
|
144
|
+
"answers": "How busy agents are compared with their capacity.",
|
|
145
|
+
"sources": "Concurrent chat load and online time per agent.",
|
|
146
|
+
"prerequisites": "Administrator or manager access; agents handling chats.",
|
|
147
|
+
"interpret": "Around 60 to 80 percent is healthy. Above that risks long waits and burnout, well below means spare capacity.",
|
|
148
|
+
"whyZero": "Agents were not online or not given chats.",
|
|
149
|
+
"fix": "Rebalance routing and capacity limits.",
|
|
150
|
+
"related": "Agent Availability, Agent Performance"
|
|
151
|
+
},
|
|
152
|
+
"visitor-traffic": {
|
|
153
|
+
"name": "Visitor Traffic",
|
|
154
|
+
"answers": "Who is visiting pages that have the Velaro widget and how many start chats.",
|
|
155
|
+
"sources": "Visitor tracking from the widget script on your site.",
|
|
156
|
+
"prerequisites": "Visitor tracking enabled and the widget installed on your pages.",
|
|
157
|
+
"interpret": "Compare visits with chats started to find pages where engagement is low.",
|
|
158
|
+
"whyZero": "Widget not installed on those pages, tracking not enabled, or an ad blocker or consent setting blocks it.",
|
|
159
|
+
"fix": "Verify the embed code on the live page and the tracking setting.",
|
|
160
|
+
"related": "Conversations"
|
|
161
|
+
},
|
|
162
|
+
"schedule-adherence": {
|
|
163
|
+
"name": "Schedule Adherence",
|
|
164
|
+
"answers": "Whether agents were online when scheduled.",
|
|
165
|
+
"sources": "Work Schedules compared with agent presence, plus approved exceptions.",
|
|
166
|
+
"prerequisites": "Work Schedules assigned to agents; the site time zone set correctly.",
|
|
167
|
+
"interpret": "Adherence is minutes available during scheduled time divided by scheduled minutes. Approved exceptions are excluded. Use Intraday for now and Timeline for the day's detail.",
|
|
168
|
+
"whyZero": "No schedules assigned, agents not scheduled in range, or time zone mismatch.",
|
|
169
|
+
"fix": "Create and assign schedules and check the time zone.",
|
|
170
|
+
"related": "Experience Impact, Agent Availability, Service Level"
|
|
171
|
+
},
|
|
172
|
+
"chat-intelligence": {
|
|
173
|
+
"name": "Chat Intelligence",
|
|
174
|
+
"answers": "What topics customers ask about, trends, and where the bot or KB falls short.",
|
|
175
|
+
"sources": "AI topic grouping of conversations and missed topics.",
|
|
176
|
+
"prerequisites": "Enough conversations (typically dozens) and the feature enabled.",
|
|
177
|
+
"interpret": "Rising themes show new demand. Missed topics are KB gaps: write or ingest content for them. Recommendations can be applied or dismissed.",
|
|
178
|
+
"whyZero": "Too little traffic, feature not enabled, or analysis has not run.",
|
|
179
|
+
"fix": "Widen the range and allow the next analysis run.",
|
|
180
|
+
"related": "Intelligence Suite, Conversation Efficiency"
|
|
181
|
+
},
|
|
182
|
+
"conversation-efficiency": {
|
|
183
|
+
"name": "Conversation Efficiency",
|
|
184
|
+
"answers": "How efficiently conversations are resolved and where time is lost.",
|
|
185
|
+
"sources": "Message counts, handle time, transfers and outcomes.",
|
|
186
|
+
"prerequisites": "Conversations with agent involvement.",
|
|
187
|
+
"interpret": "Agents shows who is above or below the norm, Correlation shows what drives long chats, Recommendations suggests actions.",
|
|
188
|
+
"whyZero": "No handled conversations in range.",
|
|
189
|
+
"fix": "Widen the range or pick a team with traffic.",
|
|
190
|
+
"related": "Agent Performance, Chat Intelligence"
|
|
191
|
+
},
|
|
192
|
+
"intelligence": {
|
|
193
|
+
"name": "Intelligence Suite",
|
|
194
|
+
"answers": "AI analysis across agents, customers, knowledge gaps, volume forecasts, revenue impact, competitors and channels.",
|
|
195
|
+
"sources": "Conversation history, surveys, and connected commerce or CRM data where present.",
|
|
196
|
+
"prerequisites": "Feature enabled on the plan and a few weeks of data. Revenue Impact needs a commerce or CRM integration.",
|
|
197
|
+
"interpret": "Treat each tab as guidance. Predictive Volume is a forecast, not a guarantee. Revenue Impact is an estimate from connected data.",
|
|
198
|
+
"whyZero": "Not enough history, missing integration, or feature not enabled.",
|
|
199
|
+
"fix": "Connect the relevant integration and allow data to accumulate.",
|
|
200
|
+
"related": "Customer Health, Chat Intelligence"
|
|
201
|
+
},
|
|
202
|
+
"operations": {
|
|
203
|
+
"name": "Operations Center",
|
|
204
|
+
"answers": "Live view of queues, agents and conversations right now.",
|
|
205
|
+
"sources": "Real-time presence and queue state.",
|
|
206
|
+
"prerequisites": "Workforce management enabled.",
|
|
207
|
+
"interpret": "Use it for moment-to-moment staffing. A rising queue with idle agents suggests a routing problem.",
|
|
208
|
+
"whyZero": "No active conversations or agents online.",
|
|
209
|
+
"fix": "Confirm agents are online and routing is active.",
|
|
210
|
+
"related": "Agent Availability, Service Level"
|
|
211
|
+
},
|
|
212
|
+
"voice": {
|
|
213
|
+
"name": "Voice",
|
|
214
|
+
"answers": "Individual call history and voice usage and billing.",
|
|
215
|
+
"sources": "Call log and voice minute usage.",
|
|
216
|
+
"prerequisites": "Voice enabled with a phone number.",
|
|
217
|
+
"interpret": "Call Log for detail, Usage for minutes against your plan.",
|
|
218
|
+
"whyZero": "No voice line or no calls.",
|
|
219
|
+
"fix": "Set up a voice number.",
|
|
220
|
+
"related": "Calls, IVR"
|
|
221
|
+
},
|
|
222
|
+
"email-subscriptions": {
|
|
223
|
+
"name": "Email Reports",
|
|
224
|
+
"answers": "Scheduled report summaries emailed to you.",
|
|
225
|
+
"sources": "The same data as the reports, summarized on your schedule.",
|
|
226
|
+
"prerequisites": "Access to the underlying report; some are manager or admin only.",
|
|
227
|
+
"interpret": "Each email links back to the full report.",
|
|
228
|
+
"whyZero": "Subscription not saved, the report is not on your plan, or it had no data for the period.",
|
|
229
|
+
"fix": "Re-save the subscription and check spam filtering for noreply@velaro.com.",
|
|
230
|
+
"related": "All reports"
|
|
231
|
+
}
|
|
232
|
+
}
|