@gala-chain/launchpad-mcp-server 1.23.0 → 1.23.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 (131) hide show
  1. package/DRY_REFACTORING_GUIDE.md +272 -0
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/prompts/analysis.d.ts.map +1 -1
  5. package/dist/prompts/analysis.js +14 -63
  6. package/dist/prompts/analysis.js.map +1 -1
  7. package/dist/prompts/balances.d.ts.map +1 -1
  8. package/dist/prompts/balances.js +46 -70
  9. package/dist/prompts/balances.js.map +1 -1
  10. package/dist/prompts/creation-utils.d.ts.map +1 -1
  11. package/dist/prompts/creation-utils.js +27 -50
  12. package/dist/prompts/creation-utils.js.map +1 -1
  13. package/dist/prompts/liquidity-positions.d.ts.map +1 -1
  14. package/dist/prompts/liquidity-positions.js +9 -44
  15. package/dist/prompts/liquidity-positions.js.map +1 -1
  16. package/dist/prompts/pools.d.ts.map +1 -1
  17. package/dist/prompts/pools.js +125 -228
  18. package/dist/prompts/pools.js.map +1 -1
  19. package/dist/prompts/portfolio.d.ts.map +1 -1
  20. package/dist/prompts/portfolio.js +13 -48
  21. package/dist/prompts/portfolio.js.map +1 -1
  22. package/dist/prompts/social.d.ts.map +1 -1
  23. package/dist/prompts/social.js +21 -31
  24. package/dist/prompts/social.js.map +1 -1
  25. package/dist/prompts/trading-calculations.d.ts.map +1 -1
  26. package/dist/prompts/trading-calculations.js +37 -126
  27. package/dist/prompts/trading-calculations.js.map +1 -1
  28. package/dist/prompts/trading.d.ts.map +1 -1
  29. package/dist/prompts/trading.js +23 -60
  30. package/dist/prompts/trading.js.map +1 -1
  31. package/dist/prompts/transfers.d.ts.map +1 -1
  32. package/dist/prompts/transfers.js +21 -31
  33. package/dist/prompts/transfers.js.map +1 -1
  34. package/dist/prompts/utility-tools.d.ts.map +1 -1
  35. package/dist/prompts/utility-tools.js +83 -202
  36. package/dist/prompts/utility-tools.js.map +1 -1
  37. package/dist/prompts/utility.d.ts.map +1 -1
  38. package/dist/prompts/utility.js +5 -20
  39. package/dist/prompts/utility.js.map +1 -1
  40. package/dist/prompts/utils/handlerHelpers.d.ts +35 -0
  41. package/dist/prompts/utils/handlerHelpers.d.ts.map +1 -0
  42. package/dist/prompts/utils/handlerHelpers.js +53 -0
  43. package/dist/prompts/utils/handlerHelpers.js.map +1 -0
  44. package/dist/prompts/utils/textTemplates.d.ts +42 -0
  45. package/dist/prompts/utils/textTemplates.d.ts.map +1 -0
  46. package/dist/prompts/utils/textTemplates.js +51 -0
  47. package/dist/prompts/utils/textTemplates.js.map +1 -0
  48. package/dist/utils/validation.d.ts +38 -0
  49. package/dist/utils/validation.d.ts.map +1 -1
  50. package/dist/utils/validation.js +52 -0
  51. package/dist/utils/validation.js.map +1 -1
  52. package/package.json +2 -2
  53. package/docs/AI-AGENT-PATTERNS.md +0 -555
  54. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  55. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  56. package/docs/examples/default-values-pattern.md +0 -240
  57. package/docs/examples/tool-factory-pattern.md +0 -217
  58. package/jest.config.js +0 -94
  59. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  60. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  61. package/src/__tests__/server.test.ts +0 -256
  62. package/src/constants/mcpToolNames.ts +0 -181
  63. package/src/index.ts +0 -19
  64. package/src/prompts/__tests__/promptStructure.test.ts +0 -137
  65. package/src/prompts/__tests__/registry.test.ts +0 -359
  66. package/src/prompts/analysis.ts +0 -429
  67. package/src/prompts/balances.ts +0 -198
  68. package/src/prompts/create-token.ts +0 -123
  69. package/src/prompts/creation-utils.ts +0 -118
  70. package/src/prompts/dex-trading.ts +0 -86
  71. package/src/prompts/discover-tokens.ts +0 -86
  72. package/src/prompts/index.ts +0 -175
  73. package/src/prompts/liquidity-positions.ts +0 -270
  74. package/src/prompts/pools.ts +0 -571
  75. package/src/prompts/portfolio.ts +0 -242
  76. package/src/prompts/social.ts +0 -100
  77. package/src/prompts/trading-calculations.ts +0 -499
  78. package/src/prompts/trading.ts +0 -191
  79. package/src/prompts/transfers.ts +0 -103
  80. package/src/prompts/utility-tools.ts +0 -349
  81. package/src/prompts/utility.ts +0 -92
  82. package/src/prompts/utils/workflowTemplates.ts +0 -511
  83. package/src/schemas/common-schemas.ts +0 -393
  84. package/src/scripts/test-all-prompts.ts +0 -184
  85. package/src/server.ts +0 -367
  86. package/src/tools/__tests__/dex-tools.test.ts +0 -562
  87. package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
  88. package/src/tools/balance/index.ts +0 -174
  89. package/src/tools/creation/index.ts +0 -182
  90. package/src/tools/dex/index.ts +0 -226
  91. package/src/tools/dex/liquidity-positions.ts +0 -547
  92. package/src/tools/index.ts +0 -94
  93. package/src/tools/pools/fetchAllPools.ts +0 -47
  94. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  95. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  96. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  97. package/src/tools/pools/fetchPools.ts +0 -47
  98. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  99. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  100. package/src/tools/pools/index.ts +0 -284
  101. package/src/tools/social/index.ts +0 -64
  102. package/src/tools/trading/index.ts +0 -605
  103. package/src/tools/transfers/index.ts +0 -75
  104. package/src/tools/utils/clearCache.ts +0 -36
  105. package/src/tools/utils/createWallet.ts +0 -19
  106. package/src/tools/utils/explainSdkUsage.ts +0 -1446
  107. package/src/tools/utils/getAddress.ts +0 -12
  108. package/src/tools/utils/getCacheInfo.ts +0 -14
  109. package/src/tools/utils/getConfig.ts +0 -21
  110. package/src/tools/utils/getEnvironment.ts +0 -17
  111. package/src/tools/utils/getEthereumAddress.ts +0 -12
  112. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  113. package/src/tools/utils/getVersion.ts +0 -25
  114. package/src/tools/utils/getWallet.ts +0 -25
  115. package/src/tools/utils/hasWallet.ts +0 -15
  116. package/src/tools/utils/index.ts +0 -37
  117. package/src/tools/utils/isTokenGraduated.ts +0 -16
  118. package/src/tools/utils/setWallet.ts +0 -41
  119. package/src/tools/utils/switchEnvironment.ts +0 -28
  120. package/src/types/mcp.ts +0 -72
  121. package/src/utils/__tests__/validation.test.ts +0 -147
  122. package/src/utils/constraints.ts +0 -155
  123. package/src/utils/default-values.ts +0 -208
  124. package/src/utils/error-handler.ts +0 -69
  125. package/src/utils/error-templates.ts +0 -273
  126. package/src/utils/response-formatter.ts +0 -51
  127. package/src/utils/tool-factory.ts +0 -303
  128. package/src/utils/tool-registry.ts +0 -296
  129. package/src/utils/validation.ts +0 -371
  130. package/tests/wallet-management-integration.test.ts +0 -284
  131. package/tsconfig.json +0 -23
