@velaro/mcp-server 2.0.2 → 2.0.3
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/server.js +131 -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.3",
|
|
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": {
|
package/server.js
CHANGED
|
@@ -4063,6 +4063,77 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
|
|
|
4063
4063
|
required: ['contactId'],
|
|
4064
4064
|
},
|
|
4065
4065
|
},
|
|
4066
|
+
// -- Current Sales (time-boxed bot override Q&A + per-customer coupons). Site comes from the credential, never an arg. --
|
|
4067
|
+
{
|
|
4068
|
+
name: 'site_sale_list',
|
|
4069
|
+
description: "List this site's Current Sales (temporary sales or discounts the bot answers about deterministically until they end).",
|
|
4070
|
+
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
4071
|
+
},
|
|
4072
|
+
{
|
|
4073
|
+
name: 'site_sale_create',
|
|
4074
|
+
description: 'Create a Current Sale: while active, the bot answers sales, discount and coupon questions from this definition and can issue per-customer coupons (Magento sites mint a real cart price rule). It stops at the end time. Times are UTC; convert from Pacific.',
|
|
4075
|
+
inputSchema: {
|
|
4076
|
+
type: 'object',
|
|
4077
|
+
properties: {
|
|
4078
|
+
name: { type: 'string', description: 'Sale name shown to customers' },
|
|
4079
|
+
description: { type: 'string', description: 'Short description the bot can quote' },
|
|
4080
|
+
appliesTo: { type: 'string', enum: ['all','category','products'], description: 'Scope of the sale' },
|
|
4081
|
+
appliesToValue: { type: 'string', description: 'Category name or comma-separated product identifiers when appliesTo is category or products' },
|
|
4082
|
+
discountType: { type: 'string', enum: ['percentage','fixed_amount','free_shipping'], description: 'Kind of discount' },
|
|
4083
|
+
discountValue: { type: 'number', description: 'Percent or fixed amount (ignored for free_shipping)' },
|
|
4084
|
+
startsAtUtc: { type: 'string', description: 'ISO 8601 start time in UTC (convert from Pacific)' },
|
|
4085
|
+
endsAtUtc: { type: 'string', description: 'ISO 8601 end time in UTC; the sale stops answering at this time' },
|
|
4086
|
+
couponCode: { type: 'string', description: 'Optional shared coupon code' },
|
|
4087
|
+
autoGenerateCoupons: { type: 'boolean', description: 'Let the bot issue a unique coupon per customer' },
|
|
4088
|
+
maxCouponsPerCustomer: { type: 'number', description: 'Max coupons the bot issues to one customer' },
|
|
4089
|
+
couponUsageLimit: { type: 'number', description: 'Times each coupon can be used' },
|
|
4090
|
+
couponExpiresHours: { type: 'number', description: 'Hours before an issued coupon expires' },
|
|
4091
|
+
},
|
|
4092
|
+
required: ['name', 'discountType', 'startsAtUtc', 'endsAtUtc'],
|
|
4093
|
+
},
|
|
4094
|
+
},
|
|
4095
|
+
{
|
|
4096
|
+
name: 'site_sale_update',
|
|
4097
|
+
description: 'Update a Current Sale by id. Omit a field to leave it unchanged.',
|
|
4098
|
+
inputSchema: {
|
|
4099
|
+
type: 'object',
|
|
4100
|
+
properties: {
|
|
4101
|
+
id: { type: 'number', description: 'Sale ID from site_sale_list. Required.' },
|
|
4102
|
+
name: { type: 'string', description: 'Sale name shown to customers' },
|
|
4103
|
+
description: { type: 'string', description: 'Short description the bot can quote' },
|
|
4104
|
+
appliesTo: { type: 'string', enum: ['all','category','products'], description: 'Scope of the sale' },
|
|
4105
|
+
appliesToValue: { type: 'string', description: 'Category name or comma-separated product identifiers when appliesTo is category or products' },
|
|
4106
|
+
discountType: { type: 'string', enum: ['percentage','fixed_amount','free_shipping'], description: 'Kind of discount' },
|
|
4107
|
+
discountValue: { type: 'number', description: 'Percent or fixed amount (ignored for free_shipping)' },
|
|
4108
|
+
startsAtUtc: { type: 'string', description: 'ISO 8601 start time in UTC (convert from Pacific)' },
|
|
4109
|
+
endsAtUtc: { type: 'string', description: 'ISO 8601 end time in UTC; the sale stops answering at this time' },
|
|
4110
|
+
couponCode: { type: 'string', description: 'Optional shared coupon code' },
|
|
4111
|
+
autoGenerateCoupons: { type: 'boolean', description: 'Let the bot issue a unique coupon per customer' },
|
|
4112
|
+
maxCouponsPerCustomer: { type: 'number', description: 'Max coupons the bot issues to one customer' },
|
|
4113
|
+
couponUsageLimit: { type: 'number', description: 'Times each coupon can be used' },
|
|
4114
|
+
couponExpiresHours: { type: 'number', description: 'Hours before an issued coupon expires' },
|
|
4115
|
+
},
|
|
4116
|
+
required: ['id'],
|
|
4117
|
+
},
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
name: 'site_sale_end',
|
|
4121
|
+
description: 'End a Current Sale now. The bot stops answering from it immediately.',
|
|
4122
|
+
inputSchema: {
|
|
4123
|
+
type: 'object',
|
|
4124
|
+
properties: { id: { type: 'number', description: 'Sale ID. Required.' } },
|
|
4125
|
+
required: ['id'],
|
|
4126
|
+
},
|
|
4127
|
+
},
|
|
4128
|
+
{
|
|
4129
|
+
name: 'site_sale_delete',
|
|
4130
|
+
description: 'Delete a Current Sale by id.',
|
|
4131
|
+
inputSchema: {
|
|
4132
|
+
type: 'object',
|
|
4133
|
+
properties: { id: { type: 'number', description: 'Sale ID. Required.' } },
|
|
4134
|
+
required: ['id'],
|
|
4135
|
+
},
|
|
4136
|
+
},
|
|
4066
4137
|
{
|
|
4067
4138
|
name: 'pickup_get_config',
|
|
4068
4139
|
description: 'Get this site\'s Pickup & Reminder Texting configuration (default cadence, max reminders, message template, enabled state, quiet-hours override). Returns null/404 if no config has been created yet -- use pickup_update_config to create one.',
|
|
@@ -8341,6 +8412,66 @@ ${JSON.stringify(result, null, 2)}`;
|
|
|
8341
8412
|
return JSON.stringify(history, null, 2);
|
|
8342
8413
|
}
|
|
8343
8414
|
|
|
8415
|
+
case 'site_sale_list': {
|
|
8416
|
+
const result = await messagingGet('/SiteSales');
|
|
8417
|
+
return JSON.stringify(result, null, 2);
|
|
8418
|
+
}
|
|
8419
|
+
|
|
8420
|
+
case 'site_sale_create': {
|
|
8421
|
+
if (!args.name || !args.discountType || !args.startsAtUtc || !args.endsAtUtc) return 'name, discountType, startsAtUtc and endsAtUtc are required.';
|
|
8422
|
+
// Field names must match the SiteSales request on the messaging API exactly (undefined is dropped by JSON).
|
|
8423
|
+
const body = {
|
|
8424
|
+
name: args.name,
|
|
8425
|
+
description: args.description,
|
|
8426
|
+
appliesTo: args.appliesTo,
|
|
8427
|
+
appliesToValue: args.appliesToValue,
|
|
8428
|
+
discountType: args.discountType,
|
|
8429
|
+
discountValue: args.discountValue,
|
|
8430
|
+
startsAtUtc: args.startsAtUtc,
|
|
8431
|
+
endsAtUtc: args.endsAtUtc,
|
|
8432
|
+
couponCode: args.couponCode,
|
|
8433
|
+
autoGenerateCoupons: args.autoGenerateCoupons,
|
|
8434
|
+
maxCouponsPerCustomer: args.maxCouponsPerCustomer,
|
|
8435
|
+
couponUsageLimit: args.couponUsageLimit,
|
|
8436
|
+
couponExpiresHours: args.couponExpiresHours,
|
|
8437
|
+
};
|
|
8438
|
+
const result = await messagingPost('/SiteSales', body);
|
|
8439
|
+
return JSON.stringify(result, null, 2);
|
|
8440
|
+
}
|
|
8441
|
+
|
|
8442
|
+
case 'site_sale_update': {
|
|
8443
|
+
if (args.id == null) return 'id is required.';
|
|
8444
|
+
const body = {
|
|
8445
|
+
name: args.name,
|
|
8446
|
+
description: args.description,
|
|
8447
|
+
appliesTo: args.appliesTo,
|
|
8448
|
+
appliesToValue: args.appliesToValue,
|
|
8449
|
+
discountType: args.discountType,
|
|
8450
|
+
discountValue: args.discountValue,
|
|
8451
|
+
startsAtUtc: args.startsAtUtc,
|
|
8452
|
+
endsAtUtc: args.endsAtUtc,
|
|
8453
|
+
couponCode: args.couponCode,
|
|
8454
|
+
autoGenerateCoupons: args.autoGenerateCoupons,
|
|
8455
|
+
maxCouponsPerCustomer: args.maxCouponsPerCustomer,
|
|
8456
|
+
couponUsageLimit: args.couponUsageLimit,
|
|
8457
|
+
couponExpiresHours: args.couponExpiresHours,
|
|
8458
|
+
};
|
|
8459
|
+
const result = await messagingPut(`/SiteSales/${encodeURIComponent(args.id)}`, body);
|
|
8460
|
+
return JSON.stringify(result, null, 2);
|
|
8461
|
+
}
|
|
8462
|
+
|
|
8463
|
+
case 'site_sale_end': {
|
|
8464
|
+
if (args.id == null) return 'id is required.';
|
|
8465
|
+
const result = await messagingPost(`/SiteSales/${encodeURIComponent(args.id)}/end`, {});
|
|
8466
|
+
return JSON.stringify(result, null, 2);
|
|
8467
|
+
}
|
|
8468
|
+
|
|
8469
|
+
case 'site_sale_delete': {
|
|
8470
|
+
if (args.id == null) return 'id is required.';
|
|
8471
|
+
const result = await messagingDel(`/SiteSales/${encodeURIComponent(args.id)}`);
|
|
8472
|
+
return JSON.stringify(result, null, 2);
|
|
8473
|
+
}
|
|
8474
|
+
|
|
8344
8475
|
case 'pickup_get_config': {
|
|
8345
8476
|
const config = await messagingGet('/PickupNotifications/Config').catch(err => {
|
|
8346
8477
|
if (String(err.message).includes(' 404')) return null;
|
package/tool-annotations.js
CHANGED
|
@@ -25,6 +25,7 @@ const MUTATING = new Set([
|
|
|
25
25
|
'routing_team_update_config', 'pickup_update_config', 'payment_recovery_update_config',
|
|
26
26
|
'recruiting_sync_jobs', 'ai_config_set_reply_format', 'magento_set_sidebar_fields',
|
|
27
27
|
'zoom_phone_set_config',
|
|
28
|
+
'site_sale_create', 'site_sale_update', 'site_sale_end',
|
|
28
29
|
]);
|
|
29
30
|
|
|
30
31
|
// Names that look like writes but only read (checked before the write rules).
|