@open-loyalty/mcp-server 1.1.0 → 1.3.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.
Files changed (112) hide show
  1. package/README.md +180 -177
  2. package/dist/auth/provider.js +2 -14
  3. package/dist/auth/storage.js +22 -0
  4. package/dist/client/http.js +10 -0
  5. package/dist/config.d.ts +0 -13
  6. package/dist/config.js +0 -14
  7. package/dist/http.js +35 -3
  8. package/dist/instructions.d.ts +5 -0
  9. package/dist/instructions.js +440 -0
  10. package/dist/prompts/fan-engagement-setup.d.ts +107 -0
  11. package/dist/prompts/fan-engagement-setup.js +492 -0
  12. package/dist/server.d.ts +1 -1
  13. package/dist/server.js +60 -273
  14. package/dist/tools/achievement/handlers.d.ts +117 -0
  15. package/dist/tools/achievement/handlers.js +161 -0
  16. package/dist/tools/achievement/index.d.ts +479 -0
  17. package/dist/tools/achievement/index.js +74 -0
  18. package/dist/tools/achievement/schemas.d.ts +433 -0
  19. package/dist/tools/achievement/schemas.js +142 -0
  20. package/dist/tools/achievement.d.ts +141 -121
  21. package/dist/tools/achievement.js +60 -24
  22. package/dist/tools/admin.d.ts +6 -6
  23. package/dist/tools/admin.js +12 -12
  24. package/dist/tools/analytics.d.ts +11 -11
  25. package/dist/tools/analytics.js +30 -29
  26. package/dist/tools/apikey.d.ts +3 -3
  27. package/dist/tools/apikey.js +6 -6
  28. package/dist/tools/audit.d.ts +2 -2
  29. package/dist/tools/audit.js +4 -4
  30. package/dist/tools/badge.d.ts +6 -6
  31. package/dist/tools/badge.js +23 -18
  32. package/dist/tools/campaign/handlers.d.ts +42 -0
  33. package/dist/tools/campaign/handlers.js +223 -0
  34. package/dist/tools/campaign/index.d.ts +783 -0
  35. package/dist/tools/campaign/index.js +117 -0
  36. package/dist/tools/campaign/member-handlers.d.ts +60 -0
  37. package/dist/tools/campaign/member-handlers.js +159 -0
  38. package/dist/tools/campaign/schemas.d.ts +704 -0
  39. package/dist/tools/campaign/schemas.js +259 -0
  40. package/dist/tools/campaign/types.d.ts +161 -0
  41. package/dist/tools/campaign/types.js +2 -0
  42. package/dist/tools/custom-event.d.ts +315 -0
  43. package/dist/tools/custom-event.js +270 -0
  44. package/dist/tools/export.d.ts +4 -4
  45. package/dist/tools/export.js +12 -12
  46. package/dist/tools/import.d.ts +3 -3
  47. package/dist/tools/import.js +23 -15
  48. package/dist/tools/index.js +13 -5
  49. package/dist/tools/member/handlers.d.ts +111 -0
  50. package/dist/tools/member/handlers.js +206 -0
  51. package/dist/tools/member/index.d.ts +169 -0
  52. package/dist/tools/member/index.js +92 -0
  53. package/dist/tools/member/schemas.d.ts +89 -0
  54. package/dist/tools/member/schemas.js +65 -0
  55. package/dist/tools/points.d.ts +7 -6
  56. package/dist/tools/points.js +21 -20
  57. package/dist/tools/referral/handlers.d.ts +47 -0
  58. package/dist/tools/referral/handlers.js +115 -0
  59. package/dist/tools/referral/index.d.ts +44 -0
  60. package/dist/tools/referral/index.js +44 -0
  61. package/dist/tools/referral/schemas.d.ts +34 -0
  62. package/dist/tools/referral/schemas.js +52 -0
  63. package/dist/tools/reward/handlers.d.ts +110 -0
  64. package/dist/tools/reward/handlers.js +289 -0
  65. package/dist/tools/reward/index.d.ts +177 -0
  66. package/dist/tools/reward/index.js +93 -0
  67. package/dist/tools/reward/schemas.d.ts +116 -0
  68. package/dist/tools/reward/schemas.js +92 -0
  69. package/dist/tools/role.d.ts +6 -6
  70. package/dist/tools/role.js +12 -12
  71. package/dist/tools/segment/handlers.d.ts +87 -0
  72. package/dist/tools/segment/handlers.js +174 -0
  73. package/dist/tools/segment/index.d.ts +395 -0
  74. package/dist/tools/segment/index.js +88 -0
  75. package/dist/tools/segment/schemas.d.ts +337 -0
  76. package/dist/tools/segment/schemas.js +79 -0
  77. package/dist/tools/segment.d.ts +10 -10
  78. package/dist/tools/segment.js +55 -31
  79. package/dist/tools/store.d.ts +4 -4
  80. package/dist/tools/store.js +8 -8
  81. package/dist/tools/tierset.d.ts +10 -10
  82. package/dist/tools/tierset.js +69 -37
  83. package/dist/tools/transaction.d.ts +4 -4
  84. package/dist/tools/transaction.js +12 -12
  85. package/dist/tools/wallet-type.d.ts +221 -16
  86. package/dist/tools/wallet-type.js +248 -17
  87. package/dist/tools/webhook.d.ts +6 -6
  88. package/dist/tools/webhook.js +90 -31
  89. package/dist/types/schemas/achievement.d.ts +18 -18
  90. package/dist/types/schemas/campaign.d.ts +64 -184
  91. package/dist/types/schemas/campaign.js +2 -7
  92. package/dist/types/schemas/common.d.ts +5 -0
  93. package/dist/types/schemas/common.js +5 -0
  94. package/dist/types/schemas/member.d.ts +2 -2
  95. package/dist/types/schemas/reward.d.ts +94 -18
  96. package/dist/types/schemas/reward.js +8 -3
  97. package/dist/types/schemas/wallet-type.d.ts +306 -8
  98. package/dist/types/schemas/wallet-type.js +82 -1
  99. package/dist/utils/errors.js +32 -5
  100. package/dist/workflows/app-login-streak.d.ts +39 -0
  101. package/dist/workflows/app-login-streak.js +298 -0
  102. package/dist/workflows/early-arrival.d.ts +33 -0
  103. package/dist/workflows/early-arrival.js +148 -0
  104. package/dist/workflows/index.d.ts +101 -0
  105. package/dist/workflows/index.js +208 -0
  106. package/dist/workflows/match-attendance.d.ts +45 -0
  107. package/dist/workflows/match-attendance.js +308 -0
  108. package/dist/workflows/sportsbar-visit.d.ts +41 -0
  109. package/dist/workflows/sportsbar-visit.js +284 -0
  110. package/dist/workflows/vod-watching.d.ts +43 -0
  111. package/dist/workflows/vod-watching.js +326 -0
  112. package/package.json +8 -2
