@gala-chain/launchpad-mcp-server 1.17.6 → 1.17.7
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.
- package/CHANGELOG.md +72 -0
- package/README.md +47 -9
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +48 -16
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +2 -2
- package/dist/tools/utils/getWallet.d.ts +8 -0
- package/dist/tools/utils/getWallet.d.ts.map +1 -0
- package/dist/tools/utils/getWallet.js +27 -0
- package/dist/tools/utils/getWallet.js.map +1 -0
- package/dist/tools/utils/hasWallet.d.ts +8 -0
- package/dist/tools/utils/hasWallet.d.ts.map +1 -0
- package/dist/tools/utils/hasWallet.js +17 -0
- package/dist/tools/utils/hasWallet.js.map +1 -0
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +6 -0
- package/dist/tools/utils/index.js.map +1 -1
- package/dist/tools/utils/setWallet.d.ts +8 -0
- package/dist/tools/utils/setWallet.d.ts.map +1 -0
- package/dist/tools/utils/setWallet.js +40 -0
- package/dist/tools/utils/setWallet.js.map +1 -0
- package/docs/AI-AGENT-PATTERNS.md +555 -0
- package/docs/CONSTRAINTS-REFERENCE.md +454 -0
- package/docs/PROMPT-TOOL-MAPPING.md +352 -0
- package/docs/examples/default-values-pattern.md +240 -0
- package/docs/examples/tool-factory-pattern.md +217 -0
- package/jest.config.js +94 -0
- package/package.json +13 -4
- package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +258 -0
- package/src/__tests__/integration/poolTools.integration.test.ts +185 -0
- package/src/constants/mcpToolNames.ts +141 -0
- package/src/index.ts +19 -0
- package/src/prompts/__tests__/promptStructure.test.ts +114 -0
- package/src/prompts/__tests__/registry.test.ts +145 -0
- package/src/prompts/analysis.ts +429 -0
- package/src/prompts/index.ts +127 -0
- package/src/prompts/portfolio.ts +242 -0
- package/src/prompts/trading.ts +191 -0
- package/src/prompts/utility.ts +43 -0
- package/src/prompts/utils/workflowTemplates.ts +344 -0
- package/src/schemas/common-schemas.ts +393 -0
- package/src/scripts/test-all-prompts.ts +184 -0
- package/src/server.ts +277 -0
- package/src/tools/balance/index.ts +174 -0
- package/src/tools/creation/index.ts +182 -0
- package/src/tools/index.ts +80 -0
- package/src/tools/pools/fetchAllPools.ts +47 -0
- package/src/tools/pools/fetchAllPriceHistory.ts +119 -0
- package/src/tools/pools/fetchPoolDetails.ts +27 -0
- package/src/tools/pools/fetchPoolDetailsForCalculation.ts +22 -0
- package/src/tools/pools/fetchPools.ts +47 -0
- package/src/tools/pools/fetchPriceHistory.ts +124 -0
- package/src/tools/pools/fetchTokenDetails.ts +77 -0
- package/src/tools/pools/index.ts +284 -0
- package/src/tools/social/index.ts +64 -0
- package/src/tools/trading/index.ts +605 -0
- package/src/tools/transfers/index.ts +75 -0
- package/src/tools/utils/clearCache.ts +36 -0
- package/src/tools/utils/createWallet.ts +19 -0
- package/src/tools/utils/explainSdkUsage.ts +1420 -0
- package/src/tools/utils/getAddress.ts +12 -0
- package/src/tools/utils/getCacheInfo.ts +14 -0
- package/src/tools/utils/getConfig.ts +11 -0
- package/src/tools/utils/getEthereumAddress.ts +12 -0
- package/src/tools/utils/getUrlByTokenName.ts +12 -0
- package/src/tools/utils/getVersion.ts +25 -0
- package/src/tools/utils/getWallet.ts +25 -0
- package/src/tools/utils/hasWallet.ts +15 -0
- package/src/tools/utils/index.ts +33 -0
- package/src/tools/utils/isTokenGraduated.ts +16 -0
- package/src/tools/utils/setWallet.ts +41 -0
- package/src/types/mcp.ts +72 -0
- package/src/utils/__tests__/validation.test.ts +147 -0
- package/src/utils/constraints.ts +155 -0
- package/src/utils/default-values.ts +208 -0
- package/src/utils/error-handler.ts +69 -0
- package/src/utils/error-templates.ts +273 -0
- package/src/utils/response-formatter.ts +51 -0
- package/src/utils/tool-factory.ts +257 -0
- package/src/utils/tool-registry.ts +296 -0
- package/src/utils/validation.ts +336 -0
- package/tests/wallet-management-integration.test.ts +284 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for token analysis and comparison on Gala Launchpad
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
+
import { validateTokenName, validateTokenList, validatePaginationLimit } from '../utils/validation.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Compare Tokens - Side-by-side comparison
|
|
13
|
+
*/
|
|
14
|
+
export const compareTokensPrompt: MCPPrompt = {
|
|
15
|
+
name: 'galachain-launchpad:compare-tokens',
|
|
16
|
+
description: 'Compare two Launchpad tokens side-by-side with detailed metrics',
|
|
17
|
+
arguments: [
|
|
18
|
+
{
|
|
19
|
+
name: 'token1',
|
|
20
|
+
description: 'First token to compare (e.g., anime)',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'token2',
|
|
25
|
+
description: 'Second token to compare (e.g., test216253)',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
handler: (args) => {
|
|
30
|
+
// Validate inputs
|
|
31
|
+
validateTokenName(args.token1, 'token1');
|
|
32
|
+
validateTokenName(args.token2, 'token2');
|
|
33
|
+
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
role: 'user',
|
|
37
|
+
content: {
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: `Compare two Launchpad tokens side-by-side:
|
|
40
|
+
|
|
41
|
+
Token 1: ${args.token1}
|
|
42
|
+
Token 2: ${args.token2}
|
|
43
|
+
|
|
44
|
+
For EACH token, use the optimized pattern:
|
|
45
|
+
|
|
46
|
+
1. Fetch pool details using ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
47
|
+
|
|
48
|
+
2. Calculate metrics using LOCAL mode:
|
|
49
|
+
- Spot price: ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE}
|
|
50
|
+
- Graduation cost: ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION}
|
|
51
|
+
- Is graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
52
|
+
|
|
53
|
+
3. Get additional data:
|
|
54
|
+
- Full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
55
|
+
- Token distribution: ${MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION}
|
|
56
|
+
- Badges: ${MCP_TOOLS.FETCH_TOKEN_BADGES}
|
|
57
|
+
|
|
58
|
+
Present a comparison table:
|
|
59
|
+
|
|
60
|
+
| Metric | ${args.token1} | ${args.token2} |
|
|
61
|
+
|--------|--------|--------|
|
|
62
|
+
| Spot Price (USD) | ... | ... |
|
|
63
|
+
| Market Cap Estimate | ... | ... |
|
|
64
|
+
| Pool Status | ... | ... |
|
|
65
|
+
| Progress to Graduation | ... | ... |
|
|
66
|
+
| Remaining Tokens | ... | ... |
|
|
67
|
+
| GALA to Graduate | ... | ... |
|
|
68
|
+
| Holder Count | ... | ... |
|
|
69
|
+
| Creator Status | ... | ... |
|
|
70
|
+
|
|
71
|
+
Provide analysis:
|
|
72
|
+
- Which token is closer to graduation?
|
|
73
|
+
- Which has better liquidity?
|
|
74
|
+
- Which might be a better investment and why?
|
|
75
|
+
- Any notable badges or achievements?`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Graduation Status - Check multiple tokens for graduation readiness
|
|
84
|
+
*/
|
|
85
|
+
export const graduationStatusPrompt: MCPPrompt = {
|
|
86
|
+
name: 'galachain-launchpad:graduation-status',
|
|
87
|
+
description: 'Check graduation status and readiness for multiple tokens',
|
|
88
|
+
arguments: [
|
|
89
|
+
{
|
|
90
|
+
name: 'tokens',
|
|
91
|
+
description: 'Comma-separated token names (e.g., anime,test216253,dragnrkti)',
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
handler: (args) => {
|
|
96
|
+
// Validate inputs
|
|
97
|
+
const tokenArray = validateTokenList(args.tokens);
|
|
98
|
+
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
role: 'user',
|
|
102
|
+
content: {
|
|
103
|
+
type: 'text',
|
|
104
|
+
text: `Check graduation status for multiple tokens:
|
|
105
|
+
|
|
106
|
+
Tokens: ${args.tokens}
|
|
107
|
+
|
|
108
|
+
For EACH token in the list:
|
|
109
|
+
|
|
110
|
+
1. Check if graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
111
|
+
|
|
112
|
+
2. If not graduated, use optimized pattern:
|
|
113
|
+
a. Fetch pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
114
|
+
b. Calculate graduation cost: ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION} (LOCAL mode)
|
|
115
|
+
c. Calculate progress: (currentSupply / maxSupply * 100)
|
|
116
|
+
|
|
117
|
+
3. Get full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
118
|
+
|
|
119
|
+
Present a table:
|
|
120
|
+
|
|
121
|
+
| Token | Status | Progress | Remaining Tokens | GALA to Graduate | Frontend URL |
|
|
122
|
+
|-------|--------|----------|------------------|------------------|--------------|
|
|
123
|
+
| ... | ... | ... | ... | ... | ... |
|
|
124
|
+
|
|
125
|
+
Summary:
|
|
126
|
+
- Total tokens analyzed: ${tokenArray.length}
|
|
127
|
+
- Already graduated: [count]
|
|
128
|
+
- Close to graduation (>90%): [count]
|
|
129
|
+
- Mid-progress (50-90%): [count]
|
|
130
|
+
- Early stage (<50%): [count]
|
|
131
|
+
|
|
132
|
+
Provide recommendations:
|
|
133
|
+
- Which tokens are good graduation opportunities?
|
|
134
|
+
- Which tokens might be undervalued?`,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Spot Prices - Batch spot price lookup
|
|
143
|
+
*/
|
|
144
|
+
export const spotPricesPrompt: MCPPrompt = {
|
|
145
|
+
name: 'galachain-launchpad:spot-prices',
|
|
146
|
+
description: 'Get spot prices for multiple Launchpad tokens efficiently',
|
|
147
|
+
arguments: [
|
|
148
|
+
{
|
|
149
|
+
name: 'tokens',
|
|
150
|
+
description: 'Comma-separated token names (e.g., anime,test216253,dragnrkti)',
|
|
151
|
+
required: true,
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
handler: (args) => {
|
|
155
|
+
// Validate inputs
|
|
156
|
+
validateTokenList(args.tokens);
|
|
157
|
+
|
|
158
|
+
return [
|
|
159
|
+
{
|
|
160
|
+
role: 'user',
|
|
161
|
+
content: {
|
|
162
|
+
type: 'text',
|
|
163
|
+
text: `Get spot prices for multiple Launchpad tokens:
|
|
164
|
+
|
|
165
|
+
Tokens: ${args.tokens}
|
|
166
|
+
|
|
167
|
+
Use the optimized batch pattern for EACH token:
|
|
168
|
+
|
|
169
|
+
1. Fetch pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
170
|
+
2. Calculate spot price: ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE} (LOCAL mode)
|
|
171
|
+
|
|
172
|
+
Also get GALA spot price: ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE}
|
|
173
|
+
|
|
174
|
+
Present results:
|
|
175
|
+
|
|
176
|
+
**GALA Spot Price:** $[price]
|
|
177
|
+
|
|
178
|
+
**Launchpad Token Prices:**
|
|
179
|
+
| Token | USD Price | GALA Price | Market Cap Est. |
|
|
180
|
+
|-------|-----------|------------|-----------------|
|
|
181
|
+
| ... | ... | ... | ... |
|
|
182
|
+
|
|
183
|
+
Performance note: Using LOCAL calculations - instant results with <0.01% difference from external!
|
|
184
|
+
|
|
185
|
+
Sort by USD price (highest to lowest).`,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Pool Details - Comprehensive pool information
|
|
194
|
+
*/
|
|
195
|
+
export const poolDetailsPrompt: MCPPrompt = {
|
|
196
|
+
name: 'galachain-launchpad:pool-details',
|
|
197
|
+
description: 'Get comprehensive pool information including distribution and badges',
|
|
198
|
+
arguments: [
|
|
199
|
+
{
|
|
200
|
+
name: 'tokenName',
|
|
201
|
+
description: 'Token to analyze (e.g., anime)',
|
|
202
|
+
required: true,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
handler: (args) => {
|
|
206
|
+
// Validate inputs
|
|
207
|
+
validateTokenName(args.tokenName);
|
|
208
|
+
|
|
209
|
+
return [
|
|
210
|
+
{
|
|
211
|
+
role: 'user',
|
|
212
|
+
content: {
|
|
213
|
+
type: 'text',
|
|
214
|
+
text: `Get comprehensive pool information for "${args.tokenName}":
|
|
215
|
+
|
|
216
|
+
1. Full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
217
|
+
2. Token distribution: ${MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION}
|
|
218
|
+
3. Achievement badges: ${MCP_TOOLS.FETCH_TOKEN_BADGES}
|
|
219
|
+
4. Recent volume data (last 24h): ${MCP_TOOLS.FETCH_VOLUME_DATA} with 1h resolution
|
|
220
|
+
5. Check if graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
221
|
+
6. Frontend URL: ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME}
|
|
222
|
+
|
|
223
|
+
Display organized sections:
|
|
224
|
+
|
|
225
|
+
**Basic Info:**
|
|
226
|
+
- Token name and symbol
|
|
227
|
+
- Pool status
|
|
228
|
+
- Created by
|
|
229
|
+
- Frontend URL
|
|
230
|
+
|
|
231
|
+
**Supply Metrics:**
|
|
232
|
+
- Current supply
|
|
233
|
+
- Maximum supply
|
|
234
|
+
- Remaining tokens
|
|
235
|
+
- Progress percentage
|
|
236
|
+
|
|
237
|
+
**Distribution:**
|
|
238
|
+
- Total holders
|
|
239
|
+
- Top holders (if available)
|
|
240
|
+
- Distribution metrics
|
|
241
|
+
|
|
242
|
+
**Achievements:**
|
|
243
|
+
- Volume badges
|
|
244
|
+
- Engagement badges
|
|
245
|
+
- Other achievements
|
|
246
|
+
|
|
247
|
+
**Recent Activity (24h):**
|
|
248
|
+
- Trading volume
|
|
249
|
+
- Price movement
|
|
250
|
+
- Number of trades
|
|
251
|
+
|
|
252
|
+
**Reverse Bonding Curve:**
|
|
253
|
+
- Max fee factor
|
|
254
|
+
- Min fee factor
|
|
255
|
+
- Current fee structure`,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
];
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Trade History - Recent trades with filters
|
|
264
|
+
*/
|
|
265
|
+
export const tradeHistoryPrompt: MCPPrompt = {
|
|
266
|
+
name: 'galachain-launchpad:trade-history',
|
|
267
|
+
description: 'View recent trades for a token or user with filtering options',
|
|
268
|
+
arguments: [
|
|
269
|
+
{
|
|
270
|
+
name: 'tokenName',
|
|
271
|
+
description: 'Token to view trades for (optional)',
|
|
272
|
+
required: false,
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'userAddress',
|
|
276
|
+
description: 'User address to filter by (optional)',
|
|
277
|
+
required: false,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'tradeType',
|
|
281
|
+
description: 'Trade type filter: BUY or SELL (optional)',
|
|
282
|
+
required: false,
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'limit',
|
|
286
|
+
description: 'Number of trades to show (default: 20)',
|
|
287
|
+
required: false,
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
handler: (args) => {
|
|
291
|
+
// Validate inputs
|
|
292
|
+
if (args.tokenName) {
|
|
293
|
+
validateTokenName(args.tokenName);
|
|
294
|
+
}
|
|
295
|
+
if (args.limit) {
|
|
296
|
+
validatePaginationLimit(args.limit, 20);
|
|
297
|
+
}
|
|
298
|
+
if (args.tradeType && args.tradeType !== 'BUY' && args.tradeType !== 'SELL') {
|
|
299
|
+
throw new Error('tradeType must be either BUY or SELL');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const limit = args.limit || '20';
|
|
303
|
+
|
|
304
|
+
return [
|
|
305
|
+
{
|
|
306
|
+
role: 'user',
|
|
307
|
+
content: {
|
|
308
|
+
type: 'text',
|
|
309
|
+
text: `Show recent trade history:
|
|
310
|
+
|
|
311
|
+
${args.tokenName ? `Token: ${args.tokenName}` : 'All tokens'}
|
|
312
|
+
${args.userAddress ? `User: ${args.userAddress}` : 'All users'}
|
|
313
|
+
${args.tradeType ? `Type: ${args.tradeType}` : 'All trade types'}
|
|
314
|
+
Limit: ${limit}
|
|
315
|
+
|
|
316
|
+
Use ${MCP_TOOLS.FETCH_TRADES} with:
|
|
317
|
+
${args.tokenName ? `- tokenName: "${args.tokenName}"` : ''}
|
|
318
|
+
${args.userAddress ? `- userAddress: "${args.userAddress}"` : ''}
|
|
319
|
+
${args.tradeType ? `- tradeType: "${args.tradeType}"` : ''}
|
|
320
|
+
- limit: ${limit}
|
|
321
|
+
- sortOrder: "DESC" (newest first)
|
|
322
|
+
|
|
323
|
+
For each trade, display:
|
|
324
|
+
- Timestamp (formatted)
|
|
325
|
+
- Token name
|
|
326
|
+
- Trade type (BUY/SELL)
|
|
327
|
+
- Amount (tokens)
|
|
328
|
+
- Price (GALA)
|
|
329
|
+
- User address (truncated)
|
|
330
|
+
- Transaction ID
|
|
331
|
+
|
|
332
|
+
Calculate summary:
|
|
333
|
+
- Total trades shown
|
|
334
|
+
- Total volume (GALA)
|
|
335
|
+
- Average trade size
|
|
336
|
+
- Buy vs Sell ratio (if not filtered)`,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
];
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Fetch All Pools - Get all available pools with automatic pagination
|
|
345
|
+
*/
|
|
346
|
+
export const fetchAllPoolsPrompt: MCPPrompt = {
|
|
347
|
+
name: 'galachain-launchpad:fetch-all-pools',
|
|
348
|
+
description: 'Fetch all available Launchpad pools with automatic pagination (no limit needed)',
|
|
349
|
+
arguments: [
|
|
350
|
+
{
|
|
351
|
+
name: 'search',
|
|
352
|
+
description: 'Optional search filter for token names (fuzzy match)',
|
|
353
|
+
required: false,
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: 'type',
|
|
357
|
+
description: 'Pool type filter: recent or popular (optional, default: recent)',
|
|
358
|
+
required: false,
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
handler: (args) => {
|
|
362
|
+
// Validate type if provided
|
|
363
|
+
if (args.type && args.type !== 'recent' && args.type !== 'popular') {
|
|
364
|
+
throw new Error('type must be either "recent" or "popular"');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const searchFilter = args.search
|
|
368
|
+
? `- search: "${args.search}" (fuzzy match filter)`
|
|
369
|
+
: '- No search filter';
|
|
370
|
+
const typeFilter = args.type ? args.type : 'recent';
|
|
371
|
+
|
|
372
|
+
return [
|
|
373
|
+
{
|
|
374
|
+
role: 'user',
|
|
375
|
+
content: {
|
|
376
|
+
type: 'text',
|
|
377
|
+
text: `Fetch ALL available Launchpad pools with automatic pagination:
|
|
378
|
+
|
|
379
|
+
Use ${MCP_TOOLS.FETCH_ALL_POOLS} with:
|
|
380
|
+
${searchFilter}
|
|
381
|
+
- type: "${typeFilter}"
|
|
382
|
+
|
|
383
|
+
This tool automatically:
|
|
384
|
+
- Fetches the first page to determine total available pools
|
|
385
|
+
- Concurrently fetches remaining pages (up to 5 at a time)
|
|
386
|
+
- Returns ALL matching pools in a single result
|
|
387
|
+
|
|
388
|
+
For each pool, display:
|
|
389
|
+
- Token name and symbol
|
|
390
|
+
- Pool status (Ongoing/Completed)
|
|
391
|
+
- Current price (if available)
|
|
392
|
+
- Progress percentage
|
|
393
|
+
- Creator address (truncated)
|
|
394
|
+
- Frontend URL (use ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME})
|
|
395
|
+
|
|
396
|
+
Provide summary:
|
|
397
|
+
- Total pools found
|
|
398
|
+
- How many are graduated (Completed)
|
|
399
|
+
- How many are active (Ongoing)
|
|
400
|
+
- Distribution by progress stage:
|
|
401
|
+
* Early (<25%)
|
|
402
|
+
* Growing (25-75%)
|
|
403
|
+
* Near graduation (75-99%)
|
|
404
|
+
* Graduated (100%)
|
|
405
|
+
|
|
406
|
+
Performance note:
|
|
407
|
+
- Uses concurrent fetching with ${MCP_TOOLS.FETCH_ALL_POOLS}
|
|
408
|
+
- Max 5 concurrent requests to avoid rate limiting
|
|
409
|
+
- Automatic cache warming for token metadata
|
|
410
|
+
- Much faster than manual pagination!
|
|
411
|
+
|
|
412
|
+
Sort pools by creation date (newest first) or progress (closest to graduation first).`,
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
];
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Export all analysis prompts
|
|
421
|
+
*/
|
|
422
|
+
export const analysisPrompts: MCPPrompt[] = [
|
|
423
|
+
compareTokensPrompt,
|
|
424
|
+
graduationStatusPrompt,
|
|
425
|
+
spotPricesPrompt,
|
|
426
|
+
poolDetailsPrompt,
|
|
427
|
+
tradeHistoryPrompt,
|
|
428
|
+
fetchAllPoolsPrompt,
|
|
429
|
+
];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gala Launchpad MCP Prompts (Slash Commands)
|
|
3
|
+
*
|
|
4
|
+
* Provides user-friendly slash commands for common Launchpad workflows
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { tradingPrompts } from './trading.js';
|
|
8
|
+
import { portfolioPrompts } from './portfolio.js';
|
|
9
|
+
import { analysisPrompts } from './analysis.js';
|
|
10
|
+
import { utilityPrompts } from './utility.js';
|
|
11
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* All available prompts
|
|
15
|
+
*/
|
|
16
|
+
export const prompts: MCPPrompt[] = [
|
|
17
|
+
...tradingPrompts,
|
|
18
|
+
...portfolioPrompts,
|
|
19
|
+
...analysisPrompts,
|
|
20
|
+
...utilityPrompts,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optimized prompt registry using Map for O(1) lookups
|
|
25
|
+
* Improves performance for large prompt collections
|
|
26
|
+
*/
|
|
27
|
+
const promptMap = new Map<string, MCPPrompt>(
|
|
28
|
+
prompts.map((prompt) => [prompt.name, prompt])
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get prompt by name (optimized with Map lookup)
|
|
33
|
+
*
|
|
34
|
+
* @param name - Prompt name (e.g., 'galachain-launchpad:analyze-token')
|
|
35
|
+
* @returns Prompt object or undefined if not found
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const prompt = getPrompt('galachain-launchpad:buy-tokens');
|
|
40
|
+
* if (prompt) {
|
|
41
|
+
* const messages = prompt.handler({ tokenName: 'anime', galaAmount: '100' });
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export function getPrompt(name: string): MCPPrompt | undefined {
|
|
46
|
+
return promptMap.get(name);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get all prompt names
|
|
51
|
+
*
|
|
52
|
+
* @returns Array of all registered prompt names
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const names = getPromptNames();
|
|
57
|
+
* // ['galachain-launchpad:analyze-token', 'galachain-launchpad:buy-tokens', ...]
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export function getPromptNames(): string[] {
|
|
61
|
+
return Array.from(promptMap.keys());
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if a prompt exists by name
|
|
66
|
+
*
|
|
67
|
+
* @param name - Prompt name to check
|
|
68
|
+
* @returns True if prompt exists, false otherwise
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* if (hasPrompt('galachain-launchpad:analyze-token')) {
|
|
73
|
+
* console.log('Prompt is available');
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export function hasPrompt(name: string): boolean {
|
|
78
|
+
return promptMap.has(name);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Get prompts by category
|
|
83
|
+
*
|
|
84
|
+
* @param category - Category name ('trading', 'portfolio', 'analysis', or 'utility')
|
|
85
|
+
* @returns Array of prompts in the specified category
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const tradingCommands = getPromptsByCategory('trading');
|
|
90
|
+
* // Returns [analyzeTokenPrompt, buyTokensPrompt, sellTokensPrompt, graduateTokenPrompt]
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export function getPromptsByCategory(
|
|
94
|
+
category: 'trading' | 'portfolio' | 'analysis' | 'utility'
|
|
95
|
+
): MCPPrompt[] {
|
|
96
|
+
switch (category) {
|
|
97
|
+
case 'trading':
|
|
98
|
+
return tradingPrompts;
|
|
99
|
+
case 'portfolio':
|
|
100
|
+
return portfolioPrompts;
|
|
101
|
+
case 'analysis':
|
|
102
|
+
return analysisPrompts;
|
|
103
|
+
case 'utility':
|
|
104
|
+
return utilityPrompts;
|
|
105
|
+
default:
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get prompt count
|
|
112
|
+
*
|
|
113
|
+
* @returns Total number of registered prompts
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* console.log(`Total prompts: ${getPromptCount()}`); // Total prompts: 14
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export function getPromptCount(): number {
|
|
121
|
+
return promptMap.size;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Export individual prompt categories for documentation
|
|
126
|
+
*/
|
|
127
|
+
export { tradingPrompts, portfolioPrompts, analysisPrompts, utilityPrompts };
|