@gala-chain/launchpad-mcp-server 1.23.0 → 1.24.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 (102) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/DRY_REFACTORING_GUIDE.md +272 -0
  3. package/README.md +34 -6
  4. package/dist/constants/mcpToolNames.d.ts +6 -2
  5. package/dist/constants/mcpToolNames.d.ts.map +1 -1
  6. package/dist/constants/mcpToolNames.js +4 -2
  7. package/dist/constants/mcpToolNames.js.map +1 -1
  8. package/dist/generated/version.d.ts +1 -1
  9. package/dist/generated/version.js +1 -1
  10. package/dist/prompts/analysis.d.ts.map +1 -1
  11. package/dist/prompts/analysis.js +14 -63
  12. package/dist/prompts/analysis.js.map +1 -1
  13. package/dist/prompts/balances.d.ts.map +1 -1
  14. package/dist/prompts/balances.js +46 -70
  15. package/dist/prompts/balances.js.map +1 -1
  16. package/dist/prompts/creation-utils.d.ts.map +1 -1
  17. package/dist/prompts/creation-utils.js +27 -50
  18. package/dist/prompts/creation-utils.js.map +1 -1
  19. package/dist/prompts/explore-dex-pools.d.ts +20 -0
  20. package/dist/prompts/explore-dex-pools.d.ts.map +1 -0
  21. package/dist/prompts/explore-dex-pools.js +132 -0
  22. package/dist/prompts/explore-dex-pools.js.map +1 -0
  23. package/dist/prompts/index.d.ts +3 -2
  24. package/dist/prompts/index.d.ts.map +1 -1
  25. package/dist/prompts/index.js +6 -3
  26. package/dist/prompts/index.js.map +1 -1
  27. package/dist/prompts/liquidity-positions.d.ts.map +1 -1
  28. package/dist/prompts/liquidity-positions.js +9 -44
  29. package/dist/prompts/liquidity-positions.js.map +1 -1
  30. package/dist/prompts/pools.d.ts.map +1 -1
  31. package/dist/prompts/pools.js +125 -228
  32. package/dist/prompts/pools.js.map +1 -1
  33. package/dist/prompts/portfolio.d.ts.map +1 -1
  34. package/dist/prompts/portfolio.js +13 -48
  35. package/dist/prompts/portfolio.js.map +1 -1
  36. package/dist/prompts/social.d.ts.map +1 -1
  37. package/dist/prompts/social.js +21 -31
  38. package/dist/prompts/social.js.map +1 -1
  39. package/dist/prompts/trading-calculations.d.ts.map +1 -1
  40. package/dist/prompts/trading-calculations.js +37 -126
  41. package/dist/prompts/trading-calculations.js.map +1 -1
  42. package/dist/prompts/trading.d.ts.map +1 -1
  43. package/dist/prompts/trading.js +23 -60
  44. package/dist/prompts/trading.js.map +1 -1
  45. package/dist/prompts/transfers.d.ts.map +1 -1
  46. package/dist/prompts/transfers.js +21 -31
  47. package/dist/prompts/transfers.js.map +1 -1
  48. package/dist/prompts/utility-tools.d.ts.map +1 -1
  49. package/dist/prompts/utility-tools.js +83 -202
  50. package/dist/prompts/utility-tools.js.map +1 -1
  51. package/dist/prompts/utility.d.ts.map +1 -1
  52. package/dist/prompts/utility.js +5 -20
  53. package/dist/prompts/utility.js.map +1 -1
  54. package/dist/prompts/utils/handlerHelpers.d.ts +35 -0
  55. package/dist/prompts/utils/handlerHelpers.d.ts.map +1 -0
  56. package/dist/prompts/utils/handlerHelpers.js +53 -0
  57. package/dist/prompts/utils/handlerHelpers.js.map +1 -0
  58. package/dist/prompts/utils/textTemplates.d.ts +42 -0
  59. package/dist/prompts/utils/textTemplates.d.ts.map +1 -0
  60. package/dist/prompts/utils/textTemplates.js +51 -0
  61. package/dist/prompts/utils/textTemplates.js.map +1 -0
  62. package/dist/tools/dex/fetchAllDexPools.d.ts +9 -0
  63. package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -0
  64. package/dist/tools/dex/fetchAllDexPools.js +45 -0
  65. package/dist/tools/dex/fetchAllDexPools.js.map +1 -0
  66. package/dist/tools/dex/fetchDexPools.d.ts +9 -0
  67. package/dist/tools/dex/fetchDexPools.d.ts.map +1 -0
  68. package/dist/tools/dex/fetchDexPools.js +58 -0
  69. package/dist/tools/dex/fetchDexPools.js.map +1 -0
  70. package/dist/tools/dex/index.d.ts +4 -3
  71. package/dist/tools/dex/index.d.ts.map +1 -1
  72. package/dist/tools/dex/index.js +9 -4
  73. package/dist/tools/dex/index.js.map +1 -1
  74. package/dist/utils/validation.d.ts +38 -0
  75. package/dist/utils/validation.d.ts.map +1 -1
  76. package/dist/utils/validation.js +52 -0
  77. package/dist/utils/validation.js.map +1 -1
  78. package/package.json +3 -3
  79. package/src/__tests__/server.test.ts +1 -2
  80. package/src/constants/mcpToolNames.ts +4 -2
  81. package/src/prompts/__tests__/promptStructure.test.ts +50 -0
  82. package/src/prompts/__tests__/registry.test.ts +23 -33
  83. package/src/prompts/analysis.ts +15 -64
  84. package/src/prompts/balances.ts +57 -73
  85. package/src/prompts/creation-utils.ts +34 -49
  86. package/src/prompts/explore-dex-pools.ts +138 -0
  87. package/src/prompts/index.ts +5 -2
  88. package/src/prompts/liquidity-positions.ts +11 -44
  89. package/src/prompts/pools.ts +156 -231
  90. package/src/prompts/portfolio.ts +13 -47
  91. package/src/prompts/social.ts +25 -31
  92. package/src/prompts/trading-calculations.ts +42 -127
  93. package/src/prompts/trading.ts +30 -61
  94. package/src/prompts/transfers.ts +25 -31
  95. package/src/prompts/utility-tools.ts +116 -199
  96. package/src/prompts/utility.ts +5 -20
  97. package/src/prompts/utils/handlerHelpers.ts +55 -0
  98. package/src/prompts/utils/textTemplates.ts +73 -0
  99. package/src/tools/dex/fetchAllDexPools.ts +45 -0
  100. package/src/tools/dex/fetchDexPools.ts +58 -0
  101. package/src/tools/dex/index.ts +9 -4
  102. package/src/utils/validation.ts +58 -0