@@ -4,15 +4,18 @@ import { formatApiError } from "../utils/errors.js";
4
4
  import { getStoreCode } from "../config.js";
5
5
  // Input Schemas
6
6
  export const SegmentListInputSchema = {
7
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
7
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
8
8
  page: z.number().optional().describe("Page number (default: 1)."),
9
9
  perPage: z.number().optional().describe("Items per page (default: 10)."),
10
10
  active: z.boolean().optional().describe("Filter by active status."),
11
11
  name: z.string().optional().describe("Filter by segment name."),
12
12
  };
13
13
  // Criterion input schema - flexible to support all criterion types
14
+ // NOTE: Only certain criterion types are supported by the API.
15
+ // WORKING: transaction_count (requires both min AND max; MCP will auto-fill max if omitted)
16
+ // NOT WORKING: tier, points_balance (rejected by API despite being documented)
14
17
  const SegmentCriterionInputSchema = z.object({
15
- type: z.string().describe("Criterion type (e.g., 'tier', 'transaction_count', 'points_balance')."),
18
+ type: z.string().describe("Criterion type. WORKING: 'transaction_count' (requires both min AND max; MCP auto-fills max if omitted). NOT WORKING: 'tier', 'points_balance' are rejected by the API."),
16
19
  criterionId: z.string().optional().describe("Criterion ID (optional, generated if not provided)."),
17
20
  // Common criterion data fields
18
21
  days: z.number().optional().describe("Days for time-based criteria."),
@@ -37,18 +40,18 @@ const SegmentPartInputSchema = z.object({
37
40
  criteria: z.array(SegmentCriterionInputSchema).describe("Criteria for this part (AND logic)."),
38
41
  });
39
42
  export const SegmentCreateInputSchema = {
40
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
43
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
41
44
  name: z.string().describe("Segment name (required)."),
42
45
  description: z.string().optional().describe("Segment description."),
43
46
  active: z.boolean().optional().describe("Whether segment is active (default: false)."),
44
47
  parts: z.array(SegmentPartInputSchema).describe("Segment parts. Parts use OR logic (ANY part matches), criteria within parts use AND logic (ALL criteria must match)."),
45
48
  };
46
49
  export const SegmentGetInputSchema = {
47
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
50
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
48
51
  segmentId: z.string().describe("The segment ID (UUID) to retrieve."),
49
52
  };
50
53
  export const SegmentUpdateInputSchema = {
51
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
54
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
52
55
  segmentId: z.string().describe("The segment ID (UUID) to update."),
53
56
  name: z.string().describe("Segment name."),
54
57
  description: z.string().optional().describe("Segment description."),
@@ -56,25 +59,25 @@ export const SegmentUpdateInputSchema = {
56
59
  parts: z.array(SegmentPartInputSchema).describe("Segment parts."),
57
60
  };
58
61
  export const SegmentDeleteInputSchema = {
59
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
62
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
60
63
  segmentId: z.string().describe("The segment ID (UUID) to delete."),
61
64
  };
62
65
  export const SegmentGetMembersInputSchema = {
63
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
66
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
64
67
  segmentId: z.string().describe("The segment ID (UUID) to get members for."),
65
68
  page: z.number().optional().describe("Page number (default: 1)."),
66
69
  perPage: z.number().optional().describe("Items per page (default: 25)."),
67
70
  };
68
71
  export const SegmentActivateInputSchema = {
69
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
72
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
70
73
  segmentId: z.string().describe("The segment ID (UUID) to activate."),
71
74
  };
72
75
  export const SegmentDeactivateInputSchema = {
73
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
76
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
74
77
  segmentId: z.string().describe("The segment ID (UUID) to deactivate."),
75
78
  };
76
79
  export const SegmentGetResourcesInputSchema = {
77
- storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
80
+ storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
78
81
  segmentId: z.string().describe("The segment ID (UUID) to get associated resources for."),
79
82
  };
80
83
  // Handler functions
@@ -111,14 +114,32 @@ export async function segmentList(input) {
111
114
  };
112
115
  }
113
116
  catch (error) {
114
- throw formatApiError(error, "openloyalty_segment_list");
117
+ throw formatApiError(error, "ol_segment_list");
115
118
  }
116
119
  }
120
+ const DEFAULT_TRANSACTION_COUNT_MAX = 999999;
121
+ function normalizeSegmentParts(parts) {
122
+ return parts.map((part) => ({
123
+ ...part,
124
+ criteria: part.criteria.map((criterion) => {
125
+ if (!criterion || typeof criterion !== "object") {
126
+ return criterion;
127
+ }
128
+ const normalized = { ...criterion };
129
+ if (normalized.type === "transaction_count" &&
130
+ normalized.min !== undefined &&
131
+ normalized.max === undefined) {
132
+ normalized.max = DEFAULT_TRANSACTION_COUNT_MAX;
133
+ }
134
+ return normalized;
135
+ }),
136
+ }));
137
+ }
117
138
  export async function segmentCreate(input) {
118
139
  const storeCode = getStoreCode(input.storeCode);
119
140
  const segmentPayload = {
120
141
  name: input.name,
121
- parts: input.parts,
142
+ parts: normalizeSegmentParts(input.parts),
122
143
  };
123
144
  if (input.description)
124
145
  segmentPayload.description = input.description;
@@ -130,7 +151,7 @@ export async function segmentCreate(input) {
130
151
  return { segmentId: response.segmentId };
131
152
  }
132
153
  catch (error) {
133
- throw formatApiError(error, "openloyalty_segment_create");
154
+ throw formatApiError(error, "ol_segment_create");
134
155
  }
135
156
  }
136
157
  export async function segmentGet(input) {
@@ -140,14 +161,14 @@ export async function segmentGet(input) {
140
161
  return response;
141
162
  }
142
163
  catch (error) {
143
- throw formatApiError(error, "openloyalty_segment_get");
164
+ throw formatApiError(error, "ol_segment_get");
144
165
  }
145
166
  }
146
167
  export async function segmentUpdate(input) {
147
168
  const storeCode = getStoreCode(input.storeCode);
148
169
  const segmentPayload = {
149
170
  name: input.name,
150
- parts: input.parts,
171
+ parts: normalizeSegmentParts(input.parts),
151
172
  };
152
173
  if (input.description !== undefined)
153
174
  segmentPayload.description = input.description;
@@ -158,7 +179,7 @@ export async function segmentUpdate(input) {
158
179
  await apiPut(`/${storeCode}/segment/${input.segmentId}`, { segment: segmentPayload });
159
180
  }
160
181
  catch (error) {
161
- throw formatApiError(error, "openloyalty_segment_update");
182
+ throw formatApiError(error, "ol_segment_update");
162
183
  }
163
184
  }
164
185
  export async function segmentDelete(input) {
@@ -167,7 +188,7 @@ export async function segmentDelete(input) {
167
188
  await apiDelete(`/${storeCode}/segment/${input.segmentId}`);
168
189
  }
169
190
  catch (error) {
170
- throw formatApiError(error, "openloyalty_segment_delete");
191
+ throw formatApiError(error, "ol_segment_delete");
171
192
  }
172
193
  }
173
194
  export async function segmentGetMembers(input) {
@@ -199,7 +220,7 @@ export async function segmentGetMembers(input) {
199
220
  };
200
221
  }
201
222
  catch (error) {
202
- throw formatApiError(error, "openloyalty_segment_get_members");
223
+ throw formatApiError(error, "ol_segment_get_members");
203
224
  }
204
225
  }
