@velaro/mcp-server 2.0.63 → 2.0.65
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 +1 -1
- package/parity/cobrowse.customer.js +25 -0
- package/parity/report-range.customer.js +37 -0
- package/server.js +53 -0
- package/tool-annotations.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velaro/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.65",
|
|
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,25 @@
|
|
|
1
|
+
// velaro cobrowse: Co-Browse seat assignment for the signed-in site (messaging /CobrowseSettings/Seats). Site comes from the credential only.
|
|
2
|
+
// Parity module (CLI group -> MCP tools).
|
|
3
|
+
|
|
4
|
+
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; };
|
|
5
|
+
|
|
6
|
+
export const tools = [
|
|
7
|
+
{
|
|
8
|
+
name: 'cobrowse_seats_get',
|
|
9
|
+
description: 'Show Co-Browse seats for this site: whether it is licensed, seat count, seats in use, whether every agent has a seat automatically, and each agent with hasSeat.',
|
|
10
|
+
inputSchema: {"type":"object","properties":{}},
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'cobrowse_seat_set',
|
|
14
|
+
description: 'Give an agent a Co-Browse seat or remove it. Every change is recorded in the Activity Log.',
|
|
15
|
+
inputSchema: {"type":"object","properties":{"userId":{"type":"integer","description":"Agent user id from cobrowse_seats_get"},"assigned":{"type":"boolean","description":"true to give a seat, false to remove it"}},"required":["userId","assigned"]},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const handlers = {
|
|
20
|
+
cobrowse_seats_get: async (a, ctx) => ctx.messagingGet('/CobrowseSettings/Seats'),
|
|
21
|
+
cobrowse_seat_set: async (a, ctx) => {
|
|
22
|
+
if (typeof a.assigned !== 'boolean') throw new Error('assigned (true or false) is required');
|
|
23
|
+
return ctx.messagingPut('/CobrowseSettings/Seats/' + pid(a.userId, 'userId'), { assigned: a.assigned });
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// velaro report range-policy / long-range: report date ranges that are shortened to the data an account keeps, and emailed as a link when long.
|
|
2
|
+
// Parity module (CLI group `report` -> MCP tools). The site always comes from the credential, never from an argument.
|
|
3
|
+
// Backend: ReportRangeController.GetRangePolicy (GET ReportRange/range-policy) and ReportRangeController.StartRangeExport (POST ReportRange/export).
|
|
4
|
+
// docs/architecture/long-range-emailed-links.md
|
|
5
|
+
|
|
6
|
+
const qs = (o) => { const p = new URLSearchParams(); for (const [k, v] of Object.entries(o)) if (v !== undefined && v !== null && v !== '') p.set(k, String(v)); const s = p.toString(); return s ? '?' + s : ''; };
|
|
7
|
+
const need = (a, ...ks) => { for (const k of ks) if (a[k] === undefined || a[k] === null || a[k] === '') throw new Error(k + ' is required'); };
|
|
8
|
+
|
|
9
|
+
export const tools = [
|
|
10
|
+
{
|
|
11
|
+
name: 'report_range_policy',
|
|
12
|
+
description: 'Check what a report date range will do BEFORE running it: the window actually reported on (shortened to the data this account keeps, with the reason), whether it runs on screen or is emailed as a link because it is long, the day limit, and the default email address. Dates are yyyy-MM-dd Pacific days (end inclusive). Builds nothing.',
|
|
13
|
+
inputSchema: {"type":"object","properties":{"startDate":{"type":"string","description":"First day, yyyy-MM-dd (Pacific). Default: 30 days ago"},"endDate":{"type":"string","description":"Last day, yyyy-MM-dd (Pacific, inclusive). Default: today"},"inlineMaxDays":{"type":"integer","description":"Optional: lower the limit to what the report can show on screen"}}},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'report_long_range_export',
|
|
17
|
+
description: 'Email a long-range report as a download link. A range over the account limit is built in the background and a signed, expiring, one-time link is emailed (returns 202 with exportId and deliverTo); a range within the limit is NOT queued (returns mode Inline). The window is shortened to the data the account keeps and the response says so. deliverTo defaults to the signed-in user and must be a real, routable address. Poll with report_export_status.',
|
|
18
|
+
inputSchema: {"type":"object","properties":{"reportType":{"type":"string","description":"Report type, e.g. conversations"},"startDate":{"type":"string","description":"First day, yyyy-MM-dd (Pacific)"},"endDate":{"type":"string","description":"Last day, yyyy-MM-dd (Pacific, inclusive)"},"format":{"type":"string","enum":["xlsx","csv"],"description":"Default xlsx"},"deliverTo":{"type":"string","description":"Email address for the link. Default: the signed-in user"},"options":{"type":"object","description":"Report options such as teamId (name to value). Never a site id.","additionalProperties":{"type":"string"}}},"required":["reportType","startDate","endDate"]},
|
|
19
|
+
// Each call queues a new export and sends an email: not idempotent, reaches outside the account (email delivery).
|
|
20
|
+
annotations: { idempotentHint: false, openWorldHint: true },
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const handlers = {
|
|
25
|
+
report_range_policy: async (a, ctx) => ctx.api('GET', '/ReportRange/range-policy' + qs({ start: a.startDate, end: a.endDate, inlineMaxDays: a.inlineMaxDays })),
|
|
26
|
+
report_long_range_export: async (a, ctx) => {
|
|
27
|
+
need(a, 'reportType', 'startDate', 'endDate');
|
|
28
|
+
return ctx.api('POST', '/ReportRange/export', {
|
|
29
|
+
reportType: a.reportType,
|
|
30
|
+
startDate: a.startDate,
|
|
31
|
+
endDate: a.endDate,
|
|
32
|
+
format: a.format,
|
|
33
|
+
deliverTo: a.deliverTo,
|
|
34
|
+
options: a.options,
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
};
|
package/server.js
CHANGED
|
@@ -2640,6 +2640,31 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
|
|
|
2640
2640
|
},
|
|
2641
2641
|
},
|
|
2642
2642
|
|
|
2643
|
+
// ── Integration configuration versions (last 5 per row, with rollback) ─────
|
|
2644
|
+
{
|
|
2645
|
+
name: 'integration_config_versions',
|
|
2646
|
+
description: 'List the last 5 saved versions of every integration configuration of the caller\'s own site (connection settings, field mappings, rules; Dynamics, NetSuite, HubSpot, Salesforce, Shopify, Monday, Pipedrive, SAP and more). A version is saved automatically before every update and delete. Returns metadata only (id, table, version number, who, when), never values. Use the id with integration_config_restore.',
|
|
2647
|
+
inputSchema: {
|
|
2648
|
+
type: 'object',
|
|
2649
|
+
properties: {
|
|
2650
|
+
integration: { type: 'string', description: 'Filter to one table, e.g. "NetSuiteConfigs" or "IntegrationFieldMappings". Omit for all.' },
|
|
2651
|
+
},
|
|
2652
|
+
},
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
name: 'integration_config_restore',
|
|
2656
|
+
description: 'Roll an integration configuration back to a saved version (see integration_config_versions). Dry run by default: lists the setting NAMES that would change. mode "merge" (default) keeps the live connection (OAuth tokens, secrets) and restores mappings, rules and settings; "replace" writes the version exactly; a deleted row is re-inserted. The replaced state is itself saved as a version, so a restore is undoable. Site administrators only.',
|
|
2657
|
+
inputSchema: {
|
|
2658
|
+
type: 'object',
|
|
2659
|
+
properties: {
|
|
2660
|
+
id: { type: 'number', description: 'Version id from integration_config_versions' },
|
|
2661
|
+
mode: { type: 'string', enum: ['merge', 'replace'], description: 'merge (default) or replace' },
|
|
2662
|
+
dryRun: { type: 'boolean', description: 'true (default) only reports what would change; false writes the restore' },
|
|
2663
|
+
},
|
|
2664
|
+
required: ['id'],
|
|
2665
|
+
},
|
|
2666
|
+
},
|
|
2667
|
+
|
|
2643
2668
|
// ── Integration Diagnostics ────────────────────────────────
|
|
2644
2669
|
{
|
|
2645
2670
|
name: 'integration_activity_list',
|
|
@@ -7400,6 +7425,34 @@ reply: ${r?.reply}`;
|
|
|
7400
7425
|
return lines.join('\n');
|
|
7401
7426
|
}
|
|
7402
7427
|
|
|
7428
|
+
// ── Integration configuration versions ────────────────────────────────
|
|
7429
|
+
case 'integration_config_versions': {
|
|
7430
|
+
const qs = args.integration ? `?integration=${encodeURIComponent(args.integration)}` : '';
|
|
7431
|
+
const data = await api('GET', `/IntegrationConfigVersions${qs}`);
|
|
7432
|
+
if (!data?.versions?.length) return 'No saved configuration versions.';
|
|
7433
|
+
const lines = [`${data.versions.length} saved version(s), newest first (max 5 kept per row; v1 = newest of that row)\n`];
|
|
7434
|
+
for (const v of data.versions) {
|
|
7435
|
+
const ts = new Date(v.savedAtUtc).toISOString().replace('T', ' ').slice(0, 19);
|
|
7436
|
+
lines.push(`id ${v.id} ${ts} ${v.integration}#${v.entityKey} v${v.version} ${v.action} by ${v.savedBy ?? 'system'}`);
|
|
7437
|
+
}
|
|
7438
|
+
return lines.join('\n');
|
|
7439
|
+
}
|
|
7440
|
+
|
|
7441
|
+
case 'integration_config_restore': {
|
|
7442
|
+
const mode = args.mode === 'replace' ? 'replace' : 'merge';
|
|
7443
|
+
const dryRun = args.dryRun === false ? 'false' : 'true';
|
|
7444
|
+
const path = `/IntegrationConfigVersions/${encodeURIComponent(args.id)}/restore?mode=${mode}&dryRun=${dryRun}`;
|
|
7445
|
+
let r;
|
|
7446
|
+
try {
|
|
7447
|
+
r = await api('POST', path, {});
|
|
7448
|
+
} catch (e) {
|
|
7449
|
+
// Tables only velaro-messaging owns are restored through its own API (same shape).
|
|
7450
|
+
if (!/table_not_restorable_here|422/.test(String(e && e.message))) throw e;
|
|
7451
|
+
r = await messagingPost(path, {});
|
|
7452
|
+
}
|
|
7453
|
+
return JSON.stringify(r, null, 2);
|
|
7454
|
+
}
|
|
7455
|
+
|
|
7403
7456
|
// ── Integration Diagnostics ───────────────────────────────────────────
|
|
7404
7457
|
case 'integration_activity_list': {
|
|
7405
7458
|
const slug = args.integration ? encodeURIComponent(args.integration) : null;
|
package/tool-annotations.js
CHANGED
|
@@ -28,6 +28,7 @@ const MUTATING = new Set([
|
|
|
28
28
|
'zoom_phone_set_config', 'callpresence_set', 'callpresence_set_groups', 'callpresence_clear',
|
|
29
29
|
'billing_insights_set_preferences', 'billing_insights_dismiss_recommendation',
|
|
30
30
|
'site_sale_create', 'site_sale_update', 'site_sale_end',
|
|
31
|
+
'integration_config_restore',
|
|
31
32
|
]);
|
|
32
33
|
|
|
33
34
|
// Names that look like writes but only read (checked before the write rules).
|