@@ -1,499 +0,0 @@
1
- /**
2
- * Trading Calculations Prompts
3
- *
4
- * Slash commands for trading calculations, amounts, and related operations
5
- */
6
-
7
- import type { MCPPrompt } from '../types/mcp.js';
8
- import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
- import { validateTokenName, validateNumericAmount } from '../utils/validation.js';
10
-
11
- /**
12
- * Calculate Buy Amount - Buy cost calculation
13
- */
14
- export const calculateBuyAmountPrompt: MCPPrompt = {
15
- name: 'galachain-launchpad:calculate-buy-amount',
16
- description: 'Calculate token amounts and fees for buying',
17
- arguments: [
18
- {
19
- name: 'tokenName',
20
- description: 'Token name (e.g., anime, test216253)',
21
- required: true,
22
- },
23
- {
24
- name: 'amount',
25
- description: 'Amount in GALA to spend or exact token quantity',
26
- required: true,
27
- },
28
- {
29
- name: 'type',
30
- description: 'Type: native (spend GALA) or exact (buy exact tokens)',
31
- required: true,
32
- },
33
- ],
34
- handler: (args) => {
35
- validateTokenName(args.tokenName, 'tokenName');
36
- validateNumericAmount(args.amount, 'amount');
37
-
38
- return [
39
- {
40
- role: 'user',
41
- content: {
42
- type: 'text',
43
- text: `Calculate buy amount and fee breakdown.
44
-
45
- Token: ${args.tokenName}
46
- Amount: ${args.amount}
47
- Type: ${args.type}
48
-
49
- Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT} to get:
50
- - Exact token amount you'll receive
51
- - Transaction fee
52
- - Gas fee
53
- - Reverse bonding curve fee
54
-
55
- Display the complete cost breakdown.`,
56
- },
57
- },
58
- ];
59
- },
60
- };
61
-
62
- /**
63
- * Calculate Sell Amount - Sell proceeds calculation
64
- */
65
- export const calculateSellAmountPrompt: MCPPrompt = {
66
- name: 'galachain-launchpad:calculate-sell-amount',
67
- description: 'Calculate GALA amounts and fees for selling',
68
- arguments: [
69
- {
70
- name: 'tokenName',
71
- description: 'Token name (e.g., anime, test216253)',
72
- required: true,
73
- },
74
- {
75
- name: 'amount',
76
- description: 'Amount of GALA to receive or exact token quantity to sell',
77
- required: true,
78
- },
79
- {
80
- name: 'type',
81
- description: 'Type: native (receive GALA) or exact (sell exact tokens)',
82
- required: true,
83
- },
84
- ],
85
- handler: (args) => {
86
- validateTokenName(args.tokenName, 'tokenName');
87
- validateNumericAmount(args.amount, 'amount');
88
-
89
- return [
90
- {
91
- role: 'user',
92
- content: {
93
- type: 'text',
94
- text: `Calculate sell amount and fee breakdown.
95
-
96
- Token: ${args.tokenName}
97
- Amount: ${args.amount}
98
- Type: ${args.type}
99
-
100
- Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT} to get:
101
- - GALA amount you'll receive
102
- - Transaction fee
103
- - Gas fee
104
- - Reverse bonding curve fee
105
-
106
- Display the complete proceeds breakdown.`,
107
- },
108
- },
109
- ];
110
- },
111
- };
112
-
113
- /**
114
- * Fetch Trades - Trade history query
115
- */
116
- export const fetchTradesPrompt: MCPPrompt = {
117
- name: 'galachain-launchpad:fetch-trades',
118
- description: 'Query your trading history with optional filters',
119
- arguments: [
120
- {
121
- name: 'tokenName',
122
- description: 'Token name (e.g., anime)',
123
- required: false,
124
- },
125
- {
126
- name: 'tradeType',
127
- description: 'Filter: BUY or SELL',
128
- required: false,
129
- },
130
- {
131
- name: 'page',
132
- description: 'Page number (default: 1)',
133
- required: false,
134
- },
135
- {
136
- name: 'limit',
137
- description: 'Results per page (default: 20)',
138
- required: false,
139
- },
140
- ],
141
- handler: (args) => {
142
- if (args.tokenName) {
143
- validateTokenName(args.tokenName, 'tokenName');
144
- }
145
-
146
- return [
147
- {
148
- role: 'user',
149
- content: {
150
- type: 'text',
151
- text: `Fetch trading history.
152
-
153
- ${args.tokenName ? `Token: ${args.tokenName}` : ''}
154
- ${args.tradeType ? `Trade Type: ${args.tradeType}` : ''}
155
- Page: ${args.page || 1}
156
- Limit: ${args.limit || 20}
157
-
158
- Use ${MCP_TOOLS.FETCH_TRADES} to retrieve your trades.
159
-
160
- Display trade details including amounts, prices, and timestamps.`,
161
- },
162
- },
163
- ];
164
- },
165
- };
166
-
167
- /**
168
- * Calculate Initial Buy - Pre-buy calculation
169
- */
170
- export const calculateInitialBuyPrompt: MCPPrompt = {
171
- name: 'galachain-launchpad:calculate-initial-buy',
172
- description: 'Calculate pre-buy amounts during token creation',
173
- arguments: [
174
- {
175
- name: 'amount',
176
- description: 'GALA amount to spend for initial buy',
177
- required: true,
178
- },
179
- ],
180
- handler: (args) => {
181
- validateNumericAmount(args.amount, 'amount');
182
-
183
- return [
184
- {
185
- role: 'user',
186
- content: {
187
- type: 'text',
188
- text: `Calculate pre-buy amounts for token creation.
189
-
190
- GALA Amount: ${args.amount}
191
-
192
- Use ${MCP_TOOLS.CALCULATE_INITIAL_BUY} to calculate:
193
- - Token quantity from initial buy
194
- - Applied fees and costs
195
-
196
- Display the calculated results.`,
197
- },
198
- },
199
- ];
200
- },
201
- };
202
-
203
- /**
204
- * Get Bundler Transaction Result - Transaction status lookup
205
- */
206
- export const getBundlerTransactionResultPrompt: MCPPrompt = {
207
- name: 'galachain-launchpad:get-bundler-transaction-result',
208
- description: 'Check bundler transaction status by ID',
209
- arguments: [
210
- {
211
- name: 'transactionId',
212
- description: 'Transaction ID (UUID format)',
213
- required: true,
214
- },
215
- ],
216
- handler: (args) => {
217
- return [
218
- {
219
- role: 'user',
220
- content: {
221
- type: 'text',
222
- text: `Get bundler transaction result.
223
-
224
- Transaction ID: ${args.transactionId}
225
-
226
- Use ${MCP_TOOLS.GET_BUNDLER_TRANSACTION_RESULT} to check:
227
- - Current transaction status (PENDING, PROCESSING, COMPLETED, FAILED)
228
- - Transaction method
229
- - Metadata
230
-
231
- Display the transaction status clearly.`,
232
- },
233
- },
234
- ];
235
- },
236
- };
237
-
238
- /**
239
- * Calculate Buy Amount for Graduation - Graduation cost
240
- */
241
- export const calculateBuyAmountForGraduationPrompt: MCPPrompt = {
242
- name: 'galachain-launchpad:calculate-graduation-cost',
243
- description: 'Calculate cost to graduate a token pool to DEX',
244
- arguments: [
245
- {
246
- name: 'tokenName',
247
- description: 'Token name (e.g., anime, test216253)',
248
- required: true,
249
- },
250
- ],
251
- handler: (args) => {
252
- validateTokenName(args.tokenName, 'tokenName');
253
-
254
- return [
255
- {
256
- role: 'user',
257
- content: {
258
- type: 'text',
259
- text: `Calculate graduation cost for token pool.
260
-
261
- Token: ${args.tokenName}
262
-
263
- Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION} to determine:
264
- - GALA cost to buy all remaining tokens
265
- - Transaction and gas fees
266
- - Complete cost breakdown
267
-
268
- Display how much GALA is needed to graduate this token.`,
269
- },
270
- },
271
- ];
272
- },
273
- };
274
-
275
- /**
276
- * Calculate Buy Amount (Local) - LOCAL bonding curve calc
277
- */
278
- export const calculateBuyAmountLocalPrompt: MCPPrompt = {
279
- name: 'galachain-launchpad:calculate-buy-amount-local',
280
- description: 'Calculate buy amount using LOCAL bonding curve (instant, no network)',
281
- arguments: [
282
- {
283
- name: 'tokenName',
284
- description: 'Token name (e.g., anime, test216253)',
285
- required: true,
286
- },
287
- {
288
- name: 'amount',
289
- description: 'Amount in GALA to spend',
290
- required: true,
291
- },
292
- ],
293
- handler: (args) => {
294
- validateTokenName(args.tokenName, 'tokenName');
295
- validateNumericAmount(args.amount, 'amount');
296
-
297
- return [
298
- {
299
- role: 'user',
300
- content: {
301
- type: 'text',
302
- text: `Calculate buy amount using LOCAL bonding curve formula.
303
-
304
- Token: ${args.tokenName}
305
- Amount: ${args.amount} GALA
306
-
307
- Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_LOCAL} for instant calculation:
308
- - Uses client-side exponential bonding curve formula
309
- - No network call required
310
- - Results within <0.01% of external calculation
311
-
312
- Perfect for price discovery and UI updates.`,
313
- },
314
- },
315
- ];
316
- },
317
- };
318
-
319
- /**
320
- * Calculate Buy Amount (External) - EXTERNAL bonding curve calc
321
- */
322
- export const calculateBuyAmountExternalPrompt: MCPPrompt = {
323
- name: 'galachain-launchpad:calculate-buy-amount-external',
324
- description: 'Calculate buy amount using EXTERNAL GalaChain call (real-time)',
325
- arguments: [
326
- {
327
- name: 'tokenName',
328
- description: 'Token name (e.g., anime, test216253)',
329
- required: true,
330
- },
331
- {
332
- name: 'amount',
333
- description: 'Amount in GALA to spend',
334
- required: true,
335
- },
336
- ],
337
- handler: (args) => {
338
- validateTokenName(args.tokenName, 'tokenName');
339
- validateNumericAmount(args.amount, 'amount');
340
-
341
- return [
342
- {
343
- role: 'user',
344
- content: {
345
- type: 'text',
346
- text: `Calculate buy amount using EXTERNAL GalaChain network call.
347
-
348
- Token: ${args.tokenName}
349
- Amount: ${args.amount} GALA
350
-
351
- Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_EXTERNAL} for real-time calculation:
352
- - Queries GalaChain network for current pricing
353
- - Most accurate pricing available
354
- - Includes reverse bonding curve fees
355
-
356
- Use this for precise trading decisions.`,
357
- },
358
- },
359
- ];
360
- },
361
- };
362
-
363
- /**
364
- * Calculate Sell Amount (Local) - LOCAL sell calc
365
- */
366
- export const calculateSellAmountLocalPrompt: MCPPrompt = {
367
- name: 'galachain-launchpad:calculate-sell-amount-local',
368
- description: 'Calculate sell amount using LOCAL bonding curve (instant)',
369
- arguments: [
370
- {
371
- name: 'tokenName',
372
- description: 'Token name (e.g., anime, test216253)',
373
- required: true,
374
- },
375
- {
376
- name: 'amount',
377
- description: 'Exact token amount to sell',
378
- required: true,
379
- },
380
- ],
381
- handler: (args) => {
382
- validateTokenName(args.tokenName, 'tokenName');
383
- validateNumericAmount(args.amount, 'amount');
384
-
385
- return [
386
- {
387
- role: 'user',
388
- content: {
389
- type: 'text',
390
- text: `Calculate sell proceeds using LOCAL bonding curve formula.
391
-
392
- Token: ${args.tokenName}
393
- Sell Amount: ${args.amount} tokens
394
-
395
- Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT_LOCAL} for instant calculation:
396
- - Uses client-side bonding curve formula
397
- - Requires pool details (fetch separately)
398
- - No network call required
399
-
400
- Display the expected GALA proceeds.`,
401
- },
402
- },
403
- ];
404
- },
405
- };
406
-
407
- /**
408
- * Calculate Sell Amount (External) - EXTERNAL sell calc
409
- */
410
- export const calculateSellAmountExternalPrompt: MCPPrompt = {
411
- name: 'galachain-launchpad:calculate-sell-amount-external',
412
- description: 'Calculate sell amount using EXTERNAL GalaChain call (real-time)',
413
- arguments: [
414
- {
415
- name: 'tokenName',
416
- description: 'Token name (e.g., anime, test216253)',
417
- required: true,
418
- },
419
- {
420
- name: 'amount',
421
- description: 'Exact token amount to sell',
422
- required: true,
423
- },
424
- ],
425
- handler: (args) => {
426
- validateTokenName(args.tokenName, 'tokenName');
427
- validateNumericAmount(args.amount, 'amount');
428
-
429
- return [
430
- {
431
- role: 'user',
432
- content: {
433
- type: 'text',
434
- text: `Calculate sell proceeds using EXTERNAL GalaChain network call.
435
-
436
- Token: ${args.tokenName}
437
- Sell Amount: ${args.amount} tokens
438
-
439
- Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT_EXTERNAL} for real-time calculation:
440
- - Queries GalaChain network for current pricing
441
- - Most accurate pricing available
442
- - Includes reverse bonding curve fees
443
-
444
- Use this for precise selling decisions.`,
445
- },
446
- },
447
- ];
448
- },
449
- };
450
-
451
- /**
452
- * Is Token Graduated - Graduation status check
453
- */
454
- export const isTokenGraduatedPrompt: MCPPrompt = {
455
- name: 'galachain-launchpad:is-token-graduated',
456
- description: 'Check if a token has completed bonding curve and graduated to DEX',
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, 'tokenName');
466
-
467
- return [
468
- {
469
- role: 'user',
470
- content: {
471
- type: 'text',
472
- text: `Check token graduation status.
473
-
474
- Token: ${args.tokenName}
475
-
476
- Use ${MCP_TOOLS.IS_TOKEN_GRADUATED} to determine:
477
- - Whether token has completed bonding curve
478
- - Whether token is now trading on full DEX
479
-
480
- Display the graduation status clearly.`,
481
- },
482
- },
483
- ];
484
- },
485
- };
486
-
487
- export const tradingCalculationPrompts: MCPPrompt[] = [
488
- calculateBuyAmountPrompt,
489
- calculateSellAmountPrompt,
490
- fetchTradesPrompt,
491
- calculateInitialBuyPrompt,
492
- getBundlerTransactionResultPrompt,
493
- calculateBuyAmountForGraduationPrompt,
494
- calculateBuyAmountLocalPrompt,
495
- calculateBuyAmountExternalPrompt,
496
- calculateSellAmountLocalPrompt,
497
- calculateSellAmountExternalPrompt,
498
- isTokenGraduatedPrompt,
499
- ];
@@ -1,191 +0,0 @@
1
- /**
2
- * Trading Prompts
3
- *
4
- * Slash commands for trading operations on Gala Launchpad
5
- */
6
-
7
- import type { MCPPrompt } from '../types/mcp.js';
8
- import {
9
- createTradingWorkflow,
10
- createAnalysisWorkflow,
11
- } from './utils/workflowTemplates.js';
12
- import { validateTokenName, validateNumericAmount, validateSlippage } from '../utils/validation.js';
13
-
14
- /**
15
- * Analyze Token - Complete token analysis workflow
16
- */
17
- export const analyzeTokenPrompt: MCPPrompt = {
18
- name: 'galachain-launchpad:analyze-token',
19
- description:
20
- 'Perform comprehensive analysis of a Launchpad token including pool details, spot price, and graduation cost',
21
- arguments: [
22
- {
23
- name: 'tokenName',
24
- description: 'Token name to analyze (e.g., anime, test216253)',
25
- required: true,
26
- },
27
- ],
28
- handler: (args) => {
29
- // Validate inputs
30
- validateTokenName(args.tokenName);
31
-
32
- return [
33
- {
34
- role: 'user',
35
- content: {
36
- type: 'text',
37
- text: createAnalysisWorkflow(args.tokenName),
38
- },
39
- },
40
- ];
41
- },
42
- };
43
-
44
- /**
45
- * Buy Tokens - Guided token purchase workflow
46
- */
47
- export const buyTokensPrompt: MCPPrompt = {
48
- name: 'galachain-launchpad:buy-tokens',
49
- description: 'Guide user through buying tokens with slippage protection and cost breakdown',
50
- arguments: [
51
- {
52
- name: 'tokenName',
53
- description: 'Token to buy (e.g., anime)',
54
- required: true,
55
- },
56
- {
57
- name: 'galaAmount',
58
- description: 'GALA amount to spend (e.g., 100)',
59
- required: true,
60
- },
61
- {
62
- name: 'slippage',
63
- description: 'Slippage tolerance percentage (default: 1)',
64
- required: false,
65
- },
66
- ],
67
- handler: (args) => {
68
- // Validate inputs
69
- validateTokenName(args.tokenName);
70
- validateNumericAmount(args.galaAmount, 'galaAmount');
71
- if (args.slippage) {
72
- validateSlippage(args.slippage);
73
- }
74
-
75
- return [
76
- {
77
- role: 'user',
78
- content: {
79
- type: 'text',
80
- text: createTradingWorkflow({
81
- operation: 'buy',
82
- tokenName: args.tokenName,
83
- amount: args.galaAmount,
84
- amountType: 'gala',
85
- slippage: args.slippage || '1',
86
- }),
87
- },
88
- },
89
- ];
90
- },
91
- };
92
-
93
- /**
94
- * Sell Tokens - Guided token sale workflow
95
- */
96
- export const sellTokensPrompt: MCPPrompt = {
97
- name: 'galachain-launchpad:sell-tokens',
98
- description: 'Guide user through selling tokens with slippage protection',
99
- arguments: [
100
- {
101
- name: 'tokenName',
102
- description: 'Token to sell (e.g., anime)',
103
- required: true,
104
- },
105
- {
106
- name: 'tokenAmount',
107
- description: 'Token amount to sell (e.g., 1000)',
108
- required: true,
109
- },
110
- {
111
- name: 'slippage',
112
- description: 'Slippage tolerance percentage (default: 1)',
113
- required: false,
114
- },
115
- ],
116
- handler: (args) => {
117
- // Validate inputs
118
- validateTokenName(args.tokenName);
119
- validateNumericAmount(args.tokenAmount, 'tokenAmount');
120
- if (args.slippage) {
121
- validateSlippage(args.slippage);
122
- }
123
-
124
- return [
125
- {
126
- role: 'user',
127
- content: {
128
- type: 'text',
129
- text: createTradingWorkflow({
130
- operation: 'sell',
131
- tokenName: args.tokenName,
132
- amount: args.tokenAmount,
133
- slippage: args.slippage || '1',
134
- }),
135
- },
136
- },
137
- ];
138
- },
139
- };
140
-
141
- /**
142
- * Graduate Token - One-step graduation workflow
143
- */
144
- export const graduateTokenPrompt: MCPPrompt = {
145
- name: 'galachain-launchpad:graduate-token',
146
- description:
147
- 'Graduate a bonding curve pool by buying all remaining tokens in one transaction',
148
- arguments: [
149
- {
150
- name: 'tokenName',
151
- description: 'Token to graduate (e.g., anime)',
152
- required: true,
153
- },
154
- {
155
- name: 'slippage',
156
- description: 'Slippage tolerance percentage (default: 1)',
157
- required: false,
158
- },
159
- ],
160
- handler: (args) => {
161
- // Validate inputs
162
- validateTokenName(args.tokenName);
163
- if (args.slippage) {
164
- validateSlippage(args.slippage);
165
- }
166
-
167
- return [
168
- {
169
- role: 'user',
170
- content: {
171
- type: 'text',
172
- text: createTradingWorkflow({
173
- operation: 'graduate',
174
- tokenName: args.tokenName,
175
- slippage: args.slippage || '1',
176
- }),
177
- },
178
- },
179
- ];
180
- },
181
- };
182
-
183
- /**
184
- * Export all trading prompts
185
- */
186
- export const tradingPrompts: MCPPrompt[] = [
187
- analyzeTokenPrompt,
188
- buyTokensPrompt,
189
- sellTokensPrompt,
190
- graduateTokenPrompt,
191
- ];