@open-loyalty/mcp-server 1.0.3 → 1.3.1

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 (142) 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.d.ts +5 -0
  5. package/dist/client/http.js +62 -3
  6. package/dist/config.d.ts +6 -5
  7. package/dist/config.js +15 -11
  8. package/dist/http.js +170 -65
  9. package/dist/instructions.d.ts +5 -0
  10. package/dist/instructions.js +420 -0
  11. package/dist/prompts/fan-engagement-setup.d.ts +107 -0
  12. package/dist/prompts/fan-engagement-setup.js +492 -0
  13. package/dist/server.d.ts +1 -1
  14. package/dist/server.js +68 -278
  15. package/dist/tools/achievement/handlers.d.ts +117 -0
  16. package/dist/tools/achievement/handlers.js +161 -0
  17. package/dist/tools/achievement/index.d.ts +479 -0
  18. package/dist/tools/achievement/index.js +74 -0
  19. package/dist/tools/achievement/schemas.d.ts +433 -0
  20. package/dist/tools/achievement/schemas.js +142 -0
  21. package/dist/tools/achievement.d.ts +155 -121
  22. package/dist/tools/achievement.js +82 -39
  23. package/dist/tools/admin.d.ts +18 -6
  24. package/dist/tools/admin.js +24 -12
  25. package/dist/tools/analytics.d.ts +29 -11
  26. package/dist/tools/analytics.js +58 -48
  27. package/dist/tools/apikey.d.ts +10 -3
  28. package/dist/tools/apikey.js +13 -6
  29. package/dist/tools/audit.d.ts +6 -2
  30. package/dist/tools/audit.js +8 -4
  31. package/dist/tools/badge.d.ts +14 -6
  32. package/dist/tools/badge.js +36 -27
  33. package/dist/tools/campaign/handlers.d.ts +42 -0
  34. package/dist/tools/campaign/handlers.js +223 -0
  35. package/dist/tools/campaign/index.d.ts +783 -0
  36. package/dist/tools/campaign/index.js +112 -0
  37. package/dist/tools/campaign/member-handlers.d.ts +60 -0
  38. package/dist/tools/campaign/member-handlers.js +159 -0
  39. package/dist/tools/campaign/schemas.d.ts +704 -0
  40. package/dist/tools/campaign/schemas.js +259 -0
  41. package/dist/tools/campaign/types.d.ts +161 -0
  42. package/dist/tools/campaign/types.js +2 -0
  43. package/dist/tools/campaign.d.ts +41 -16
  44. package/dist/tools/campaign.js +38 -25
  45. package/dist/tools/custom-event.d.ts +315 -0
  46. package/dist/tools/custom-event.js +270 -0
  47. package/dist/tools/export.d.ts +12 -4
  48. package/dist/tools/export.js +25 -20
  49. package/dist/tools/import.d.ts +9 -3
  50. package/dist/tools/import.js +33 -21
  51. package/dist/tools/index.d.ts +3 -11
  52. package/dist/tools/index.js +17 -475
  53. package/dist/tools/member/handlers.d.ts +111 -0
  54. package/dist/tools/member/handlers.js +206 -0
  55. package/dist/tools/member/index.d.ts +169 -0
  56. package/dist/tools/member/index.js +92 -0
  57. package/dist/tools/member/schemas.d.ts +89 -0
  58. package/dist/tools/member/schemas.js +65 -0
  59. package/dist/tools/member.d.ts +21 -0
  60. package/dist/tools/member.js +56 -62
  61. package/dist/tools/points.d.ts +19 -6
  62. package/dist/tools/points.js +51 -49
  63. package/dist/tools/referral/handlers.d.ts +47 -0
  64. package/dist/tools/referral/handlers.js +115 -0
  65. package/dist/tools/referral/index.d.ts +44 -0
  66. package/dist/tools/referral/index.js +44 -0
  67. package/dist/tools/referral/schemas.d.ts +34 -0
  68. package/dist/tools/referral/schemas.js +52 -0
  69. package/dist/tools/reward/handlers.d.ts +110 -0
  70. package/dist/tools/reward/handlers.js +289 -0
  71. package/dist/tools/reward/index.d.ts +177 -0
  72. package/dist/tools/reward/index.js +90 -0
  73. package/dist/tools/reward/schemas.d.ts +116 -0
  74. package/dist/tools/reward/schemas.js +91 -0
  75. package/dist/tools/reward.d.ts +18 -0
  76. package/dist/tools/reward.js +56 -66
  77. package/dist/tools/role.d.ts +26 -7
  78. package/dist/tools/role.js +25 -12
  79. package/dist/tools/segment/handlers.d.ts +87 -0
  80. package/dist/tools/segment/handlers.js +174 -0
  81. package/dist/tools/segment/index.d.ts +395 -0
  82. package/dist/tools/segment/index.js +87 -0
  83. package/dist/tools/segment/schemas.d.ts +337 -0
  84. package/dist/tools/segment/schemas.js +79 -0
  85. package/dist/tools/segment.d.ts +29 -10
  86. package/dist/tools/segment.js +84 -50
  87. package/dist/tools/store.d.ts +12 -4
  88. package/dist/tools/store.js +16 -8
  89. package/dist/tools/tierset.d.ts +19 -7
  90. package/dist/tools/tierset.js +44 -35
  91. package/dist/tools/transaction.d.ts +16 -8
  92. package/dist/tools/transaction.js +25 -21
  93. package/dist/tools/wallet-type.d.ts +7 -3
  94. package/dist/tools/wallet-type.js +14 -12
  95. package/dist/tools/webhook.d.ts +23 -10
  96. package/dist/tools/webhook.js +135 -33
  97. package/dist/types/schemas/achievement.d.ts +12 -309
  98. package/dist/types/schemas/achievement.js +0 -13
  99. package/dist/types/schemas/admin.d.ts +10 -97
  100. package/dist/types/schemas/admin.js +0 -38
  101. package/dist/types/schemas/badge.d.ts +0 -37
  102. package/dist/types/schemas/badge.js +0 -11
  103. package/dist/types/schemas/campaign.d.ts +64 -832
  104. package/dist/types/schemas/campaign.js +2 -25
  105. package/dist/types/schemas/common.d.ts +5 -0
  106. package/dist/types/schemas/common.js +5 -0
  107. package/dist/types/schemas/export.d.ts +0 -17
  108. package/dist/types/schemas/export.js +0 -7
  109. package/dist/types/schemas/member.d.ts +37 -176
  110. package/dist/types/schemas/member.js +0 -27
  111. package/dist/types/schemas/points.d.ts +0 -63
  112. package/dist/types/schemas/points.js +0 -22
  113. package/dist/types/schemas/reward.d.ts +71 -68
  114. package/dist/types/schemas/reward.js +8 -28
  115. package/dist/types/schemas/role.d.ts +0 -100
  116. package/dist/types/schemas/role.js +0 -29
  117. package/dist/types/schemas/segment.d.ts +0 -58
  118. package/dist/types/schemas/segment.js +0 -17
  119. package/dist/types/schemas/tierset.d.ts +0 -176
  120. package/dist/types/schemas/tierset.js +0 -27
  121. package/dist/types/schemas/transaction.d.ts +23 -254
  122. package/dist/types/schemas/transaction.js +0 -7
  123. package/dist/types/schemas/wallet-type.d.ts +8 -8
  124. package/dist/types/schemas/wallet-type.js +1 -1
  125. package/dist/types/schemas/webhook.d.ts +0 -58
  126. package/dist/types/schemas/webhook.js +0 -12
  127. package/dist/utils/errors.js +30 -3
  128. package/dist/utils/payload.d.ts +12 -0
  129. package/dist/utils/payload.js +14 -0
  130. package/dist/workflows/app-login-streak.d.ts +39 -0
  131. package/dist/workflows/app-login-streak.js +298 -0
  132. package/dist/workflows/early-arrival.d.ts +33 -0
  133. package/dist/workflows/early-arrival.js +148 -0
  134. package/dist/workflows/index.d.ts +101 -0
  135. package/dist/workflows/index.js +208 -0
  136. package/dist/workflows/match-attendance.d.ts +45 -0
  137. package/dist/workflows/match-attendance.js +308 -0
  138. package/dist/workflows/sportsbar-visit.d.ts +41 -0
  139. package/dist/workflows/sportsbar-visit.js +284 -0
  140. package/dist/workflows/vod-watching.d.ts +43 -0
  141. package/dist/workflows/vod-watching.js +326 -0
  142. package/package.json +10 -2
