@open-loyalty/mcp-server 1.0.2 → 1.1.0

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 (75) hide show
  1. package/dist/client/http.d.ts +5 -0
  2. package/dist/client/http.js +52 -3
  3. package/dist/config.d.ts +16 -2
  4. package/dist/config.js +28 -10
  5. package/dist/http.js +135 -62
  6. package/dist/server.js +8 -5
  7. package/dist/tools/achievement.d.ts +14 -0
  8. package/dist/tools/achievement.js +22 -15
  9. package/dist/tools/admin.d.ts +12 -0
  10. package/dist/tools/admin.js +12 -0
  11. package/dist/tools/analytics.d.ts +18 -0
  12. package/dist/tools/analytics.js +28 -19
  13. package/dist/tools/apikey.d.ts +7 -0
  14. package/dist/tools/apikey.js +7 -0
  15. package/dist/tools/audit.d.ts +4 -0
  16. package/dist/tools/audit.js +4 -0
  17. package/dist/tools/badge.d.ts +8 -0
  18. package/dist/tools/badge.js +13 -9
  19. package/dist/tools/campaign.d.ts +41 -16
  20. package/dist/tools/campaign.js +38 -25
  21. package/dist/tools/export.d.ts +8 -0
  22. package/dist/tools/export.js +13 -8
  23. package/dist/tools/import.d.ts +6 -0
  24. package/dist/tools/import.js +10 -6
  25. package/dist/tools/index.d.ts +3 -11
  26. package/dist/tools/index.js +4 -470
  27. package/dist/tools/member.d.ts +21 -0
  28. package/dist/tools/member.js +56 -62
  29. package/dist/tools/points.d.ts +12 -0
  30. package/dist/tools/points.js +30 -29
  31. package/dist/tools/reward.d.ts +18 -0
  32. package/dist/tools/reward.js +56 -66
  33. package/dist/tools/role.d.ts +20 -1
  34. package/dist/tools/role.js +13 -0
  35. package/dist/tools/segment.d.ts +19 -0
  36. package/dist/tools/segment.js +29 -19
  37. package/dist/tools/store.d.ts +8 -0
  38. package/dist/tools/store.js +8 -0
  39. package/dist/tools/tierset.d.ts +12 -0
  40. package/dist/tools/tierset.js +19 -13
  41. package/dist/tools/transaction.d.ts +12 -4
  42. package/dist/tools/transaction.js +13 -9
  43. package/dist/tools/wallet-type.d.ts +4 -0
  44. package/dist/tools/wallet-type.js +7 -5
  45. package/dist/tools/webhook.d.ts +17 -4
  46. package/dist/tools/webhook.js +58 -15
  47. package/dist/types/schemas/achievement.d.ts +0 -297
  48. package/dist/types/schemas/achievement.js +0 -13
  49. package/dist/types/schemas/admin.d.ts +10 -97
  50. package/dist/types/schemas/admin.js +0 -38
  51. package/dist/types/schemas/badge.d.ts +0 -37
  52. package/dist/types/schemas/badge.js +0 -11
  53. package/dist/types/schemas/campaign.d.ts +0 -648
  54. package/dist/types/schemas/campaign.js +0 -18
  55. package/dist/types/schemas/export.d.ts +0 -17
  56. package/dist/types/schemas/export.js +0 -7
  57. package/dist/types/schemas/member.d.ts +37 -176
  58. package/dist/types/schemas/member.js +0 -27
  59. package/dist/types/schemas/points.d.ts +0 -63
  60. package/dist/types/schemas/points.js +0 -22
  61. package/dist/types/schemas/reward.d.ts +0 -73
  62. package/dist/types/schemas/reward.js +0 -25
  63. package/dist/types/schemas/role.d.ts +0 -100
  64. package/dist/types/schemas/role.js +0 -29
  65. package/dist/types/schemas/segment.d.ts +0 -58
  66. package/dist/types/schemas/segment.js +0 -17
  67. package/dist/types/schemas/tierset.d.ts +0 -176
  68. package/dist/types/schemas/tierset.js +0 -27
  69. package/dist/types/schemas/transaction.d.ts +23 -254
  70. package/dist/types/schemas/transaction.js +0 -7
  71. package/dist/types/schemas/webhook.d.ts +0 -58
  72. package/dist/types/schemas/webhook.js +0 -12
  73. package/dist/utils/payload.d.ts +12 -0
  74. package/dist/utils/payload.js +14 -0
  75. package/package.json +3 -1
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { apiGet } from "../client/http.js";
3
3
  import { formatApiError } from "../utils/errors.js";
4
- import { getConfig } from "../config.js";
4
+ import { getConfig, getStoreCode } from "../config.js";
5
5
  import axios from "axios";
6
6
  // Input Schemas