205
226
  export async function segmentActivate(input) {
@@ -208,7 +229,7 @@ export async function segmentActivate(input) {
208
229
  await apiPost(`/${storeCode}/segment/${input.segmentId}/activate`, {});
209
230
  }
210
231
  catch (error) {
211
- throw formatApiError(error, "openloyalty_segment_activate");
232
+ throw formatApiError(error, "ol_segment_activate");
212
233
  }
213
234
  }
214
235
  export async function segmentDeactivate(input) {
@@ -217,7 +238,7 @@ export async function segmentDeactivate(input) {
217
238
  await apiPost(`/${storeCode}/segment/${input.segmentId}/deactivate`, {});
218
239
  }
219
240
  catch (error) {
220
- throw formatApiError(error, "openloyalty_segment_deactivate");
241
+ throw formatApiError(error, "ol_segment_deactivate");
221
242
  }
222
243
  }
223
244
  export async function segmentGetResources(input) {
@@ -228,13 +249,13 @@ export async function segmentGetResources(input) {
228
249
  return { resources };
229
250
  }
230
251
  catch (error) {
231
- throw formatApiError(error, "openloyalty_segment_get_resources");
252
+ throw formatApiError(error, "ol_segment_get_resources");
232
253
  }
233
254
  }
234
255
  // Tool definitions
