@velaro/mcp-server 2.0.67 → 2.0.69

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.67",
3
+ "version": "2.0.69",
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": {
@@ -0,0 +1,21 @@
1
+ // velaro ai-ack (customer): the AI Features Acknowledgment. Read-only. Site comes from the credential.
2
+ // Acceptance itself is UI-only on purpose (an administrator types their own name and title).
3
+ // Parity module (CLI group -> MCP tools).
4
+
5
+ export const tools = [
6
+ {
7
+ name: 'ai_ack_status',
8
+ description: 'Show whether your site has accepted the current AI Features Acknowledgment, the current text version, and who accepted it and when. Acceptance is done by an administrator in the app, never through this tool.',
9
+ inputSchema: { type: 'object', properties: {} },
10
+ },
11
+ {
12
+ name: 'ai_ack_list',
13
+ description: 'List every feature acknowledgment your site has accepted (signer name, title, email, role, time, text version, the feature that prompted it).',
14
+ inputSchema: { type: 'object', properties: {} },
15
+ },
16
+ ];
17
+
18
+ export const handlers = {
19
+ ai_ack_status: async (_a, ctx) => ctx.api('GET', '/FeatureAcknowledgments/status?key=AiFeatures'),
20
+ ai_ack_list: async (_a, ctx) => ctx.api('GET', '/FeatureAcknowledgments'),
21
+ };
@@ -0,0 +1,86 @@
1
+ // velaro signup-form: signup forms, popups and slide-ins = the LIST-GROWTH LAYER of a survey (Survey.GrowthConfigJson).
2
+ // Not a separate form system: fields, consent wording, versions and submissions are the survey's. Site comes from the credential only.
3
+ // Needs the Email Growth package; the server answers 403 naming it. Parity module (CLI group signup-form -> MCP tools signup_form_*).
4
+
5
+ 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; };
6
+
7
+ const findSurvey = async (ctx, id) => {
8
+ const all = (await ctx.messagingGet('/Surveys/list')) ?? [];
9
+ const s = all.find((x) => x.id === pid(id));
10
+ if (!s) throw new Error('Survey ' + id + ' not found');
11
+ return s;
12
+ };
13
+ const growthOf = (s) => { if (!s.growthConfigJson) return null; try { return JSON.parse(s.growthConfigJson); } catch { return null; } };
14
+
15
+ export const tools = [
16
+ {
17
+ name: 'signup_form_list',
18
+ description: 'List signup forms (surveys that have the list-growth layer switched on): display type, trigger, target list and the shareable-link slug.',
19
+ inputSchema: { type: 'object', properties: {} },
20
+ },
21
+ {
22
+ name: 'signup_form_get',
23
+ description: 'Get one signup form (a survey id) with its list-growth settings: display (popup, slide_in, embedded; timed, scroll, exit intent; URL rules; frequency cap), target list, tags, double opt-in, success action, protection.',
24
+ inputSchema: { type: 'object', properties: { id: { type: 'integer', description: 'Survey id' } }, required: ['id'] },
25
+ },
26
+ {
27
+ name: 'signup_form_set',
28
+ description: 'Change the list-growth settings of a survey. Pass growth (the full settings object) and/or enabled. The survey fields and consent wording are edited with the survey tools. Needs consent wording switched on and the Email Growth package.',
29
+ inputSchema: {
30
+ type: 'object',
31
+ properties: {
32
+ id: { type: 'integer', description: 'Survey id' },
33
+ enabled: { type: 'boolean', description: 'Switch the layer on or off' },
34
+ growth: { type: 'object', description: 'Full growth settings: { enabled, display:{type,trigger,delaySeconds,scrollPercent,urlRules,frequencyCapDays,hideForKnownSubscribers,position}, list:{listId,tags,emailQuestionId,attributeMap,doubleOptIn:{enabled,subject,bodyHtml,expiryHours}}, success:{messageHtml,redirectUrl}, protection:{allowedOrigins,captcha,captchaSiteKey}, chatCapture:{enabled}, notifyMe:{enabled,type} }' },
35
+ },
36
+ required: ['id'],
37
+ },
38
+ },
39
+ {
40
+ name: 'signup_form_stats',
41
+ description: 'Per-form conversion: views, dismissals, signups, subscribed, awaiting double opt-in confirmation, confirmed, suppressed, conversion rate, daily impressions.',
42
+ inputSchema: { type: 'object', properties: { id: { type: 'integer' }, days: { type: 'integer', description: 'Window in days (default 30, max 365)' } }, required: ['id'] },
43
+ },
44
+ {
45
+ name: 'signup_form_submissions',
46
+ description: 'Paginated signups for a form with opt-in status and the consent record id that proves consent.',
47
+ inputSchema: { type: 'object', properties: { id: { type: 'integer' }, page: { type: 'integer' }, pageSize: { type: 'integer', description: 'Max 100' }, status: { type: 'string', enum: ['subscribed', 'pending_confirmation', 'confirmed', 'suppressed', 'list_sync_failed'] } }, required: ['id'] },
48
+ },
49
+ {
50
+ name: 'signup_form_snippet',
51
+ description: 'The one-line install snippet (works in Shopify theme.liquid and WordPress header/footer plugins). Needs the shareable link enabled.',
52
+ inputSchema: { type: 'object', properties: { id: { type: 'integer' }, host: { type: 'string', description: 'Script host (default https://messaging.velaro.com)' } }, required: ['id'] },
53
+ },
54
+ ];
55
+
56
+ export const handlers = {
57
+ signup_form_list: async (a, ctx) => {
58
+ const all = ((await ctx.messagingGet('/Surveys/list')) ?? []).filter((s) => growthOf(s)?.enabled);
59
+ return all.map((s) => ({ id: s.id, name: s.name, publicSlug: s.publicSlug, display: growthOf(s).display, listId: growthOf(s).list?.listId ?? null }));
60
+ },
61
+ signup_form_get: async (a, ctx) => {
62
+ const s = await findSurvey(ctx, a.id);
63
+ return { id: s.id, name: s.name, publicSlug: s.publicSlug, allowStandaloneAccess: s.allowStandaloneAccess, consentEnabled: s.consentEnabled, growth: growthOf(s) };
64
+ },
65
+ signup_form_set: async (a, ctx) => {
66
+ const s = await findSurvey(ctx, a.id);
67
+ const cfg = a.growth ?? growthOf(s) ?? { enabled: false };
68
+ if (a.enabled !== undefined) cfg.enabled = a.enabled;
69
+ const saved = await ctx.messagingPost('/Surveys', { ...s, growthConfigJson: JSON.stringify(cfg) });
70
+ if (cfg.enabled && !saved.allowStandaloneAccess) await ctx.messagingPost('/Surveys/' + saved.id + '/standalone-link');
71
+ return { id: saved.id, growth: growthOf(saved) };
72
+ },
73
+ signup_form_stats: async (a, ctx) => ctx.messagingGet('/Surveys/' + pid(a.id) + '/growth/stats?days=' + Math.min(365, Math.max(1, a.days ?? 30))),
74
+ signup_form_submissions: async (a, ctx) => {
75
+ const q = 'page=' + Math.max(1, a.page ?? 1) + '&pageSize=' + Math.min(100, Math.max(1, a.pageSize ?? 25)) + (a.status ? '&status=' + encodeURIComponent(a.status) : '');
76
+ return ctx.messagingGet('/Surveys/' + pid(a.id) + '/growth/submissions?' + q);
77
+ },
78
+ signup_form_snippet: async (a, ctx) => {
79
+ const s = await findSurvey(ctx, a.id);
80
+ if (!s.publicSlug || !s.allowStandaloneAccess) throw new Error('Enable the shareable link first (signup_form_set with enabled: true).');
81
+ const host = a.host || 'https://messaging.velaro.com';
82
+ const lines = ['<script async src="' + host + '/messenger/forms.js" data-form="' + s.publicSlug + '"></script>'];
83
+ if (growthOf(s)?.display?.type === 'embedded') lines.push('<div data-velaro-form="' + s.publicSlug + '"></div>');
84
+ return lines.join('\n');
85
+ },
86
+ };