@velaro/mcp-server 2.0.62 → 2.0.64
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/crm-studio.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.64",
|
|
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": {
|
|
@@ -38,11 +38,28 @@ export const tools = [
|
|
|
38
38
|
validation: { type: 'object', description: 'For example { "min": 0, "max": 100, "regex": "^[A-Z]{3}$" }.' },
|
|
39
39
|
readRoles: { type: 'array', items: { type: 'string' } },
|
|
40
40
|
writeRoles: { type: 'array', items: { type: 'string' } },
|
|
41
|
+
formula: { type: 'object', description: 'Makes the field calculated (CRM Studio package; see your plan). { "kind":"formula","expr":"ROUND(amount * probability / 100, 2)","resultType":"number|text|date|boolean","when":rule } or { "kind":"rollup","expr":"SUM(lineItems.total)","where":rule }. Expressions: + - * / %, comparisons, && || !, IF ROUND MIN MAX ABS CONCAT COALESCE TODAY DAYS_BETWEEN; refs are built-in field names or cf:<fieldId>. Rollups: SUM|COUNT|MIN|MAX|AVG of lineItems (deal), deals (company, contact) or tickets (contact). The value is computed when a record is read and cannot be written; resultType must fit fieldType. An empty object removes the formula.' },
|
|
41
42
|
visibleWhen: { type: 'object', description: 'Rule { "ref": "<built-in field name or cf:<fieldId>>", "operator": "equals|not_equals|contains|starts_with|is_empty|is_not_empty", "value": "..." }, or a group { "all": [rules] } / { "any": [rules] }.' },
|
|
42
43
|
},
|
|
43
44
|
required: ['entity'],
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
{
|
|
48
|
+
name: 'crm_formula_test',
|
|
49
|
+
description: 'Dry-run a CRM calculated field expression or rollup before saving it. Administrator only; writes nothing. Pass expr (a formula) or formula (the whole spec, needed for a rollup). sampleValues maps a field name or cf:<fieldId> to a value; recordId uses that record\'s real values underneath the samples and is required to test a rollup. Returns the value, or the reason it could not be calculated.',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
entity: { type: 'string', enum: ENTITIES },
|
|
54
|
+
expr: { type: 'string', description: 'For example "amount * 2" or "IF(amount > 100, \'big\', \'small\')".' },
|
|
55
|
+
resultType: { type: 'string', enum: ['number', 'text', 'date', 'boolean'], description: 'Defaults to number.' },
|
|
56
|
+
formula: { type: 'object', description: 'The whole spec instead of expr: { "kind":"rollup","expr":"COUNT(deals)","where":rule }.' },
|
|
57
|
+
sampleValues: { type: 'object' },
|
|
58
|
+
recordId: { type: 'number' },
|
|
59
|
+
},
|
|
60
|
+
required: ['entity'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
46
63
|
{
|
|
47
64
|
name: 'crm_field_archive',
|
|
48
65
|
description: 'Archive a CRM custom field. Administrator only. Saved values are kept but stop showing.',
|
|
@@ -112,6 +129,7 @@ const fieldBody = (a) => {
|
|
|
112
129
|
set('readRolesJson', jsonArg(a.readRoles));
|
|
113
130
|
set('writeRolesJson', jsonArg(a.writeRoles));
|
|
114
131
|
set('visibleWhenJson', jsonArg(a.visibleWhen));
|
|
132
|
+
set('formulaJson', jsonArg(a.formula));
|
|
115
133
|
return body;
|
|
116
134
|
};
|
|
117
135
|
|
|
@@ -130,6 +148,13 @@ export const handlers = {
|
|
|
130
148
|
crm_field_list: async (a, ctx) => data(await ctx.messagingGet(`/CrmCustomFields${q({ entity: a.entity, pipelineId: a.pipelineId })}`)),
|
|
131
149
|
crm_field_define: async (a, ctx) =>
|
|
132
150
|
data(a.id ? await ctx.messagingPut(`/CrmCustomFields/${encodeURIComponent(a.id)}`, fieldBody(a)) : await ctx.messagingPost('/CrmCustomFields', fieldBody(a))),
|
|
151
|
+
crm_formula_test: async (a, ctx) =>
|
|
152
|
+
data(await ctx.messagingPost('/CrmCustomFields/formula/test', {
|
|
153
|
+
entity: a.entity,
|
|
154
|
+
...(a.formula !== undefined ? { formulaJson: JSON.stringify(a.formula) } : { expr: a.expr, resultType: a.resultType ?? 'number' }),
|
|
155
|
+
...(a.sampleValues !== undefined ? { sampleValues: a.sampleValues } : {}),
|
|
156
|
+
...(a.recordId !== undefined ? { recordId: a.recordId } : {}),
|
|
157
|
+
})),
|
|
133
158
|
crm_field_archive: async (a, ctx) => data(await ctx.messagingDel(`/CrmCustomFields/${encodeURIComponent(a.id)}`)),
|
|
134
159
|
crm_layout_list: async (a, ctx) => data(await ctx.messagingGet(`/CrmFormLayouts${q({ entity: a.entity, pipelineId: a.pipelineId })}`)),
|
|
135
160
|
crm_layout_resolve: async (a, ctx) =>
|
|
@@ -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).
|