@@ -1,13 +1,13 @@
1
1
  import { walletTypeToolDefinitions } from "./wallet-type.js";
2
2
  import { tiersetToolDefinitions } from "./tierset.js";
3
- import { memberToolDefinitions } from "./member.js";
3
+ import { memberToolDefinitions } from "./member/index.js";
4
4
  import { pointsToolDefinitions } from "./points.js";
5
- import { rewardToolDefinitions } from "./reward.js";
5
+ import { rewardToolDefinitions } from "./reward/index.js";
6
6
  import { transactionToolDefinitions } from "./transaction.js";
7
7
  // Phase 2 tools
8
- import { campaignToolDefinitions } from "./campaign.js";
9
- import { segmentToolDefinitions } from "./segment.js";
10
- import { achievementToolDefinitions } from "./achievement.js";
8
+ import { campaignToolDefinitions } from "./campaign/index.js";
9
+ import { segmentToolDefinitions } from "./segment/index.js";
10
+ import { achievementToolDefinitions } from "./achievement/index.js";
11
11
  import { badgeToolDefinitions } from "./badge.js";
12
12
  // Phase 3 tools
13
13
  import { analyticsToolDefinitions } from "./analytics.js";
@@ -20,476 +20,14 @@ import { storeToolDefinitions } from "./store.js";
20
20
  import { webhookToolDefinitions } from "./webhook.js";
