@velaro/mcp-server 2.0.61 → 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.61",
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) =>
package/server.js CHANGED
@@ -1382,6 +1382,25 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
1382
1382
  },
1383
1383
  },
1384
1384
 
1385
+ // ── Moshky change access ('Moshky can make changes') ─────────────────────
1386
+ {
1387
+ name: 'moshky_write_access_get',
1388
+ description: "Show whether 'Moshky can make changes' is on for this site, plus the consent wording and its version.",
1389
+ inputSchema: { type: 'object', properties: {}, required: [] },
1390
+ },
1391
+ {
1392
+ name: 'moshky_write_access_set',
1393
+ description: "Turn 'Moshky can make changes' on or off for this site (account administrators only; audit-logged). Turning it on requires acknowledged=true and the consentVersion returned by moshky_write_access_get, meaning the customer has read and accepted the consent text.",
1394
+ inputSchema: {
1395
+ type: 'object',
1396
+ properties: {
1397
+ enabled: { type: 'boolean' },
1398
+ acknowledged: { type: 'boolean', description: 'Customer accepted the consent text (required when enabling)' },
1399
+ consentVersion: { type: 'string', description: 'consentVersion from moshky_write_access_get (required when enabling)' },
1400
+ },
1401
+ required: ['enabled'],
1402
+ },
1403
+ },
1385
1404
  // ── Copilot Studio / Azure AI Agent connections ──────────────────────────
1386
1405
  {
1387
1406
  name: 'copilot_studio_list',
@@ -5864,6 +5883,16 @@ async function handleTool(name, args) {
5864
5883
  }
5865
5884
 
5866
5885
  // ── Copilot Studio / Azure AI Agent connections ────────────────────────
5886
+ case 'moshky_write_access_get': {
5887
+ return JSON.stringify(await api('GET', '/Copilot/WriteAccess'), null, 2);
5888
+ }
5889
+ case 'moshky_write_access_set': {
5890
+ return JSON.stringify(await api('PUT', '/Copilot/WriteAccess', {
5891
+ enabled: !!args.enabled,
5892
+ acknowledged: !!args.acknowledged,
5893
+ consentVersion: args.consentVersion || '',
5894
+ }), null, 2);
5895
+ }
5867
5896
  case 'copilot_studio_list': {
5868
5897
  const configs = await api('GET', '/CopilotStudio/configs');
5869
5898
  if (!Array.isArray(configs) || !configs.length) {