7
7
  export const ImportCreateInputSchema = {
@@ -44,7 +44,7 @@ export const ImportGetInputSchema = {
44
44
  // Handler functions
45
45
  export async function importCreate(input) {
46
46
  const config = getConfig();
47
- const storeCode = input.storeCode || config.defaultStoreCode;
47
+ const storeCode = getStoreCode(input.storeCode);
48
48
  const fileName = input.fileName || "import.csv";
49
49
  // Create form data for multipart upload
50
50
  const formData = new FormData();
@@ -64,8 +64,7 @@ export async function importCreate(input) {
64
64
  }
65
65
  }
66
66
  export async function importList(input) {
67
- const config = getConfig();
68
- const storeCode = input.storeCode || config.defaultStoreCode;
67
+ const storeCode = getStoreCode(input.storeCode);
69
68
  const params = new URLSearchParams();
70
69
  if (input.page)
71
70
  params.append("_page", String(input.page));
@@ -86,8 +85,7 @@ export async function importList(input) {
86
85
  }
87
86
  }
88
87
  export async function importGet(input) {
89
- const config = getConfig();
90
- const storeCode = input.storeCode || config.defaultStoreCode;
88
+ const storeCode = getStoreCode(input.storeCode);
91
89
  const params = new URLSearchParams();
92
90
  if (input.page)
93
91
  params.append("_page", String(input.page));
@@ -107,19 +105,25 @@ export async function importGet(input) {
107
105
  export const importToolDefinitions = [
108
106
  {
109
107
  name: "openloyalty_import_create",
108
+ title: "Create Bulk Import",
110
109
  description: "Create a new bulk import from CSV content. Returns importId for async tracking. Import types: member (member data), groupValue (group values), segmentMembers (segment membership), unitTransferAdding (add points), unitTransferSpending (spend points), transaction (transactions), campaignCode (campaign codes), rewardCoupon (reward coupons). CSV format required - provide plain text CSV content.",
110
+ readOnly: false,
111
111
  inputSchema: ImportCreateInputSchema,
112
112
  handler: importCreate,
113
113
  },
114
114
  {
115
115
  name: "openloyalty_import_list",
116
+ title: "List Imports",
116
117
  description: "List imports with optional filtering. Returns paginated list of imports with importId, type, uploadedDate, fileName, and status information.",
118
+ readOnly: true,
117
119
  inputSchema: ImportListInputSchema,
118
120
  handler: importList,
119
121
  },
120
122
  {
121
123
  name: "openloyalty_import_get",
124
+ title: "Get Import Details",
122
125
  description: "Get import details and individual item statuses. Returns paginated list of import items with their success/failure status and error messages.",
126
+ readOnly: true,
123
127
  inputSchema: ImportGetInputSchema,
124
128
  handler: importGet,
125
129
  },
@@ -1,22 +1,14 @@
1
1
  import { z } from "zod";
2
2
  type ZodShape = Record<string, z.ZodTypeAny>;
3
- export interface ToolAnnotations {
4
- title?: string;
5
- readOnlyHint?: boolean;
6
- destructiveHint?: boolean;
7
- idempotentHint?: boolean;
8
- openWorldHint?: boolean;
9
- }
10
3
  export interface ToolDefinition {
11
4
  name: string;
5
+ title: string;
12
6
  description: string;
7
+ readOnly: boolean;
8
+ destructive?: boolean;
13
9
  inputSchema: ZodShape;
14
10
  handler: (args: Record<string, unknown>) => Promise<unknown>;
15
11
  }
16
- export declare const toolMetadata: Record<string, {
17
- title: string;
18
- annotations: ToolAnnotations;
19
- }>;
20
12
  export declare function getAllTools(): ToolDefinition[];
21
13
  export declare function getToolHandler(name: string): ((args: Record<string, unknown>) => Promise<unknown>) | undefined;
22
14
  export {};
@@ -20,476 +20,10 @@ 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
+ // Collect all tool definitions
24
+ // Note: Single cast needed because tool handlers have specific input types
25
+ // (e.g., { memberId: string }) while ToolDefinition uses generic Record<string, unknown>.
26
+ // This is safe because Zod validates inputs at runtime before handlers are called.
493
27
  const allTools = [
494
28
  // Phase 1 tools
495
29
  ...walletTypeToolDefinitions,
@@ -200,7 +200,9 @@ export declare function memberRemoveManualTier(input: {
200
200
  }): Promise<void>;
201
201
  export declare const memberToolDefinitions: readonly [{
202
202
  readonly name: "openloyalty_member_create";
203
+ readonly title: "Register New Member";
203
204
  readonly description: "Register a new loyalty program member. Returns memberId for subsequent operations like points_add or member_get. Email must be unique within the store.";
205
+ readonly readOnly: false;
204
206
  readonly inputSchema: {
205
207
  storeCode: z.ZodOptional<z.ZodString>;
206
208
  email: z.ZodString;
@@ -236,7 +238,9 @@ export declare const memberToolDefinitions: readonly [{
236
238
  readonly handler: typeof memberCreate;
237
239
  }, {
238
240
  readonly name: "openloyalty_member_get";
241
+ readonly title: "Get Member Profile";
239
242
  readonly description: "Get member details including profile, points balance, and tier status. Use memberId from member_create or member_list.";
243
+ readonly readOnly: true;
240
244
  readonly inputSchema: {
241
245
  storeCode: z.ZodOptional<z.ZodString>;
242
246
  memberId: z.ZodString;
@@ -244,7 +248,9 @@ export declare const memberToolDefinitions: readonly [{
244
248
  readonly handler: typeof memberGet;
245
249
  }, {
246
250
  readonly name: "openloyalty_member_list";
251
+ readonly title: "Search Members";
247
252
  readonly description: string;
253
+ readonly readOnly: true;
248
254
  readonly inputSchema: {
249
255
  storeCode: z.ZodOptional<z.ZodString>;
250
256
  cursor: z.ZodOptional<z.ZodString>;
@@ -260,7 +266,9 @@ export declare const memberToolDefinitions: readonly [{
260
266
  readonly handler: typeof memberList;
261
267
  }, {
262
268
  readonly name: "openloyalty_member_update";
269
+ readonly title: "Update Member Profile";
263
270
  readonly description: "Update member profile fields. Cannot change email. Use member_get first to see current values.";
271
+ readonly readOnly: false;
264
272
  readonly inputSchema: {
265
273
  storeCode: z.ZodOptional<z.ZodString>;
266
274
  memberId: z.ZodString;
@@ -295,7 +303,9 @@ export declare const memberToolDefinitions: readonly [{
295
303
  readonly handler: typeof memberUpdate;
296
304
  }, {
297
305
  readonly name: "openloyalty_member_activate";
306
+ readonly title: "Activate Member Account";
298
307
  readonly description: "Activate a member account. Inactive members cannot earn or spend points.";
308
+ readonly readOnly: false;
299
309
  readonly inputSchema: {
300
310
  storeCode: z.ZodOptional<z.ZodString>;
301
311
  memberId: z.ZodString;
@@ -303,7 +313,9 @@ export declare const memberToolDefinitions: readonly [{
303
313
  readonly handler: typeof memberActivate;
304
314
  }, {
305
315
  readonly name: "openloyalty_member_deactivate";
316
+ readonly title: "Deactivate Member Account";
306
317
  readonly description: "Deactivate a member account. Deactivated members cannot earn or spend points but retain their balance.";
318
+ readonly readOnly: false;
307
319
  readonly inputSchema: {
308
320
  storeCode: z.ZodOptional<z.ZodString>;
309
321
  memberId: z.ZodString;
@@ -311,7 +323,10 @@ export declare const memberToolDefinitions: readonly [{
311
323
  readonly handler: typeof memberDeactivate;
312
324
  }, {
313
325
  readonly name: "openloyalty_member_delete";
326
+ readonly title: "Delete Member (Permanent)";
314
327
  readonly description: "Permanently removes member and all associated data. Cannot be undone. Use for GDPR compliance or member requests.";
328
+ readonly readOnly: false;
329
+ readonly destructive: true;
315
330
  readonly inputSchema: {
316
331
  storeCode: z.ZodOptional<z.ZodString>;
317
332
  memberId: z.ZodString;
@@ -319,7 +334,9 @@ export declare const memberToolDefinitions: readonly [{
319
334
  readonly handler: typeof memberDelete;
320
335
  }, {
321
336
  readonly name: "openloyalty_member_get_tier_progress";
337
+ readonly title: "Check Tier Progress";
322
338
  readonly description: "Get member tier progression status showing current tier and progress to next. Returns currentValue, requiredValue, and progressPercent.";
339
+ readonly readOnly: true;
323
340
  readonly inputSchema: {
324
341
  storeCode: z.ZodOptional<z.ZodString>;
325
342
  memberId: z.ZodString;
@@ -327,7 +344,9 @@ export declare const memberToolDefinitions: readonly [{
327
344
  readonly handler: typeof memberGetTierProgress;
328
345
  }, {
329
346
  readonly name: "openloyalty_member_assign_tier";
347
+ readonly title: "Assign Tier to Member";
330
348
  readonly description: "Manually assign a tier level to a member, overriding automatic tier calculation. Use tierset_get_tiers to find available levelId values.";
349
+ readonly readOnly: false;
331
350
  readonly inputSchema: {
332
351
  storeCode: z.ZodOptional<z.ZodString>;
333
352
  memberId: z.ZodString;
@@ -336,7 +355,9 @@ export declare const memberToolDefinitions: readonly [{
336
355
  readonly handler: typeof memberAssignTier;
337
356
  }, {
338
357
  readonly name: "openloyalty_member_remove_manual_tier";
358
+ readonly title: "Remove Manual Tier Assignment";
339
359
  readonly description: "Remove manually assigned tier from member, restoring automatic tier calculation based on conditions.";
360
+ readonly readOnly: false;
340
361
  readonly inputSchema: {
341
362
  storeCode: z.ZodOptional<z.ZodString>;
342
363
  memberId: z.ZodString;