21
21
  import { importToolDefinitions } from "./import.js";
22
22
  import { exportToolDefinitions } from "./export.js";
23
- // User-friendly titles and behavior hints for each tool
24
- export const toolMetadata = {
25
- // Wallet Types - read-only lookups
26
- openloyalty_wallet_type_list: {
27
- title: "List Point Currencies",
28
- annotations: { readOnlyHint: true, openWorldHint: true }
29
- },
30
- openloyalty_wallet_type_get: {
31
- title: "Get Point Currency Details",
32
- annotations: { readOnlyHint: true, openWorldHint: true }
33
- },
34
- // Tier Sets
35
- openloyalty_tierset_list: {
36
- title: "List Loyalty Programs",
37
- annotations: { readOnlyHint: true, openWorldHint: true }
38
- },
39
- openloyalty_tierset_create: {
40
- title: "Create Loyalty Program",
41
- annotations: { readOnlyHint: false, openWorldHint: true }
42
- },
43
- openloyalty_tierset_get: {
44
- title: "Get Loyalty Program Details",
45
- annotations: { readOnlyHint: true, openWorldHint: true }
46
- },
47
- openloyalty_tierset_update: {
48
- title: "Update Loyalty Program",
49
- annotations: { readOnlyHint: false, openWorldHint: true }
50
- },
51
- openloyalty_tierset_update_tiers: {
52
- title: "Configure Tier Thresholds",
53
- annotations: { readOnlyHint: false, openWorldHint: true }
54
- },
55
- openloyalty_tierset_get_tiers: {
56
- title: "Get Tier Configuration",
57
- annotations: { readOnlyHint: true, openWorldHint: true }
58
- },
59
- // Members
60
- openloyalty_member_create: {
61
- title: "Register New Member",
62
- annotations: { readOnlyHint: false, openWorldHint: true }
63
- },
64
- openloyalty_member_get: {
65
- title: "Get Member Profile",
66
- annotations: { readOnlyHint: true, openWorldHint: true }
67
- },
68
- openloyalty_member_list: {
69
- title: "Search Members",
70
- annotations: { readOnlyHint: true, openWorldHint: true }
71
- },
72
- openloyalty_member_update: {
73
- title: "Update Member Profile",
74
- annotations: { readOnlyHint: false, openWorldHint: true }
75
- },
76
- openloyalty_member_activate: {
77
- title: "Activate Member Account",
78
- annotations: { readOnlyHint: false, openWorldHint: true }
79
- },
80
- openloyalty_member_deactivate: {
81
- title: "Deactivate Member Account",
82
- annotations: { readOnlyHint: false, openWorldHint: true }
83
- },
84
- openloyalty_member_delete: {
85
- title: "Delete Member (Permanent)",
86
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
87
- },
88
- openloyalty_member_get_tier_progress: {
89
- title: "Check Tier Progress",
90
- annotations: { readOnlyHint: true, openWorldHint: true }
91
- },
92
- openloyalty_member_assign_tier: {
93
- title: "Assign Tier to Member",
94
- annotations: { readOnlyHint: false, openWorldHint: true }
95
- },
96
- openloyalty_member_remove_manual_tier: {
97
- title: "Remove Manual Tier Assignment",
98
- annotations: { readOnlyHint: false, openWorldHint: true }
99
- },
100
- // Points
101
- openloyalty_points_add: {
102
- title: "Add Points to Member",
103
- annotations: { readOnlyHint: false, openWorldHint: true }
104
- },
105
- openloyalty_points_spend: {
106
- title: "Spend Member Points",
107
- annotations: { readOnlyHint: false, openWorldHint: true }
108
- },
109
- openloyalty_points_transfer: {
110
- title: "Transfer Points Between Members",
111
- annotations: { readOnlyHint: false, openWorldHint: true }
112
- },
113
- openloyalty_points_get_balance: {
114
- title: "Check Points Balance",
115
- annotations: { readOnlyHint: true, openWorldHint: true }
116
- },
117
- openloyalty_points_get_history: {
118
- title: "View Points History",
119
- annotations: { readOnlyHint: true, openWorldHint: true }
120
- },
121
- openloyalty_points_get_histogram: {
122
- title: "View Points Trends",
123
- annotations: { readOnlyHint: true, openWorldHint: true }
124
- },
125
- // Rewards
126
- openloyalty_reward_list: {
127
- title: "Browse Rewards",
128
- annotations: { readOnlyHint: true, openWorldHint: true }
129
- },
130
- openloyalty_reward_create: {
131
- title: "Create New Reward",
132
- annotations: { readOnlyHint: false, openWorldHint: true }
133
- },
134
- openloyalty_reward_get: {
135
- title: "Get Reward Details",
136
- annotations: { readOnlyHint: true, openWorldHint: true }
137
- },
138
- openloyalty_reward_update: {
139
- title: "Update Reward",
140
- annotations: { readOnlyHint: false, openWorldHint: true }
141
- },
142
- openloyalty_reward_activate: {
143
- title: "Activate Reward",
144
- annotations: { readOnlyHint: false, openWorldHint: true }
145
- },
146
- openloyalty_reward_deactivate: {
147
- title: "Deactivate Reward",
148
- annotations: { readOnlyHint: false, openWorldHint: true }
149
- },
150
- openloyalty_reward_buy: {
151
- title: "Redeem Reward for Member",
152
- annotations: { readOnlyHint: false, openWorldHint: true }
153
- },
154
- openloyalty_reward_redeem: {
155
- title: "Use Coupon Code",
156
- annotations: { readOnlyHint: false, openWorldHint: true }
157
- },
158
- openloyalty_reward_category_list: {
159
- title: "List Reward Categories",
160
- annotations: { readOnlyHint: true, openWorldHint: true }
161
- },
162
- // Transactions
163
- openloyalty_transaction_create: {
164
- title: "Record Purchase",
165
- annotations: { readOnlyHint: false, openWorldHint: true }
166
- },
167
- openloyalty_transaction_get: {
168
- title: "Get Transaction Details",
169
- annotations: { readOnlyHint: true, openWorldHint: true }
170
- },
171
- openloyalty_transaction_list: {
172
- title: "Search Transactions",
173
- annotations: { readOnlyHint: true, openWorldHint: true }
174
- },
175
- openloyalty_transaction_assign_member: {
176
- title: "Link Transaction to Member",
177
- annotations: { readOnlyHint: false, openWorldHint: true }
178
- },
179
- // Phase 2: Campaigns
180
- openloyalty_campaign_list: {
181
- title: "List Campaigns",
182
- annotations: { readOnlyHint: true, openWorldHint: true }
183
- },
184
- openloyalty_campaign_create: {
185
- title: "Create Campaign",
186
- annotations: { readOnlyHint: false, openWorldHint: true }
187
- },
188
- openloyalty_campaign_get: {
189
- title: "Get Campaign Details",
190
- annotations: { readOnlyHint: true, openWorldHint: true }
191
- },
192
- openloyalty_campaign_update: {
193
- title: "Update Campaign",
194
- annotations: { readOnlyHint: false, openWorldHint: true }
195
- },
196
- openloyalty_campaign_patch: {
197
- title: "Patch Campaign",
198
- annotations: { readOnlyHint: false, openWorldHint: true }
199
- },
200
- openloyalty_campaign_delete: {
201
- title: "Delete Campaign (Permanent)",
202
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
203
- },
204
- openloyalty_campaign_simulate: {
205
- title: "Simulate Campaign Effects",
206
- annotations: { readOnlyHint: true, openWorldHint: true }
207
- },
208
- openloyalty_campaign_generate_codes: {
209
- title: "Generate Campaign Codes",
210
- annotations: { readOnlyHint: false, openWorldHint: true }
211
- },
212
- openloyalty_campaign_list_codes: {
213
- title: "List Campaign Codes",
214
- annotations: { readOnlyHint: true, openWorldHint: true }
215
- },
216
- openloyalty_campaign_get_available: {
217
- title: "Get Available Campaigns for Member",
218
- annotations: { readOnlyHint: true, openWorldHint: true }
219
- },
220
- openloyalty_campaign_get_visible: {
221
- title: "Get Visible Campaigns for Member",
222
- annotations: { readOnlyHint: true, openWorldHint: true }
223
- },
224
- openloyalty_campaign_get_leaderboard: {
225
- title: "Get Campaign Leaderboard",
226
- annotations: { readOnlyHint: true, openWorldHint: true }
227
- },
228
- // Phase 2: Segments
229
- openloyalty_segment_list: {
230
- title: "List Segments",
231
- annotations: { readOnlyHint: true, openWorldHint: true }
232
- },
233
- openloyalty_segment_create: {
234
- title: "Create Segment",
235
- annotations: { readOnlyHint: false, openWorldHint: true }
236
- },
237
- openloyalty_segment_get: {
238
- title: "Get Segment Details",
239
- annotations: { readOnlyHint: true, openWorldHint: true }
240
- },
241
- openloyalty_segment_update: {
242
- title: "Update Segment",
243
- annotations: { readOnlyHint: false, openWorldHint: true }
244
- },
245
- openloyalty_segment_delete: {
246
- title: "Delete Segment (Permanent)",
247
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
248
- },
249
- openloyalty_segment_get_members: {
250
- title: "Get Segment Members",
251
- annotations: { readOnlyHint: true, openWorldHint: true }
252
- },
253
- openloyalty_segment_activate: {
254
- title: "Activate Segment",
255
- annotations: { readOnlyHint: false, openWorldHint: true }
256
- },
257
- openloyalty_segment_deactivate: {
258
- title: "Deactivate Segment",
259
- annotations: { readOnlyHint: false, openWorldHint: true }
260
- },
261
- openloyalty_segment_get_resources: {
262
- title: "Get Segment Resources",
263
- annotations: { readOnlyHint: true, openWorldHint: true }
264
- },
265
- // Phase 2: Achievements
266
- openloyalty_achievement_list: {
267
- title: "List Achievements",
268
- annotations: { readOnlyHint: true, openWorldHint: true }
269
- },
270
- openloyalty_achievement_create: {
271
- title: "Create Achievement",
272
- annotations: { readOnlyHint: false, openWorldHint: true }
273
- },
274
- openloyalty_achievement_get: {
275
- title: "Get Achievement Details",
276
- annotations: { readOnlyHint: true, openWorldHint: true }
277
- },
278
- openloyalty_achievement_update: {
279
- title: "Update Achievement",
280
- annotations: { readOnlyHint: false, openWorldHint: true }
281
- },
282
- openloyalty_achievement_patch: {
283
- title: "Patch Achievement",
284
- annotations: { readOnlyHint: false, openWorldHint: true }
285
- },
286
- openloyalty_achievement_get_member_progress: {
287
- title: "Get Member Achievement Progress",
288
- annotations: { readOnlyHint: true, openWorldHint: true }
289
- },
290
- openloyalty_achievement_list_member_achievements: {
291
- title: "List Member Achievements",
292
- annotations: { readOnlyHint: true, openWorldHint: true }
293
- },
294
- // Phase 2: Badges
295
- openloyalty_badge_list: {
296
- title: "List Badges",
297
- annotations: { readOnlyHint: true, openWorldHint: true }
298
- },
299
- openloyalty_badge_get: {
300
- title: "Get Badge Details",
301
- annotations: { readOnlyHint: true, openWorldHint: true }
302
- },
303
- openloyalty_badge_update: {
304
- title: "Update Badge",
305
- annotations: { readOnlyHint: false, openWorldHint: true }
306
- },
307
- openloyalty_badge_get_member_badges: {
308
- title: "Get Member Badges",
309
- annotations: { readOnlyHint: true, openWorldHint: true }
310
- },
311
- // Phase 3: Analytics
312
- openloyalty_analytics_tiers: {
313
- title: "Get Tier Analytics",
314
- annotations: { readOnlyHint: true, openWorldHint: true }
315
- },
316
- openloyalty_analytics_members: {
317
- title: "Get Member Analytics",
318
- annotations: { readOnlyHint: true, openWorldHint: true }
319
- },
320
- openloyalty_analytics_points: {
321
- title: "Get Points Analytics",
322
- annotations: { readOnlyHint: true, openWorldHint: true }
323
- },
324
- openloyalty_analytics_transactions: {
325
- title: "Get Transaction Analytics",
326
- annotations: { readOnlyHint: true, openWorldHint: true }
327
- },
328
- openloyalty_analytics_referrals: {
329
- title: "Get Referral Analytics",
330
- annotations: { readOnlyHint: true, openWorldHint: true }
331
- },
332
- openloyalty_analytics_campaigns: {
333
- title: "Get Campaign Analytics",
334
- annotations: { readOnlyHint: true, openWorldHint: true }
335
- },
336
- openloyalty_analytics_dashboard: {
337
- title: "Get Dashboard Overview",
338
- annotations: { readOnlyHint: true, openWorldHint: true }
339
- },
340
- openloyalty_analytics_units: {
341
- title: "Get Units Overview",
342
- annotations: { readOnlyHint: true, openWorldHint: true }
343
- },
344
- openloyalty_analytics_campaign_detail: {
345
- title: "Get Campaign Detail Analytics",
346
- annotations: { readOnlyHint: true, openWorldHint: true }
347
- },
348
- // Phase 3: Admin Users
349
- openloyalty_admin_list: {
350
- title: "List Admin Users",
351
- annotations: { readOnlyHint: true, openWorldHint: true }
352
- },
353
- openloyalty_admin_create: {
354
- title: "Create Admin User",
355
- annotations: { readOnlyHint: false, openWorldHint: true }
356
- },
357
- openloyalty_admin_get: {
358
- title: "Get Admin User Details",
359
- annotations: { readOnlyHint: true, openWorldHint: true }
360
- },
361
- openloyalty_admin_update: {
362
- title: "Update Admin User",
363
- annotations: { readOnlyHint: false, openWorldHint: true }
364
- },
365
- openloyalty_admin_change_password: {
366
- title: "Change Admin Password",
367
- annotations: { readOnlyHint: false, openWorldHint: true }
368
- },
369
- openloyalty_admin_get_permissions: {
370
- title: "Get Admin Permissions",
371
- annotations: { readOnlyHint: true, openWorldHint: true }
372
- },
373
- // Phase 3: Roles/ACL
374
- openloyalty_role_list: {
375
- title: "List Roles",
376
- annotations: { readOnlyHint: true, openWorldHint: true }
377
- },
378
- openloyalty_role_create: {
379
- title: "Create Role",
380
- annotations: { readOnlyHint: false, openWorldHint: true }
381
- },
382
- openloyalty_role_get: {
383
- title: "Get Role Details",
384
- annotations: { readOnlyHint: true, openWorldHint: true }
385
- },
386
- openloyalty_role_update: {
387
- title: "Update Role",
388
- annotations: { readOnlyHint: false, openWorldHint: true }
389
- },
390
- openloyalty_role_delete: {
391
- title: "Delete Role (Permanent)",
392
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
393
- },
394
- openloyalty_acl_get_resources: {
395
- title: "Get ACL Resources",
396
- annotations: { readOnlyHint: true, openWorldHint: true }
397
- },
398
- // Phase 3: API Keys
399
- openloyalty_apikey_create: {
400
- title: "Create API Key",
401
- annotations: { readOnlyHint: false, openWorldHint: true }
402
- },
403
- openloyalty_apikey_list: {
404
- title: "List API Keys",
405
- annotations: { readOnlyHint: true, openWorldHint: true }
406
- },
407
- openloyalty_apikey_delete: {
408
- title: "Delete API Key (Permanent)",
409
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
410
- },
411
- // Phase 3: Audit Logs
412
- openloyalty_audit_list: {
413
- title: "List Audit Logs",
414
- annotations: { readOnlyHint: true, openWorldHint: true }
415
- },
416
- openloyalty_audit_export: {
417
- title: "Export Audit Logs",
418
- annotations: { readOnlyHint: false, openWorldHint: true }
419
- },
420
- // Phase 3: Stores
421
- openloyalty_store_list: {
422
- title: "List Stores",
423
- annotations: { readOnlyHint: true, openWorldHint: true }
424
- },
425
- openloyalty_store_create: {
426
- title: "Create Store",
427
- annotations: { readOnlyHint: false, openWorldHint: true }
428
- },
429
- openloyalty_store_get: {
430
- title: "Get Store Details",
431
- annotations: { readOnlyHint: true, openWorldHint: true }
432
- },
433
- openloyalty_store_update: {
434
- title: "Update Store",
435
- annotations: { readOnlyHint: false, openWorldHint: true }
436
- },
437
- // Phase 4: Webhooks
438
- openloyalty_webhook_list: {
439
- title: "List Webhook Subscriptions",
440
- annotations: { readOnlyHint: true, openWorldHint: true }
441
- },
442
- openloyalty_webhook_create: {
443
- title: "Create Webhook Subscription",
444
- annotations: { readOnlyHint: false, openWorldHint: true }
445
- },
446
- openloyalty_webhook_get: {
447
- title: "Get Webhook Subscription Details",
448
- annotations: { readOnlyHint: true, openWorldHint: true }
449
- },
450
- openloyalty_webhook_update: {
451
- title: "Update Webhook Subscription",
452
- annotations: { readOnlyHint: false, openWorldHint: true }
453
- },
454
- openloyalty_webhook_delete: {
455
- title: "Delete Webhook Subscription (Permanent)",
456
- annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true }
457
- },
458
- openloyalty_webhook_events: {
459
- title: "List Available Webhook Events",
460
- annotations: { readOnlyHint: true, openWorldHint: true }
461
- },
462
- // Phase 4: Import
463
- openloyalty_import_create: {
464
- title: "Create Bulk Import",
465
- annotations: { readOnlyHint: false, openWorldHint: true }
466
- },
467
- openloyalty_import_list: {
468
- title: "List Imports",
469
- annotations: { readOnlyHint: true, openWorldHint: true }
470
- },
471
- openloyalty_import_get: {
472
- title: "Get Import Details",
473
- annotations: { readOnlyHint: true, openWorldHint: true }
474
- },
475
- // Phase 4: Export
476
- openloyalty_export_create: {
477
- title: "Create Data Export",
478
- annotations: { readOnlyHint: false, openWorldHint: true }
479
- },
480
- openloyalty_export_list: {
481
- title: "List Exports",
482
- annotations: { readOnlyHint: true, openWorldHint: true }
483
- },
484
- openloyalty_export_get: {
485
- title: "Get Export Details",
486
- annotations: { readOnlyHint: true, openWorldHint: true }
487
- },
488
- openloyalty_export_download: {
489
- title: "Download Export File",
490
- annotations: { readOnlyHint: true, openWorldHint: true }
491
- },
492
- };
23
+ // Custom event tools (needed for custom_event trigger in campaigns/achievements)
24
+ import { customEventToolDefinitions } from "./custom-event.js";
25
+ // Referral tools (needed for referral tracking between members)
26
+ import { referralToolDefinitions } from "./referral/index.js";
27
+ // Collect all tool definitions
28
+ // Note: Single cast needed because tool handlers have specific input types
29
+ // (e.g., { memberId: string }) while ToolDefinition uses generic Record<string, unknown>.
30
+ // This is safe because Zod validates inputs at runtime before handlers are called.
493
31
  const allTools = [
494
32
  // Phase 1 tools
495
33
  ...walletTypeToolDefinitions,
@@ -514,6 +52,10 @@ const allTools = [
514
52
  ...webhookToolDefinitions,
515
53
  ...importToolDefinitions,
516
54
  ...exportToolDefinitions,
55
+ // Custom event tools
56
+ ...customEventToolDefinitions,
57
+ // Referral tools
58
+ ...referralToolDefinitions,
517
59
  ];
518
60
  const toolHandlers = new Map();
519
61
  for (const tool of allTools) {
@@ -0,0 +1,111 @@
1
+ import { Member } from "../../types/schemas/member.js";
2
+ export declare function memberCreate(input: {
3
+ storeCode?: string;
4
+ email: string;
5
+ firstName?: string;
6
+ lastName?: string;
7
+ phone?: string;
8
+ birthDate?: string;
9
+ gender?: string;
10
+ loyaltyCardNumber?: string;
11
+ agreement1?: boolean;
12
+ agreement2?: boolean;
13
+ agreement3?: boolean;
14
+ address?: {
15
+ street?: string;
16
+ city?: string;
17
+ postal?: string;
18
+ country?: string;
19
+ province?: string;
20
+ };
21
+ }): Promise<{
22
+ memberId: string;
23
+ loyaltyCardNumber: string;
24
+ email: string;
25
+ }>;
26
+ export declare function memberGet(input: {
27
+ storeCode?: string;
28
+ memberId: string;
29
+ }): Promise<Member>;
30
+ export declare function memberList(input: {
31
+ storeCode?: string;
32
+ cursor?: string;
33
+ page?: number;
34
+ perPage?: number;
35
+ email?: string;
36
+ firstName?: string;
37
+ lastName?: string;
38
+ phone?: string;
39
+ loyaltyCardNumber?: string;
40
+ active?: boolean;
41
+ }): Promise<{
42
+ members: Array<{
43
+ memberId: string;
44
+ email: string;
45
+ firstName?: string;
46
+ lastName?: string;
47
+ loyaltyCardNumber?: string;
48
+ active: boolean;
49
+ }>;
50
+ total: {
51
+ all?: number;
52
+ filtered?: number;
53
+ };
54
+ cursor?: string;
55
+ }>;
56
+ export declare function memberUpdate(input: {
57
+ storeCode?: string;
58
+ memberId: string;
59
+ firstName?: string;
60
+ lastName?: string;
61
+ phone?: string;
62
+ birthDate?: string;
63
+ gender?: string;
64
+ address?: {
65
+ street?: string;
66
+ city?: string;
67
+ postal?: string;
68
+ country?: string;
69
+ province?: string;
70
+ };
71
+ agreement1?: boolean;
72
+ agreement2?: boolean;
73
+ agreement3?: boolean;
74
+ }): Promise<void>;
75
+ export declare function memberActivate(input: {
76
+ storeCode?: string;
77
+ memberId: string;
78
+ }): Promise<void>;
79
+ export declare function memberDeactivate(input: {
80
+ storeCode?: string;
81
+ memberId: string;
82
+ }): Promise<void>;
83
+ export declare function memberDelete(input: {
84
+ storeCode?: string;
85
+ memberId: string;
86
+ }): Promise<void>;
87
+ export declare function memberGetTierProgress(input: {
88
+ storeCode?: string;
89
+ memberId: string;
90
+ }): Promise<{
91
+ currentTier?: {
92
+ levelId: string;
93
+ name: string;
94
+ };
95
+ nextTier?: {
96
+ levelId: string;
97
+ name: string;
98
+ };
99
+ currentValue: number;
100
+ requiredValue?: number;
101
+ progressPercent: number;
102
+ }>;
103
+ export declare function memberAssignTier(input: {
104
+ storeCode?: string;
105
+ memberId: string;
106
+ levelId: string;
107
+ }): Promise<void>;
108
+ export declare function memberRemoveManualTier(input: {
109
+ storeCode?: string;
110
+ memberId: string;
111
+ }): Promise<void>;