@velaro/mcp-server 2.0.62 → 2.0.63
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.
|
|
3
|
+
"version": "2.0.63",
|
|
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) =>
|