@gala-chain/launchpad-mcp-server 1.23.1 → 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 (114) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +34 -6
  3. package/dist/constants/mcpToolNames.d.ts +6 -2
  4. package/dist/constants/mcpToolNames.d.ts.map +1 -1
  5. package/dist/constants/mcpToolNames.js +4 -2
  6. package/dist/constants/mcpToolNames.js.map +1 -1
  7. package/dist/generated/version.d.ts +1 -1
  8. package/dist/generated/version.js +1 -1
  9. package/dist/prompts/explore-dex-pools.d.ts +20 -0
  10. package/dist/prompts/explore-dex-pools.d.ts.map +1 -0
  11. package/dist/prompts/explore-dex-pools.js +132 -0
  12. package/dist/prompts/explore-dex-pools.js.map +1 -0
  13. package/dist/prompts/index.d.ts +3 -2
  14. package/dist/prompts/index.d.ts.map +1 -1
  15. package/dist/prompts/index.js +6 -3
  16. package/dist/prompts/index.js.map +1 -1
  17. package/dist/prompts/pools.js.map +1 -1
  18. package/dist/tools/dex/fetchAllDexPools.d.ts +9 -0
  19. package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -0
  20. package/dist/tools/dex/fetchAllDexPools.js +45 -0
  21. package/dist/tools/dex/fetchAllDexPools.js.map +1 -0
  22. package/dist/tools/dex/fetchDexPools.d.ts +9 -0
  23. package/dist/tools/dex/fetchDexPools.d.ts.map +1 -0
  24. package/dist/tools/dex/fetchDexPools.js +58 -0
  25. package/dist/tools/dex/fetchDexPools.js.map +1 -0
  26. package/dist/tools/dex/index.d.ts +4 -3
  27. package/dist/tools/dex/index.d.ts.map +1 -1
  28. package/dist/tools/dex/index.js +9 -4
  29. package/dist/tools/dex/index.js.map +1 -1
  30. package/docs/AI-AGENT-PATTERNS.md +555 -0
  31. package/docs/CONSTRAINTS-REFERENCE.md +454 -0
  32. package/docs/PROMPT-TOOL-MAPPING.md +352 -0
  33. package/docs/examples/default-values-pattern.md +240 -0
  34. package/docs/examples/tool-factory-pattern.md +217 -0
  35. package/jest.config.js +94 -0
  36. package/package.json +3 -3
  37. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +258 -0
  38. package/src/__tests__/integration/poolTools.integration.test.ts +185 -0
  39. package/src/__tests__/server.test.ts +255 -0
  40. package/src/constants/mcpToolNames.ts +183 -0
  41. package/src/index.ts +19 -0
  42. package/src/prompts/__tests__/promptStructure.test.ts +187 -0
  43. package/src/prompts/__tests__/registry.test.ts +349 -0
  44. package/src/prompts/analysis.ts +380 -0
  45. package/src/prompts/balances.ts +182 -0
  46. package/src/prompts/create-token.ts +123 -0
  47. package/src/prompts/creation-utils.ts +103 -0
  48. package/src/prompts/dex-trading.ts +86 -0
  49. package/src/prompts/discover-tokens.ts +86 -0
  50. package/src/prompts/explore-dex-pools.ts +138 -0
  51. package/src/prompts/index.ts +178 -0
  52. package/src/prompts/liquidity-positions.ts +237 -0
  53. package/src/prompts/pools.ts +496 -0
  54. package/src/prompts/portfolio.ts +208 -0
  55. package/src/prompts/social.ts +94 -0
  56. package/src/prompts/trading-calculations.ts +414 -0
  57. package/src/prompts/trading.ts +160 -0
  58. package/src/prompts/transfers.ts +97 -0
  59. package/src/prompts/utility-tools.ts +266 -0
  60. package/src/prompts/utility.ts +77 -0
  61. package/src/prompts/utils/handlerHelpers.ts +55 -0
  62. package/src/prompts/utils/textTemplates.ts +73 -0
  63. package/src/prompts/utils/workflowTemplates.ts +511 -0
  64. package/src/schemas/common-schemas.ts +393 -0
  65. package/src/scripts/test-all-prompts.ts +184 -0
  66. package/src/server.ts +367 -0
  67. package/src/tools/__tests__/dex-tools.test.ts +562 -0
  68. package/src/tools/__tests__/liquidity-positions.test.ts +673 -0
  69. package/src/tools/balance/index.ts +174 -0
  70. package/src/tools/creation/index.ts +182 -0
  71. package/src/tools/dex/fetchAllDexPools.ts +45 -0
  72. package/src/tools/dex/fetchDexPools.ts +58 -0
  73. package/src/tools/dex/index.ts +231 -0
  74. package/src/tools/dex/liquidity-positions.ts +547 -0
  75. package/src/tools/index.ts +94 -0
  76. package/src/tools/pools/fetchAllPools.ts +47 -0
  77. package/src/tools/pools/fetchAllPriceHistory.ts +119 -0
  78. package/src/tools/pools/fetchPoolDetails.ts +27 -0
  79. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +22 -0
  80. package/src/tools/pools/fetchPools.ts +47 -0
  81. package/src/tools/pools/fetchPriceHistory.ts +124 -0
  82. package/src/tools/pools/fetchTokenDetails.ts +77 -0
  83. package/src/tools/pools/index.ts +284 -0
  84. package/src/tools/social/index.ts +64 -0
  85. package/src/tools/trading/index.ts +605 -0
  86. package/src/tools/transfers/index.ts +75 -0
  87. package/src/tools/utils/clearCache.ts +36 -0
  88. package/src/tools/utils/createWallet.ts +19 -0
  89. package/src/tools/utils/explainSdkUsage.ts +1446 -0
  90. package/src/tools/utils/getAddress.ts +12 -0
  91. package/src/tools/utils/getCacheInfo.ts +14 -0
  92. package/src/tools/utils/getConfig.ts +21 -0
  93. package/src/tools/utils/getEnvironment.ts +17 -0
  94. package/src/tools/utils/getEthereumAddress.ts +12 -0
  95. package/src/tools/utils/getUrlByTokenName.ts +12 -0
  96. package/src/tools/utils/getVersion.ts +25 -0
  97. package/src/tools/utils/getWallet.ts +25 -0
  98. package/src/tools/utils/hasWallet.ts +15 -0
  99. package/src/tools/utils/index.ts +37 -0
  100. package/src/tools/utils/isTokenGraduated.ts +16 -0
  101. package/src/tools/utils/setWallet.ts +41 -0
  102. package/src/tools/utils/switchEnvironment.ts +28 -0
  103. package/src/types/mcp.ts +72 -0
  104. package/src/utils/__tests__/validation.test.ts +147 -0
  105. package/src/utils/constraints.ts +155 -0
  106. package/src/utils/default-values.ts +208 -0
  107. package/src/utils/error-handler.ts +69 -0
  108. package/src/utils/error-templates.ts +273 -0
  109. package/src/utils/response-formatter.ts +51 -0
  110. package/src/utils/tool-factory.ts +303 -0
  111. package/src/utils/tool-registry.ts +296 -0
  112. package/src/utils/validation.ts +429 -0
  113. package/tests/wallet-management-integration.test.ts +284 -0
  114. package/tsconfig.json +23 -0