235
256
  export const segmentToolDefinitions = [
236
257
  {
237
- name: "openloyalty_segment_list",
258
+ name: "ol_segment_list",
238
259
  title: "List Segments",
239
260
  description: "List customer segments. Segments group members by criteria (purchase behavior, tier, location, etc). Use for campaign targeting and analytics.",
240
261
  readOnly: true,
@@ -242,15 +263,18 @@ export const segmentToolDefinitions = [
242
263
  handler: segmentList,
243
264
  },
244
265
  {
245
- name: "openloyalty_segment_create",
266
+ name: "ol_segment_create",
246
267
  title: "Create Segment",
247
- description: "Create segment to group members. Parts use OR logic (member matches if ANY part matches). Criteria within parts use AND logic (must match ALL criteria in that part). Common criteria: tier, transaction_count, points_balance, country. Example - VIP segment: parts: [{ criteria: [{ type: 'tier', tierIds: ['gold-level-id'] }] }]",
268
+ description: "Create segment to group members. Parts use OR logic (member matches if ANY part matches). Criteria within parts use AND logic (must match ALL criteria in that part). " +
269
+ "WORKING criterion types: 'transaction_count' (requires BOTH min AND max). " +
270
+ "NOT WORKING: 'tier', 'points_balance' are rejected by the API. " +
271
+ "Example - High activity segment: parts: [{ criteria: [{ type: 'transaction_count', min: 5, max: 999999 }] }]",
248
272
  readOnly: false,
249
273
  inputSchema: SegmentCreateInputSchema,
250
274
  handler: segmentCreate,
251
275
  },
252
276
  {
253
- name: "openloyalty_segment_get",
277
+ name: "ol_segment_get",
254
278
  title: "Get Segment Details",
255
279
  description: "Get full segment details including all parts and criteria configurations.",
256
280
  readOnly: true,
@@ -258,7 +282,7 @@ export const segmentToolDefinitions = [
258
282
  handler: segmentGet,
259
283
  },
260
284
  {
261
- name: "openloyalty_segment_update",
285
+ name: "ol_segment_update",
262
286
  title: "Update Segment",
263
287
  description: "Update segment configuration. Requires full segment definition (name, parts with criteria). Use segment_get first to retrieve current configuration.",
264
288
  readOnly: false,
@@ -266,7 +290,7 @@ export const segmentToolDefinitions = [
266
290
  handler: segmentUpdate,
267
291
  },
268
292
  {
269
- name: "openloyalty_segment_delete",
293
+ name: "ol_segment_delete",
270
294
  title: "Delete Segment (Permanent)",
271
295
  description: "Permanently delete a segment. Cannot be undone. Check segment_get_resources first to see what uses this segment.",
272
296
  readOnly: false,
@@ -275,7 +299,7 @@ export const segmentToolDefinitions = [
275
299
  handler: segmentDelete,
276
300
  },
277
301
  {
278
- name: "openloyalty_segment_get_members",
302
+ name: "ol_segment_get_members",
279
303
  title: "Get Segment Members",
280
304
  description: "Get members belonging to a segment. Returns paginated list of member details. Use for verifying segment criteria or exporting member lists.",
281
305
  readOnly: true,
@@ -283,7 +307,7 @@ export const segmentToolDefinitions = [
283
307
  handler: segmentGetMembers,
284
308
  },
285
309
  {
286
- name: "openloyalty_segment_activate",
310
+ name: "ol_segment_activate",
287
311
  title: "Activate Segment",
288
312
  description: "Activate a segment. Active segments are used for campaign targeting and can be queried for members.",
289
313
  readOnly: false,
@@ -291,7 +315,7 @@ export const segmentToolDefinitions = [
291
315
  handler: segmentActivate,
292
316
  },
293
317
  {
294
- name: "openloyalty_segment_deactivate",
318
+ name: "ol_segment_deactivate",
295
319
  title: "Deactivate Segment",
296
320
  description: "Deactivate a segment. Deactivated segments are not used for campaign targeting but retain their configuration.",
297
321
  readOnly: false,
@@ -299,7 +323,7 @@ export const segmentToolDefinitions = [
299
323
  handler: segmentDeactivate,
300
324
  },
301
325
  {
302
- name: "openloyalty_segment_get_resources",
326
+ name: "ol_segment_get_resources",
303
327
  title: "Get Segment Resources",
304
328
  description: "Get resources (campaigns, rewards, etc.) that use this segment for targeting. Check before deleting a segment.",
305
329
  readOnly: true,
@@ -61,7 +61,7 @@ export declare function storeUpdate(input: {
61
61
  currency?: string;
62
62
  }): Promise<void>;
63
63
  export declare const storeToolDefinitions: readonly [{
64
- readonly name: "openloyalty_store_list";
64
+ readonly name: "ol_store_list";
65
65
  readonly title: "List Stores";
66
66
  readonly description: "List all stores with optional filtering. Returns paginated list of stores with storeId, code, name, currency, and active status. Stores enable multi-tenant loyalty programs. Each store has independent members, campaigns, and settings.";
67
67
  readonly readOnly: true;
@@ -74,7 +74,7 @@ export declare const storeToolDefinitions: readonly [{
74
74
  };
75
75
  readonly handler: typeof storeList;
76
76
  }, {
77
- readonly name: "openloyalty_store_create";
77
+ readonly name: "ol_store_create";
78
78
  readonly title: "Create Store";
79
79
  readonly description: "Create a new store for multi-tenant setup. Requires unique code and name. Returns storeId on success.";
80
80
  readonly readOnly: false;
@@ -86,7 +86,7 @@ export declare const storeToolDefinitions: readonly [{
86
86
  };
87
87
  readonly handler: typeof storeCreate;
88
88
  }, {
89
- readonly name: "openloyalty_store_get";
89
+ readonly name: "ol_store_get";
90
90
  readonly title: "Get Store Details";
91
91
  readonly description: "Get full store configuration by ID. Returns storeId, code, name, currency, active status, and timestamps.";
92
92
  readonly readOnly: true;
@@ -95,7 +95,7 @@ export declare const storeToolDefinitions: readonly [{
95
95
  };
96
96
  readonly handler: typeof storeGet;
97
97
  }, {
98
- readonly name: "openloyalty_store_update";
98
+ readonly name: "ol_store_update";
99
99
  readonly title: "Update Store";
100
100
  readonly description: "Update store configuration. Can update name, currency, and active status. Returns void on success (204 No Content).";
101
101
  readonly readOnly: false;
@@ -44,7 +44,7 @@ export async function storeList(input) {
44
44
  return response;
45
45
  }
46
46
  catch (error) {
47
- throw formatApiError(error, "openloyalty_store_list");
47
+ throw formatApiError(error, "ol_store_list");
48
48
  }
49
49
  }
50
50
  export async function storeCreate(input) {
@@ -61,7 +61,7 @@ export async function storeCreate(input) {
61
61
  return response;
62
62
  }
63
63
  catch (error) {
64
- throw formatApiError(error, "openloyalty_store_create");
64
+ throw formatApiError(error, "ol_store_create");
65
65
  }
66
66
  }
67
67
  export async function storeGet(input) {
@@ -70,7 +70,7 @@ export async function storeGet(input) {
70
70
  return response;
71
71
  }
72
72
  catch (error) {
73
- throw formatApiError(error, "openloyalty_store_get");
73
+ throw formatApiError(error, "ol_store_get");
74
74
  }
75
75
  }
76
76
  export async function storeUpdate(input) {
@@ -85,13 +85,13 @@ export async function storeUpdate(input) {
85
85
  await apiPut(`/store/${input.storeId}`, { store: payload });
86
86
  }
87
87
  catch (error) {
88
- throw formatApiError(error, "openloyalty_store_update");
88
+ throw formatApiError(error, "ol_store_update");
89
89
  }
90
90
  }
91
91
  // Tool definitions
92
92
  export const storeToolDefinitions = [
93
93
  {
94
- name: "openloyalty_store_list",
94
+ name: "ol_store_list",
95
95
  title: "List Stores",
96
96
  description: "List all stores with optional filtering. Returns paginated list of stores with storeId, code, name, currency, and active status. Stores enable multi-tenant loyalty programs. Each store has independent members, campaigns, and settings.",
97
97
  readOnly: true,
@@ -99,7 +99,7 @@ export const storeToolDefinitions = [
99
99
  handler: storeList,
100
100
  },
101
101
  {
102
- name: "openloyalty_store_create",
102
+ name: "ol_store_create",
103
103
  title: "Create Store",
104
104
  description: "Create a new store for multi-tenant setup. Requires unique code and name. Returns storeId on success.",
105
105
  readOnly: false,
@@ -107,7 +107,7 @@ export const storeToolDefinitions = [
107
107
  handler: storeCreate,
108
108
  },
109
109
  {
110
- name: "openloyalty_store_get",
110
+ name: "ol_store_get",
111
111
  title: "Get Store Details",
112
112
  description: "Get full store configuration by ID. Returns storeId, code, name, currency, active status, and timestamps.",
113
113
  readOnly: true,
@@ -115,7 +115,7 @@ export const storeToolDefinitions = [
115
115
  handler: storeGet,
116
116
  },
117
117
  {
118
- name: "openloyalty_store_update",
118
+ name: "ol_store_update",
119
119
  title: "Update Store",
120
120
  description: "Update store configuration. Can update name, currency, and active status. Returns void on success (204 No Content).",
121
121
  readOnly: false,
@@ -167,9 +167,9 @@ export declare function tiersetGetTiers(input: TierSetGetInput): Promise<{
167
167
  };
168
168
  }>;
169
169
  export declare const tiersetToolDefinitions: readonly [{
170
- readonly name: "openloyalty_tierset_list";
170
+ readonly name: "ol_tierset_list";
171
171
  readonly title: "List Loyalty Programs";
172
- readonly description: "List all tier sets. Use tierset_get to fetch conditions needed for defining tiers. Returns tierSetId, name, active status, and tier count for each tier set.";
172
+ readonly description: string;
173
173
  readonly readOnly: true;
174
174
  readonly inputSchema: {
175
175
  storeCode: z.ZodOptional<z.ZodString>;
@@ -178,9 +178,9 @@ export declare const tiersetToolDefinitions: readonly [{
178
178
  };
179
179
  readonly handler: typeof tiersetList;
180
180
  }, {
181
- readonly name: "openloyalty_tierset_create";
181
+ readonly name: "ol_tierset_create";
182
182
  readonly title: "Create Loyalty Program";
183
- readonly description: "Create a new tier set (loyalty program structure). After creation, call tierset_get to obtain conditionId values, then tierset_update_tiers to define tier thresholds. Conditions define what metrics are used for tier progression (e.g., activeUnits for points balance).";
183
+ readonly description: string;
184
184
  readonly readOnly: false;
185
185
  readonly inputSchema: {
186
186
  storeCode: z.ZodOptional<z.ZodString>;
@@ -210,9 +210,9 @@ export declare const tiersetToolDefinitions: readonly [{
210
210
  };
211
211
  readonly handler: typeof tiersetCreate;
212
212
  }, {
213
- readonly name: "openloyalty_tierset_get";
213
+ readonly name: "ol_tierset_get";
214
214
  readonly title: "Get Loyalty Program Details";
215
- readonly description: "Get tier set details including conditionId values needed for tierset_update_tiers. Returns the full tier set with conditions array containing conditionId for each condition.";
215
+ readonly description: string;
216
216
  readonly readOnly: true;
217
217
  readonly inputSchema: {
218
218
  storeCode: z.ZodOptional<z.ZodString>;
@@ -220,9 +220,9 @@ export declare const tiersetToolDefinitions: readonly [{
220
220
  };
221
221
  readonly handler: typeof tiersetGet;
222
222
  }, {
223
- readonly name: "openloyalty_tierset_update";
223
+ readonly name: "ol_tierset_update";
224
224
  readonly title: "Update Loyalty Program";
225
- readonly description: "Update tier set metadata (name, description, active status, downgrade settings). Does not modify tiers - use tierset_update_tiers for that.";
225
+ readonly description: string;
226
226
  readonly readOnly: false;
227
227
  readonly inputSchema: {
228
228
  storeCode: z.ZodOptional<z.ZodString>;
@@ -243,7 +243,7 @@ export declare const tiersetToolDefinitions: readonly [{
243
243
  };
244
244
  readonly handler: typeof tiersetUpdate;
245
245
  }, {
246
- readonly name: "openloyalty_tierset_update_tiers";
246
+ readonly name: "ol_tierset_update_tiers";
247
247
  readonly title: "Configure Tier Thresholds";
248
248
  readonly description: "Define tier thresholds for a tier set. PREREQUISITE: Call tierset_get first to obtain conditionId values. Each tier's conditions array uses conditionId from the parent tier set plus a threshold value.\n\nExample for a 3-tier program with points-based progression:\n- Bronze tier: conditions: [{ conditionId: \"xxx\", value: 400 }]\n- Silver tier: conditions: [{ conditionId: \"xxx\", value: 800 }]\n- Gold tier: conditions: [{ conditionId: \"xxx\", value: 1200 }]\n\nThe conditionId must match one from tierset_get response.";
249
249
  readonly readOnly: false;
@@ -287,7 +287,7 @@ export declare const tiersetToolDefinitions: readonly [{
287
287
  };
288
288
  readonly handler: typeof tiersetUpdateTiers;
289
289
  }, {
290
- readonly name: "openloyalty_tierset_get_tiers";
290
+ readonly name: "ol_tierset_get_tiers";
291
291
  readonly title: "Get Tier Configuration";
292
292
  readonly description: "Get all tiers in a tier set. Returns levelId values that can be used for campaign targeting. Includes each tier's name and condition thresholds.";
293
293
  readonly readOnly: true;