@@ -6,7 +6,9 @@
6
6
 
7
7
  import type { MCPPrompt } from '../types/mcp.js';
8
8
  import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
- import { validateTokenName, validatePaginationLimit } from '../utils/validation.js';
9
+ import { validateTokenName, validateOptionalLimit } from '../utils/validation.js';
10
+ import { createPromptResponse } from './utils/handlerHelpers.js';
11
+ import { createSimpleOperationText } from './utils/textTemplates.js';
10
12
 
11
13
  /**
12
14
  * Fetch Pools - Paginated pool fetching with filters
@@ -32,26 +34,21 @@ export const fetchPoolsPrompt: MCPPrompt = {
32
34
  },
33
35
  ],
34
36
  handler: (args) => {
35
- if (args.limit) {
36
- validatePaginationLimit(args.limit, 100);
37
- }
38
-
39
- return [
40
- {
41
- role: 'user',
42
- content: {
43
- type: 'text',
44
- text: `Fetch token pools from Gala Launchpad.
45
-
46
- Use ${MCP_TOOLS.FETCH_POOLS} with parameters:
47
- - type: ${args.type || 'recent'}
48
- - page: ${args.page || 1}
49
- - limit: ${args.limit || 20}
50
-
51
- Display the results showing token names, symbols, and key metrics.`,
37
+ validateOptionalLimit(args.limit, 100);
38
+
39
+ return createPromptResponse(
40
+ createSimpleOperationText({
41
+ operation: 'Fetch token pools from Gala Launchpad.',
42
+ parameters: {
43
+ type: `Type: ${args.type || 'recent'}`,
44
+ page: `Page: ${args.page || 1}`,
45
+ limit: `Limit: ${args.limit || 20}`,
52
46
  },
53
- },
54
- ];
47
+ toolName: MCP_TOOLS.FETCH_POOLS,
48
+ actionDescription: 'retrieve pools with pagination',
49
+ displayFormat: 'Display results showing token names, symbols, and key metrics.',
50
+ })
51
+ );
55
52
  },
56
53
  };
57
54
 
@@ -71,26 +68,17 @@ export const fetchPoolDetailsForCalculationPrompt: MCPPrompt = {
71
68
  handler: (args) => {
72
69
  validateTokenName(args.tokenName);
73
70
 
74
- return [
75
- {
76
- role: 'user',
77
- content: {
78
- type: 'text',
79
- text: `Fetch optimized pool details for bonding curve calculations.
80
-
81
- Token: ${args.tokenName}
82
-
83
- Use ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION} to get:
84
- - currentSupply (computed with full precision)
85
- - remainingTokens
86
- - maxSupply
87
- - reverseBondingCurveMaxFeeFactor
88
- - reverseBondingCurveMinFeeFactor
89
-
90
- This data is optimized for use with local calculation tools.`,
71
+ return createPromptResponse(
72
+ createSimpleOperationText({
73
+ operation: 'Fetch optimized pool details for bonding curve calculations.',
74
+ parameters: {
75
+ token_name: `Token: ${args.tokenName}`,
91
76
  },
92
- },
93
- ];
77
+ toolName: MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION,
78
+ actionDescription: 'get currentSupply (computed with full precision), remainingTokens, maxSupply, reverseBondingCurveMaxFeeFactor, and reverseBondingCurveMinFeeFactor',
79
+ displayFormat: 'This data is optimized for use with local calculation tools.',
80
+ })
81
+ );
94
82
  },
95
83
  };
96
84
 
@@ -108,25 +96,17 @@ export const fetchTokenDetailsPrompt: MCPPrompt = {
108
96
  },
109
97
  ],
110
98
  handler: (args) => {
111
- return [
112
- {
113
- role: 'user',
114
- content: {
115
- type: 'text',
116
- text: `Fetch complete token metadata from the DEX API.
117
-
118
- Token ID: ${args.tokenId}
119
-
120
- Use ${MCP_TOOLS.FETCH_TOKEN_DETAILS} to retrieve:
121
- - Symbol, decimals, name, image
122
- - Description and verification status
123
- - Network information (chainId, contractAddress)
124
- - Trading enabled status
125
-
126
- Display the complete token information.`,
99
+ return createPromptResponse(
100
+ createSimpleOperationText({
101
+ operation: 'Fetch complete token metadata from the DEX API.',
102
+ parameters: {
103
+ token_id: `Token ID: ${args.tokenId}`,
127
104
  },
128
- },
129
- ];
105
+ toolName: MCP_TOOLS.FETCH_TOKEN_DETAILS,
106
+ actionDescription: 'retrieve symbol, decimals, name, image, description, verification status, network information (chainId, contractAddress), and trading enabled status',
107
+ displayFormat: 'Display the complete token information.',
108
+ })
109
+ );
130
110
  },
131
111
  };
132
112
 
@@ -146,25 +126,17 @@ export const fetchTokenDistributionPrompt: MCPPrompt = {
146
126
  handler: (args) => {
147
127
  validateTokenName(args.tokenName);
148
128
 
149
- return [
150
- {
151
- role: 'user',
152
- content: {
153
- type: 'text',
154
- text: `Analyze token holder distribution.
155
-
156
- Token: ${args.tokenName}
157
-
158
- Use ${MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION} to get:
159
- - Complete holder list with addresses, balances, and ownership percentages
160
- - Total supply (computed from holder balances)
161
- - Total holder count
162
- - Last updated timestamp
163
-
164
- Identify top holders and concentration risk.`,
129
+ return createPromptResponse(
130
+ createSimpleOperationText({
131
+ operation: 'Analyze token holder distribution.',
132
+ parameters: {
133
+ token_name: `Token: ${args.tokenName}`,
165
134
  },
166
- },
167
- ];
135
+ toolName: MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION,
136
+ actionDescription: 'get complete holder list with addresses, balances, ownership percentages, total supply, total holder count, and last updated timestamp',
137
+ displayFormat: 'Identify top holders and concentration risk.',
138
+ })
139
+ );
168
140
  },
169
141
  };
170
142
 
@@ -184,24 +156,17 @@ export const fetchTokenBadgesPrompt: MCPPrompt = {
184
156
  handler: (args) => {
185
157
  validateTokenName(args.tokenName);
186
158
 
187
- return [
188
- {
189
- role: 'user',
190
- content: {
191
- type: 'text',
192
- text: `Fetch achievement badges for token.
193
-
194
- Token: ${args.tokenName}
195
-
196
- Use ${MCP_TOOLS.FETCH_TOKEN_BADGES} to retrieve badges for:
197
- - Trading volume milestones
198
- - Community engagement
199
- - Other achievements
200
-
201
- Display all earned badges.`,
159
+ return createPromptResponse(
160
+ createSimpleOperationText({
161
+ operation: 'Fetch achievement badges for token.',
162
+ parameters: {
163
+ token_name: `Token: ${args.tokenName}`,
202
164
  },
203
- },
204
- ];
165
+ toolName: MCP_TOOLS.FETCH_TOKEN_BADGES,
166
+ actionDescription: 'retrieve badges for trading volume milestones, community engagement, and other achievements',
167
+ displayFormat: 'Display all earned badges.',
168
+ })
169
+ );
205
170
  },
206
171
  };
207
172
 
@@ -236,22 +201,20 @@ export const fetchVolumeDataPrompt: MCPPrompt = {
236
201
  handler: (args) => {
237
202
  validateTokenName(args.tokenName);
238
203
 
239
- return [
240
- {
241
- role: 'user',
242
- content: {
243
- type: 'text',
244
- text: `Fetch OHLCV candlestick data for charting.
245
-
246
- Token: ${args.tokenName}
247
- ${args.from ? `From: ${args.from}` : ''}
248
- ${args.to ? `To: ${args.to}` : ''}
249
- Resolution: ${args.resolution || '1h'}
250
-
251
- Use ${MCP_TOOLS.FETCH_VOLUME_DATA} to get candlestick data suitable for price charts.`,
204
+ return createPromptResponse(
205
+ createSimpleOperationText({
206
+ operation: 'Fetch OHLCV candlestick data for charting.',
207
+ parameters: {
208
+ token_name: `Token: ${args.tokenName}`,
209
+ ...(args.from && { from: `From: ${args.from}` }),
210
+ ...(args.to && { to: `To: ${args.to}` }),
211
+ resolution: `Resolution: ${args.resolution || '1h'}`,
252
212
  },
253
- },
254
- ];
213
+ toolName: MCP_TOOLS.FETCH_VOLUME_DATA,
214
+ actionDescription: 'retrieve candlestick data',
215
+ displayFormat: 'Display data suitable for price charts.',
216
+ })
217
+ );
255
218
  },
256
219
  };
257
220
 
@@ -262,19 +225,14 @@ export const fetchGalaSpotPricePrompt: MCPPrompt = {
262
225
  name: 'galachain-launchpad:fetch-gala-spot-price',
263
226
  description: 'Fetch current GALA USD spot price',
264
227
  handler: () => {
265
- return [
266
- {
267
- role: 'user',
268
- content: {
269
- type: 'text',
270
- text: `Fetch the current GALA USD spot price.
271
-
272
- Use ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE} to get the latest GALA price in USD.
273
-
274
- Display the price in a clear format.`,
275
- },
276
- },
277
- ];
228
+ return createPromptResponse(
229
+ createSimpleOperationText({
230
+ operation: 'Fetch the current GALA USD spot price.',
231
+ toolName: MCP_TOOLS.FETCH_GALA_SPOT_PRICE,
232
+ actionDescription: 'get the latest GALA price in USD',
233
+ displayFormat: 'Display the price in a clear format.',
234
+ })
235
+ );
278
236
  },
279
237
  };
280
238
 
@@ -294,24 +252,17 @@ export const fetchTokenSpotPricePrompt: MCPPrompt = {
294
252
  handler: (args) => {
295
253
  validateTokenName(args.tokenName);
296
254
 
297
- return [
298
- {
299
- role: 'user',
300
- content: {
301
- type: 'text',
302
- text: `Fetch current USD spot price for token.
303
-
304
- Token: ${args.tokenName}
305
-
306
- Use ${MCP_TOOLS.FETCH_TOKEN_SPOT_PRICE} to get:
307
- - Current USD price with smart routing (launchpad or DEX)
308
- - Real-time pricing data
309
- - Unified interface for all token types
310
-
311
- Display the current price clearly.`,
255
+ return createPromptResponse(
256
+ createSimpleOperationText({
257
+ operation: 'Fetch current USD spot price for token.',
258
+ parameters: {
259
+ token_name: `Token: ${args.tokenName}`,
312
260
  },
313
- },
314
- ];
261
+ toolName: MCP_TOOLS.FETCH_TOKEN_SPOT_PRICE,
262
+ actionDescription: 'get current USD price with smart routing (launchpad or DEX), real-time pricing data, and unified interface for all token types',
263
+ displayFormat: 'Display the current price clearly.',
264
+ })
265
+ );
315
266
  },
316
267
  };
317
268
 
@@ -349,29 +300,23 @@ export const fetchPriceHistoryPrompt: MCPPrompt = {
349
300
  },
350
301
  ],
351
302
  handler: (args) => {
352
- if (args.limit) {
353
- validatePaginationLimit(args.limit, 50);
354
- }
355
-
356
- return [
357
- {
358
- role: 'user',
359
- content: {
360
- type: 'text',
361
- text: `Fetch historical price snapshots for token.
362
-
363
- Token: ${args.tokenId}
364
- ${args.from ? `From: ${args.from}` : ''}
365
- ${args.to ? `To: ${args.to}` : ''}
366
- Page: ${args.page || 1}
367
- Limit: ${args.limit || 10}
368
-
369
- Use ${MCP_TOOLS.FETCH_PRICE_HISTORY} to retrieve historical price data from the DEX Backend API.
370
-
371
- Display price snapshots with timestamps.`,
303
+ validateOptionalLimit(args.limit, 50);
304
+
305
+ return createPromptResponse(
306
+ createSimpleOperationText({
307
+ operation: 'Fetch historical price snapshots for token.',
308
+ parameters: {
309
+ token_id: `Token: ${args.tokenId}`,
310
+ ...(args.from && { from: `From: ${args.from}` }),
311
+ ...(args.to && { to: `To: ${args.to}` }),
312
+ page: `Page: ${args.page || 1}`,
313
+ limit: `Limit: ${args.limit || 10}`,
372
314
  },
373
- },
374
- ];
315
+ toolName: MCP_TOOLS.FETCH_PRICE_HISTORY,
316
+ actionDescription: 'retrieve historical price data from DEX Backend API',
317
+ displayFormat: 'Display price snapshots with timestamps.',
318
+ })
319
+ );
375
320
  },
376
321
  };
377
322
 
@@ -399,23 +344,19 @@ export const fetchAllPriceHistoryPrompt: MCPPrompt = {
399
344
  },
400
345
  ],
401
346
  handler: (args) => {
402
- return [
403
- {
404
- role: 'user',
405
- content: {
406
- type: 'text',
407
- text: `Fetch ALL historical price snapshots for token (automatic pagination).
408
-
409
- Token: ${args.tokenId}
410
- ${args.from ? `From: ${args.from}` : ''}
411
- ${args.to ? `To: ${args.to}` : ''}
412
-
413
- Use ${MCP_TOOLS.FETCH_ALL_PRICE_HISTORY} to retrieve complete historical data.
414
-
415
- This automatically handles pagination and returns all available snapshots.`,
347
+ return createPromptResponse(
348
+ createSimpleOperationText({
349
+ operation: 'Fetch ALL historical price snapshots for token (automatic pagination).',
350
+ parameters: {
351
+ token_id: `Token: ${args.tokenId}`,
352
+ from: args.from ? `From: ${args.from}` : undefined,
353
+ to: args.to ? `To: ${args.to}` : undefined,
416
354
  },
417
- },
418
- ];
355
+ toolName: MCP_TOOLS.FETCH_ALL_PRICE_HISTORY,
356
+ actionDescription: 'retrieve complete historical data',
357
+ displayFormat: 'This automatically handles pagination and returns all available snapshots.',
358
+ })
359
+ );
419
360
  },
420
361
  };
421
362
 
@@ -435,21 +376,17 @@ export const checkTokenNamePrompt: MCPPrompt = {
435
376
  handler: (args) => {
436
377
  validateTokenName(args.tokenName);
437
378
 
438
- return [
439
- {
440
- role: 'user',
441
- content: {
442
- type: 'text',
443
- text: `Check if token name is available.
444
-
445
- Token Name: ${args.tokenName}
446
-
447
- Use ${MCP_TOOLS.CHECK_TOKEN_NAME} to verify availability.
448
-
449
- Display whether the name is available or already taken.`,
379
+ return createPromptResponse(
380
+ createSimpleOperationText({
381
+ operation: 'Check if token name is available.',
382
+ parameters: {
383
+ token_name: `Token Name: ${args.tokenName}`,
450
384
  },
451
- },
452
- ];
385
+ toolName: MCP_TOOLS.CHECK_TOKEN_NAME,
386
+ actionDescription: 'verify availability',
387
+ displayFormat: 'Display whether the name is available or already taken.',
388
+ })
389
+ );
453
390
  },
454
391
  };
455
392
 
@@ -467,21 +404,17 @@ export const checkTokenSymbolPrompt: MCPPrompt = {
467
404
  },
468
405
  ],
469
406
  handler: (args) => {
470
- return [
471
- {
472
- role: 'user',
473
- content: {
474
- type: 'text',
475
- text: `Check if token symbol is available.
476
-
477
- Token Symbol: ${args.symbol}
478
-
479
- Use ${MCP_TOOLS.CHECK_TOKEN_SYMBOL} to verify availability.
480
-
481
- Display whether the symbol is available or already taken.`,
407
+ return createPromptResponse(
408
+ createSimpleOperationText({
409
+ operation: 'Check if token symbol is available.',
410
+ parameters: {
411
+ token_symbol: `Token Symbol: ${args.symbol}`,
482
412
  },
483
- },
484
- ];
413
+ toolName: MCP_TOOLS.CHECK_TOKEN_SYMBOL,
414
+ actionDescription: 'verify availability',
415
+ displayFormat: 'Display whether the symbol is available or already taken.',
416
+ })
417
+ );
485
418
  },
486
419
  };
487
420
 
@@ -501,21 +434,17 @@ export const resolveVaultAddressPrompt: MCPPrompt = {
501
434
  handler: (args) => {
502
435
  validateTokenName(args.tokenName);
503
436
 
504
- return [
505
- {
506
- role: 'user',
507
- content: {
508
- type: 'text',
509
- text: `Resolve GalaChain vault address for token.
510
-
511
- Token: ${args.tokenName}
512
-
513
- Use ${MCP_TOOLS.RESOLVE_VAULT_ADDRESS} to get the vault address.
514
-
515
- This is useful for debugging and direct GalaChain operations.`,
437
+ return createPromptResponse(
438
+ createSimpleOperationText({
439
+ operation: 'Resolve GalaChain vault address for token.',
440
+ parameters: {
441
+ token_name: `Token: ${args.tokenName}`,
516
442
  },
517
- },
518
- ];
443
+ toolName: MCP_TOOLS.RESOLVE_VAULT_ADDRESS,
444
+ actionDescription: 'get the vault address',
445
+ displayFormat: 'This is useful for debugging and direct GalaChain operations.',
446
+ })
447
+ );
519
448
  },
520
449
  };
521
450
 
@@ -535,21 +464,17 @@ export const resolveTokenClassKeyPrompt: MCPPrompt = {
535
464
  handler: (args) => {
536
465
  validateTokenName(args.tokenName);
537
466
 
538
- return [
539
- {
540
- role: 'user',
541
- content: {
542
- type: 'text',
543
- text: `Resolve GalaChain TokenClassKey for launchpad token.
544
-
545
- Token: ${args.tokenName}
546
-
547
- Use ${MCP_TOOLS.RESOLVE_TOKEN_CLASS_KEY} to get the TokenClassKey.
548
-
549
- This is useful for direct GalaChain operations.`,
467
+ return createPromptResponse(
468
+ createSimpleOperationText({
469
+ operation: 'Resolve GalaChain TokenClassKey for launchpad token.',
470
+ parameters: {
471
+ token_name: `Token: ${args.tokenName}`,
550
472
  },
551
- },
552
- ];
473
+ toolName: MCP_TOOLS.RESOLVE_TOKEN_CLASS_KEY,
474
+ actionDescription: 'get the TokenClassKey',
475
+ displayFormat: 'This is useful for direct GalaChain operations.',
476
+ })
477
+ );
553
478
  },
554
479
  };
555
480
 
@@ -7,7 +7,8 @@
7
7
  import type { MCPPrompt } from '../types/mcp.js';
8
8
  import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
9
  import { createPortfolioWorkflow } from './utils/workflowTemplates.js';
10
- import { validateTokenName, validatePaginationLimit } from '../utils/validation.js';
10
+ import { validateTokenName, validateOptionalLimit } from '../utils/validation.js';
11
+ import { createPromptResponse } from './utils/handlerHelpers.js';
11
12
 
12
13
  /**
13
14
  * Portfolio - Complete portfolio analysis
@@ -46,21 +47,14 @@ export const tokensHeldPrompt: MCPPrompt = {
46
47
  ],
47
48
  handler: (args) => {
48
49
  // Validate inputs
49
- if (args.limit) {
50
- validatePaginationLimit(args.limit, 100);
51
- }
50
+ validateOptionalLimit(args.limit, 100);
52
51
 
53
52
  const limit = args.limit || '20';
54
53
  const searchFilter = args.search
55
54
  ? `- search: "${args.search}" (fuzzy match filter)`
56
55
  : '- No search filter (show all tokens)';
57
56
 
58
- return [
59
- {
60
- role: 'user',
61
- content: {
62
- type: 'text',
63
- text: `Show me all Launchpad tokens I'm currently holding:
57
+ return createPromptResponse(`Show me all Launchpad tokens I'm currently holding:
64
58
 
65
59
  Use ${MCP_TOOLS.FETCH_TOKENS_HELD} with:
66
60
  ${searchFilter}
@@ -73,10 +67,7 @@ For each token, display:
73
67
 
74
68
  Sort by balance (highest to lowest).
75
69
 
76
- If I have more tokens than the limit, show pagination info and offer to fetch more.`,
77
- },
78
- },
79
- ];
70
+ If I have more tokens than the limit, show pagination info and offer to fetch more.`);
80
71
  },
81
72
  };
82
73
 
@@ -100,21 +91,14 @@ export const tokensCreatedPrompt: MCPPrompt = {
100
91
  ],
101
92
  handler: (args) => {
102
93
  // Validate inputs
103
- if (args.limit) {
104
- validatePaginationLimit(args.limit, 100);
105
- }
94
+ validateOptionalLimit(args.limit, 100);
106
95
 
107
96
  const limit = args.limit || '20';
108
97
  const searchFilter = args.search
109
98
  ? `- search: "${args.search}" (fuzzy match filter)`
110
99
  : '- No search filter (show all tokens)';
111
100
 
112
- return [
113
- {
114
- role: 'user',
115
- content: {
116
- type: 'text',
117
- text: `Show me all Launchpad tokens I've created:
101
+ return createPromptResponse(`Show me all Launchpad tokens I've created:
118
102
 
119
103
  Use ${MCP_TOOLS.FETCH_TOKENS_CREATED} with:
120
104
  ${searchFilter}
@@ -133,10 +117,7 @@ For each token, display:
133
117
  Provide a summary:
134
118
  - Total tokens created
135
119
  - How many are graduated
136
- - How many are still in bonding curve phase`,
137
- },
138
- },
139
- ];
120
+ - How many are still in bonding curve phase`);
140
121
  },
141
122
  };
142
123
 
@@ -159,12 +140,7 @@ export const balancePrompt: MCPPrompt = {
159
140
  validateTokenName(args.tokenName);
160
141
  }
161
142
 
162
- return [
163
- {
164
- role: 'user',
165
- content: {
166
- type: 'text',
167
- text: args.tokenName
143
+ return createPromptResponse(args.tokenName
168
144
  ? `Check my balances:
169
145
 
170
146
  1. GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}
@@ -186,10 +162,7 @@ Display:
186
162
  - GALA: [amount]
187
163
  - USD value: $[calculated value]
188
164
 
189
- Tip: Add tokenName argument to check a specific token balance.`,
190
- },
191
- },
192
- ];
165
+ Tip: Add tokenName argument to check a specific token balance.`);
193
166
  },
194
167
  };
195
168
 
@@ -199,12 +172,8 @@ Tip: Add tokenName argument to check a specific token balance.`,
199
172
  export const profilePrompt: MCPPrompt = {
200
173
  name: 'galachain-launchpad:profile',
201
174
  description: 'Show user profile information and activity summary',
202
- handler: () => [
203
- {
204
- role: 'user',
205
- content: {
206
- type: 'text',
207
- text: `Show my Gala Launchpad profile:
175
+ handler: () =>
176
+ createPromptResponse(`Show my Gala Launchpad profile:
208
177
 
209
178
  1. Get profile info using ${MCP_TOOLS.FETCH_PROFILE}
210
179
  - Full name
@@ -224,10 +193,7 @@ Display:
224
193
  - Profile details
225
194
  - Activity metrics
226
195
  - Wallet addresses
227
- - Current balance`,
228
- },
229
- },
230
- ],
196
+ - Current balance`),
231
197
  };
232
198
 
233
199
  /**