@@ -0,0 +1,496 @@
1
+ /**
2
+ * Pool Management Prompts
3
+ *
4
+ * Slash commands for pool management, pricing, and token data operations
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
+ import { validateTokenName, validateOptionalLimit } from '../utils/validation.js';
10
+ import { createPromptResponse } from './utils/handlerHelpers.js';
11
+ import { createSimpleOperationText } from './utils/textTemplates.js';
12
+
13
+ /**
14
+ * Fetch Pools - Paginated pool fetching with filters
15
+ */
16
+ export const fetchPoolsPrompt: MCPPrompt = {
17
+ name: 'galachain-launchpad:fetch-pools',
18
+ description: 'Fetch token pools with pagination and optional filters',
19
+ arguments: [
20
+ {
21
+ name: 'type',
22
+ description: 'Pool type: recent, popular (default: recent)',
23
+ required: false,
24
+ },
25
+ {
26
+ name: 'page',
27
+ description: 'Page number (default: 1)',
28
+ required: false,
29
+ },
30
+ {
31
+ name: 'limit',
32
+ description: 'Results per page (default: 20, max: 100)',
33
+ required: false,
34
+ },
35
+ ],
36
+ handler: (args) => {
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}`,
46
+ },
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
+ );
52
+ },
53
+ };
54
+
55
+ /**
56
+ * Fetch Pool Details for Calculation - Optimized pool details
57
+ */
58
+ export const fetchPoolDetailsForCalculationPrompt: MCPPrompt = {
59
+ name: 'galachain-launchpad:fetch-pool-details-for-calculation',
60
+ description: 'Get optimized pool details for local bonding curve calculations',
61
+ arguments: [
62
+ {
63
+ name: 'tokenName',
64
+ description: 'Token name (e.g., anime, test216253)',
65
+ required: true,
66
+ },
67
+ ],
68
+ handler: (args) => {
69
+ validateTokenName(args.tokenName);
70
+
71
+ return createPromptResponse(
72
+ createSimpleOperationText({
73
+ operation: 'Fetch optimized pool details for bonding curve calculations.',
74
+ parameters: {
75
+ token_name: `Token: ${args.tokenName}`,
76
+ },
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
+ );
82
+ },
83
+ };
84
+
85
+ /**
86
+ * Fetch Token Details - Complete token metadata
87
+ */
88
+ export const fetchTokenDetailsPrompt: MCPPrompt = {
89
+ name: 'galachain-launchpad:fetch-token-details',
90
+ description: 'Fetch comprehensive token metadata from DEX API',
91
+ arguments: [
92
+ {
93
+ name: 'tokenId',
94
+ description: 'Token ID (e.g., Token|Unit|GUSDC|eth:0x...)',
95
+ required: true,
96
+ },
97
+ ],
98
+ handler: (args) => {
99
+ return createPromptResponse(
100
+ createSimpleOperationText({
101
+ operation: 'Fetch complete token metadata from the DEX API.',
102
+ parameters: {
103
+ token_id: `Token ID: ${args.tokenId}`,
104
+ },
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
+ );
110
+ },
111
+ };
112
+
113
+ /**
114
+ * Fetch Token Distribution - Holder analysis
115
+ */
116
+ export const fetchTokenDistributionPrompt: MCPPrompt = {
117
+ name: 'galachain-launchpad:fetch-token-distribution',
118
+ description: 'Get token holder distribution and supply metrics',
119
+ arguments: [
120
+ {
121
+ name: 'tokenName',
122
+ description: 'Token name (e.g., anime, test216253)',
123
+ required: true,
124
+ },
125
+ ],
126
+ handler: (args) => {
127
+ validateTokenName(args.tokenName);
128
+
129
+ return createPromptResponse(
130
+ createSimpleOperationText({
131
+ operation: 'Analyze token holder distribution.',
132
+ parameters: {
133
+ token_name: `Token: ${args.tokenName}`,
134
+ },
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
+ );
140
+ },
141
+ };
142
+
143
+ /**
144
+ * Fetch Token Badges - Achievement badges
145
+ */
146
+ export const fetchTokenBadgesPrompt: MCPPrompt = {
147
+ name: 'galachain-launchpad:fetch-token-badges',
148
+ description: 'Get achievement badges for volume and engagement',
149
+ arguments: [
150
+ {
151
+ name: 'tokenName',
152
+ description: 'Token name (e.g., anime, test216253)',
153
+ required: true,
154
+ },
155
+ ],
156
+ handler: (args) => {
157
+ validateTokenName(args.tokenName);
158
+
159
+ return createPromptResponse(
160
+ createSimpleOperationText({
161
+ operation: 'Fetch achievement badges for token.',
162
+ parameters: {
163
+ token_name: `Token: ${args.tokenName}`,
164
+ },
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
+ );
170
+ },
171
+ };
172
+
173
+ /**
174
+ * Fetch Volume Data - OHLCV candlestick data
175
+ */
176
+ export const fetchVolumeDataPrompt: MCPPrompt = {
177
+ name: 'galachain-launchpad:fetch-volume-data',
178
+ description: 'Get OHLCV (candlestick) data for charting',
179
+ arguments: [
180
+ {
181
+ name: 'tokenName',
182
+ description: 'Token name (e.g., anime, test216253)',
183
+ required: true,
184
+ },
185
+ {
186
+ name: 'from',
187
+ description: 'Start date (ISO 8601 format)',
188
+ required: false,
189
+ },
190
+ {
191
+ name: 'to',
192
+ description: 'End date (ISO 8601 format)',
193
+ required: false,
194
+ },
195
+ {
196
+ name: 'resolution',
197
+ description: 'Time resolution: 1m, 5m, 15m, 1h, 4h, 1d (default: 1h)',
198
+ required: false,
199
+ },
200
+ ],
201
+ handler: (args) => {
202
+ validateTokenName(args.tokenName);
203
+
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'}`,
212
+ },
213
+ toolName: MCP_TOOLS.FETCH_VOLUME_DATA,
214
+ actionDescription: 'retrieve candlestick data',
215
+ displayFormat: 'Display data suitable for price charts.',
216
+ })
217
+ );
218
+ },
219
+ };
220
+
221
+ /**
222
+ * Fetch GALA Spot Price - Current GALA USD price
223
+ */
224
+ export const fetchGalaSpotPricePrompt: MCPPrompt = {
225
+ name: 'galachain-launchpad:fetch-gala-spot-price',
226
+ description: 'Fetch current GALA USD spot price',
227
+ handler: () => {
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
+ );
236
+ },
237
+ };
238
+
239
+ /**
240
+ * Fetch Token Spot Price - Current USD price for any token
241
+ */
242
+ export const fetchTokenSpotPricePrompt: MCPPrompt = {
243
+ name: 'galachain-launchpad:fetch-token-spot-price',
244
+ description: 'Fetch USD spot price for any token (launchpad or DEX)',
245
+ arguments: [
246
+ {
247
+ name: 'tokenName',
248
+ description: 'Token name (e.g., anime, gala, demonkpop)',
249
+ required: true,
250
+ },
251
+ ],
252
+ handler: (args) => {
253
+ validateTokenName(args.tokenName);
254
+
255
+ return createPromptResponse(
256
+ createSimpleOperationText({
257
+ operation: 'Fetch current USD spot price for token.',
258
+ parameters: {
259
+ token_name: `Token: ${args.tokenName}`,
260
+ },
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
+ );
266
+ },
267
+ };
268
+
269
+ /**
270
+ * Fetch Price History - Paginated historical prices
271
+ */
272
+ export const fetchPriceHistoryPrompt: MCPPrompt = {
273
+ name: 'galachain-launchpad:fetch-price-history',
274
+ description: 'Fetch historical token prices with pagination',
275
+ arguments: [
276
+ {
277
+ name: 'tokenId',
278
+ description: 'Token ID (e.g., Token|Unit|GUSDC|eth:0x...) OR tokenName (e.g., demonkpop)',
279
+ required: true,
280
+ },
281
+ {
282
+ name: 'from',
283
+ description: 'Start date (ISO 8601 format)',
284
+ required: false,
285
+ },
286
+ {
287
+ name: 'to',
288
+ description: 'End date (ISO 8601 format)',
289
+ required: false,
290
+ },
291
+ {
292
+ name: 'page',
293
+ description: 'Page number (default: 1)',
294
+ required: false,
295
+ },
296
+ {
297
+ name: 'limit',
298
+ description: 'Results per page (default: 10, max: 50)',
299
+ required: false,
300
+ },
301
+ ],
302
+ handler: (args) => {
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}`,
314
+ },
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
+ );
320
+ },
321
+ };
322
+
323
+ /**
324
+ * Fetch All Price History - Auto-paginated complete history
325
+ */
326
+ export const fetchAllPriceHistoryPrompt: MCPPrompt = {
327
+ name: 'galachain-launchpad:fetch-all-price-history',
328
+ description: 'Fetch complete historical token prices (auto-paginated)',
329
+ arguments: [
330
+ {
331
+ name: 'tokenId',
332
+ description: 'Token ID (e.g., Token|Unit|GUSDC|eth:0x...) OR tokenName (e.g., demonkpop)',
333
+ required: true,
334
+ },
335
+ {
336
+ name: 'from',
337
+ description: 'Start date (ISO 8601 format)',
338
+ required: false,
339
+ },
340
+ {
341
+ name: 'to',
342
+ description: 'End date (ISO 8601 format)',
343
+ required: false,
344
+ },
345
+ ],
346
+ handler: (args) => {
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,
354
+ },
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
+ );
360
+ },
361
+ };
362
+
363
+ /**
364
+ * Check Token Name - Name availability check
365
+ */
366
+ export const checkTokenNamePrompt: MCPPrompt = {
367
+ name: 'galachain-launchpad:check-token-name',
368
+ description: 'Check if a token name is available',
369
+ arguments: [
370
+ {
371
+ name: 'tokenName',
372
+ description: 'Token name to check (3-20 alphanumeric characters)',
373
+ required: true,
374
+ },
375
+ ],
376
+ handler: (args) => {
377
+ validateTokenName(args.tokenName);
378
+
379
+ return createPromptResponse(
380
+ createSimpleOperationText({
381
+ operation: 'Check if token name is available.',
382
+ parameters: {
383
+ token_name: `Token Name: ${args.tokenName}`,
384
+ },
385
+ toolName: MCP_TOOLS.CHECK_TOKEN_NAME,
386
+ actionDescription: 'verify availability',
387
+ displayFormat: 'Display whether the name is available or already taken.',
388
+ })
389
+ );
390
+ },
391
+ };
392
+
393
+ /**
394
+ * Check Token Symbol - Symbol availability check
395
+ */
396
+ export const checkTokenSymbolPrompt: MCPPrompt = {
397
+ name: 'galachain-launchpad:check-token-symbol',
398
+ description: 'Check if a token symbol is available',
399
+ arguments: [
400
+ {
401
+ name: 'symbol',
402
+ description: 'Token symbol to check (1-8 uppercase characters)',
403
+ required: true,
404
+ },
405
+ ],
406
+ handler: (args) => {
407
+ return createPromptResponse(
408
+ createSimpleOperationText({
409
+ operation: 'Check if token symbol is available.',
410
+ parameters: {
411
+ token_symbol: `Token Symbol: ${args.symbol}`,
412
+ },
413
+ toolName: MCP_TOOLS.CHECK_TOKEN_SYMBOL,
414
+ actionDescription: 'verify availability',
415
+ displayFormat: 'Display whether the symbol is available or already taken.',
416
+ })
417
+ );
418
+ },
419
+ };
420
+
421
+ /**
422
+ * Resolve Vault Address - GalaChain vault lookup
423
+ */
424
+ export const resolveVaultAddressPrompt: MCPPrompt = {
425
+ name: 'galachain-launchpad:resolve-vault-address',
426
+ description: 'Get GalaChain vault address for a token',
427
+ arguments: [
428
+ {
429
+ name: 'tokenName',
430
+ description: 'Token name (e.g., anime, test216253)',
431
+ required: true,
432
+ },
433
+ ],
434
+ handler: (args) => {
435
+ validateTokenName(args.tokenName);
436
+
437
+ return createPromptResponse(
438
+ createSimpleOperationText({
439
+ operation: 'Resolve GalaChain vault address for token.',
440
+ parameters: {
441
+ token_name: `Token: ${args.tokenName}`,
442
+ },
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
+ );
448
+ },
449
+ };
450
+
451
+ /**
452
+ * Resolve Token Class Key - TokenClassKey resolution
453
+ */
454
+ export const resolveTokenClassKeyPrompt: MCPPrompt = {
455
+ name: 'galachain-launchpad:resolve-token-class-key',
456
+ description: 'Get GalaChain TokenClassKey for a launchpad token',
457
+ arguments: [
458
+ {
459
+ name: 'tokenName',
460
+ description: 'Token name (e.g., anime, test216253)',
461
+ required: true,
462
+ },
463
+ ],
464
+ handler: (args) => {
465
+ validateTokenName(args.tokenName);
466
+
467
+ return createPromptResponse(
468
+ createSimpleOperationText({
469
+ operation: 'Resolve GalaChain TokenClassKey for launchpad token.',
470
+ parameters: {
471
+ token_name: `Token: ${args.tokenName}`,
472
+ },
473
+ toolName: MCP_TOOLS.RESOLVE_TOKEN_CLASS_KEY,
474
+ actionDescription: 'get the TokenClassKey',
475
+ displayFormat: 'This is useful for direct GalaChain operations.',
476
+ })
477
+ );
478
+ },
479
+ };
480
+
481
+ export const poolPrompts: MCPPrompt[] = [
482
+ fetchPoolsPrompt,
483
+ fetchPoolDetailsForCalculationPrompt,
484
+ fetchTokenDetailsPrompt,
485
+ fetchTokenDistributionPrompt,
486
+ fetchTokenBadgesPrompt,
487
+ fetchVolumeDataPrompt,
488
+ fetchGalaSpotPricePrompt,
489
+ fetchTokenSpotPricePrompt,
490
+ fetchPriceHistoryPrompt,
491
+ fetchAllPriceHistoryPrompt,
492
+ checkTokenNamePrompt,
493
+ checkTokenSymbolPrompt,
494
+ resolveVaultAddressPrompt,
495
+ resolveTokenClassKeyPrompt,
496
+ ];
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Portfolio Prompts
3
+ *
4
+ * Slash commands for portfolio management on Gala Launchpad
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
+ import { createPortfolioWorkflow } from './utils/workflowTemplates.js';
10
+ import { validateTokenName, validateOptionalLimit } from '../utils/validation.js';
11
+ import { createPromptResponse } from './utils/handlerHelpers.js';
12
+
13
+ /**
14
+ * Portfolio - Complete portfolio analysis
15
+ */
16
+ export const portfolioPrompt: MCPPrompt = {
17
+ name: 'galachain-launchpad:portfolio',
18
+ description: 'Analyze complete portfolio with GALA balance, token holdings, and total USD value',
19
+ handler: () => [
20
+ {
21
+ role: 'user',
22
+ content: {
23
+ type: 'text',
24
+ text: createPortfolioWorkflow(),
25
+ },
26
+ },
27
+ ],
28
+ };
29
+
30
+ /**
31
+ * Tokens Held - List all token holdings
32
+ */
33
+ export const tokensHeldPrompt: MCPPrompt = {
34
+ name: 'galachain-launchpad:tokens-held',
35
+ description: 'List all Launchpad tokens currently held with balances',
36
+ arguments: [
37
+ {
38
+ name: 'search',
39
+ description: 'Optional search filter for token names (fuzzy match)',
40
+ required: false,
41
+ },
42
+ {
43
+ name: 'limit',
44
+ description: 'Number of tokens to show (default: 20)',
45
+ required: false,
46
+ },
47
+ ],
48
+ handler: (args) => {
49
+ // Validate inputs
50
+ validateOptionalLimit(args.limit, 100);
51
+
52
+ const limit = args.limit || '20';
53
+ const searchFilter = args.search
54
+ ? `- search: "${args.search}" (fuzzy match filter)`
55
+ : '- No search filter (show all tokens)';
56
+
57
+ return createPromptResponse(`Show me all Launchpad tokens I'm currently holding:
58
+
59
+ Use ${MCP_TOOLS.FETCH_TOKENS_HELD} with:
60
+ ${searchFilter}
61
+ - limit: ${limit}
62
+
63
+ For each token, display:
64
+ - Token name
65
+ - Balance (formatted with decimals)
66
+ - Whether I created this token (if applicable)
67
+
68
+ Sort by balance (highest to lowest).
69
+
70
+ If I have more tokens than the limit, show pagination info and offer to fetch more.`);
71
+ },
72
+ };
73
+
74
+ /**
75
+ * Tokens Created - Show tokens created by user
76
+ */
77
+ export const tokensCreatedPrompt: MCPPrompt = {
78
+ name: 'galachain-launchpad:tokens-created',
79
+ description: 'List all Launchpad tokens created by the user with their current status',
80
+ arguments: [
81
+ {
82
+ name: 'search',
83
+ description: 'Optional search filter for token names (fuzzy match)',
84
+ required: false,
85
+ },
86
+ {
87
+ name: 'limit',
88
+ description: 'Number of tokens to show (default: 20)',
89
+ required: false,
90
+ },
91
+ ],
92
+ handler: (args) => {
93
+ // Validate inputs
94
+ validateOptionalLimit(args.limit, 100);
95
+
96
+ const limit = args.limit || '20';
97
+ const searchFilter = args.search
98
+ ? `- search: "${args.search}" (fuzzy match filter)`
99
+ : '- No search filter (show all tokens)';
100
+
101
+ return createPromptResponse(`Show me all Launchpad tokens I've created:
102
+
103
+ Use ${MCP_TOOLS.FETCH_TOKENS_CREATED} with:
104
+ ${searchFilter}
105
+ - limit: ${limit}
106
+
107
+ For each token, display:
108
+ - Token name and symbol
109
+ - Current status (check using ${MCP_TOOLS.FETCH_POOL_DETAILS}):
110
+ * Pool status (Ongoing/Completed)
111
+ * Current supply
112
+ * Remaining tokens
113
+ * Progress percentage
114
+ - Whether graduated (use ${MCP_TOOLS.IS_TOKEN_GRADUATED})
115
+ - Frontend URL (use ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME})
116
+
117
+ Provide a summary:
118
+ - Total tokens created
119
+ - How many are graduated
120
+ - How many are still in bonding curve phase`);
121
+ },
122
+ };
123
+
124
+ /**
125
+ * Balance - Check GALA and specific token balances
126
+ */
127
+ export const balancePrompt: MCPPrompt = {
128
+ name: 'galachain-launchpad:balance',
129
+ description: 'Check GALA balance and optionally a specific token balance',
130
+ arguments: [
131
+ {
132
+ name: 'tokenName',
133
+ description: 'Optional token name to check balance for (e.g., anime)',
134
+ required: false,
135
+ },
136
+ ],
137
+ handler: (args) => {
138
+ // Validate inputs
139
+ if (args.tokenName) {
140
+ validateTokenName(args.tokenName);
141
+ }
142
+
143
+ return createPromptResponse(args.tokenName
144
+ ? `Check my balances:
145
+
146
+ 1. GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}
147
+ 2. ${args.tokenName} token balance using ${MCP_TOOLS.FETCH_TOKEN_BALANCE}
148
+ 3. Calculate USD values:
149
+ - GALA USD value using ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE}
150
+ - ${args.tokenName} USD value using ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE}
151
+
152
+ Display:
153
+ - GALA: [amount] ($[USD value])
154
+ - ${args.tokenName}: [amount] ($[USD value])
155
+ - Total value: $[combined USD value]`
156
+ : `Check my GALA balance:
157
+
158
+ Use ${MCP_TOOLS.FETCH_GALA_BALANCE} to get current GALA balance.
159
+ Use ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE} to calculate USD value.
160
+
161
+ Display:
162
+ - GALA: [amount]
163
+ - USD value: $[calculated value]
164
+
165
+ Tip: Add tokenName argument to check a specific token balance.`);
166
+ },
167
+ };
168
+
169
+ /**
170
+ * Profile - Show user profile information
171
+ */
172
+ export const profilePrompt: MCPPrompt = {
173
+ name: 'galachain-launchpad:profile',
174
+ description: 'Show user profile information and activity summary',
175
+ handler: () =>
176
+ createPromptResponse(`Show my Gala Launchpad profile:
177
+
178
+ 1. Get profile info using ${MCP_TOOLS.FETCH_PROFILE}
179
+ - Full name
180
+ - Profile image URL
181
+ - Wallet address
182
+
183
+ 2. Get activity summary:
184
+ - Tokens held count: ${MCP_TOOLS.FETCH_TOKENS_HELD} (limit: 1) for total
185
+ - Tokens created count: ${MCP_TOOLS.FETCH_TOKENS_CREATED} (limit: 1) for total
186
+
187
+ 3. Get wallet info:
188
+ - GalaChain address format: ${MCP_TOOLS.GET_ADDRESS}
189
+ - Ethereum address format: ${MCP_TOOLS.GET_ETHEREUM_ADDRESS}
190
+ - GALA balance: ${MCP_TOOLS.FETCH_GALA_BALANCE}
191
+
192
+ Display:
193
+ - Profile details
194
+ - Activity metrics
195
+ - Wallet addresses
196
+ - Current balance`),
197
+ };
198
+
199
+ /**
200
+ * Export all portfolio prompts
201
+ */
202
+ export const portfolioPrompts: MCPPrompt[] = [
203
+ portfolioPrompt,
204
+ tokensHeldPrompt,
205
+ tokensCreatedPrompt,
206
+ balancePrompt,
207
+ profilePrompt,
208
+ ];