@gala-chain/launchpad-mcp-server 1.22.3 → 1.23.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.
- package/CHANGELOG.md +161 -0
- package/README.md +83 -8
- package/dist/constants/mcpToolNames.d.ts +69 -11
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +47 -9
- package/dist/constants/mcpToolNames.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/prompts/balances.d.ts +24 -0
- package/dist/prompts/balances.d.ts.map +1 -0
- package/dist/prompts/balances.js +191 -0
- package/dist/prompts/balances.js.map +1 -0
- package/dist/prompts/creation-utils.d.ts +20 -0
- package/dist/prompts/creation-utils.d.ts.map +1 -0
- package/dist/prompts/creation-utils.js +115 -0
- package/dist/prompts/creation-utils.js.map +1 -0
- package/dist/prompts/index.d.ts +9 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +23 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/pools.d.ts +64 -0
- package/dist/prompts/pools.d.ts.map +1 -0
- package/dist/prompts/pools.js +548 -0
- package/dist/prompts/pools.js.map +1 -0
- package/dist/prompts/social.d.ts +16 -0
- package/dist/prompts/social.d.ts.map +1 -0
- package/dist/prompts/social.js +97 -0
- package/dist/prompts/social.js.map +1 -0
- package/dist/prompts/trading-calculations.d.ts +52 -0
- package/dist/prompts/trading-calculations.d.ts.map +1 -0
- package/dist/prompts/trading-calculations.js +479 -0
- package/dist/prompts/trading-calculations.js.map +1 -0
- package/dist/prompts/transfers.d.ts +16 -0
- package/dist/prompts/transfers.d.ts.map +1 -0
- package/dist/prompts/transfers.js +100 -0
- package/dist/prompts/transfers.js.map +1 -0
- package/dist/prompts/utility-tools.d.ts +56 -0
- package/dist/prompts/utility-tools.d.ts.map +1 -0
- package/dist/prompts/utility-tools.js +338 -0
- package/dist/prompts/utility-tools.js.map +1 -0
- package/dist/prompts/utility.d.ts +8 -0
- package/dist/prompts/utility.d.ts.map +1 -1
- package/dist/prompts/utility.js +49 -2
- package/dist/prompts/utility.js.map +1 -1
- package/dist/server.d.ts +17 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +81 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +9 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/utils/getConfig.d.ts +2 -0
- package/dist/tools/utils/getConfig.d.ts.map +1 -1
- package/dist/tools/utils/getConfig.js +12 -3
- package/dist/tools/utils/getConfig.js.map +1 -1
- package/dist/tools/utils/getEnvironment.d.ts +8 -0
- package/dist/tools/utils/getEnvironment.d.ts.map +1 -0
- package/dist/tools/utils/getEnvironment.js +19 -0
- package/dist/tools/utils/getEnvironment.js.map +1 -0
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +4 -0
- package/dist/tools/utils/index.js.map +1 -1
- package/dist/tools/utils/switchEnvironment.d.ts +8 -0
- package/dist/tools/utils/switchEnvironment.d.ts.map +1 -0
- package/dist/tools/utils/switchEnvironment.js +30 -0
- package/dist/tools/utils/switchEnvironment.js.map +1 -0
- package/dist/types/mcp.d.ts +1 -1
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/tool-factory.d.ts +30 -0
- package/dist/utils/tool-factory.d.ts.map +1 -1
- package/dist/utils/tool-factory.js +31 -0
- package/dist/utils/tool-factory.js.map +1 -1
- 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 +1 -1
- package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +258 -0
- package/src/__tests__/integration/poolTools.integration.test.ts +185 -0
- package/src/__tests__/server.test.ts +256 -0
- package/src/constants/mcpToolNames.ts +181 -0
- package/src/index.ts +19 -0
- package/src/prompts/__tests__/promptStructure.test.ts +137 -0
- package/src/prompts/__tests__/registry.test.ts +359 -0
- package/src/prompts/analysis.ts +429 -0
- package/src/prompts/balances.ts +198 -0
- package/src/prompts/create-token.ts +123 -0
- package/src/prompts/creation-utils.ts +118 -0
- package/src/prompts/dex-trading.ts +86 -0
- package/src/prompts/discover-tokens.ts +86 -0
- package/src/prompts/index.ts +175 -0
- package/src/prompts/liquidity-positions.ts +270 -0
- package/src/prompts/pools.ts +571 -0
- package/src/prompts/portfolio.ts +242 -0
- package/src/prompts/social.ts +100 -0
- package/src/prompts/trading-calculations.ts +499 -0
- package/src/prompts/trading.ts +191 -0
- package/src/prompts/transfers.ts +103 -0
- package/src/prompts/utility-tools.ts +349 -0
- package/src/prompts/utility.ts +92 -0
- package/src/prompts/utils/workflowTemplates.ts +511 -0
- package/src/schemas/common-schemas.ts +393 -0
- package/src/scripts/test-all-prompts.ts +184 -0
- package/src/server.ts +367 -0
- package/src/tools/__tests__/dex-tools.test.ts +562 -0
- package/src/tools/__tests__/liquidity-positions.test.ts +673 -0
- package/src/tools/balance/index.ts +174 -0
- package/src/tools/creation/index.ts +182 -0
- package/src/tools/dex/index.ts +226 -0
- package/src/tools/dex/liquidity-positions.ts +547 -0
- package/src/tools/index.ts +94 -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 +1446 -0
- package/src/tools/utils/getAddress.ts +12 -0
- package/src/tools/utils/getCacheInfo.ts +14 -0
- package/src/tools/utils/getConfig.ts +21 -0
- package/src/tools/utils/getEnvironment.ts +17 -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 +37 -0
- package/src/tools/utils/isTokenGraduated.ts +16 -0
- package/src/tools/utils/setWallet.ts +41 -0
- package/src/tools/utils/switchEnvironment.ts +28 -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 +303 -0
- package/src/utils/tool-registry.ts +296 -0
- package/src/utils/validation.ts +371 -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,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Balance & Portfolio Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for balance queries and portfolio management
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
+
import { validateAddress } from '../utils/validation.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Fetch GALA Balance - GALA balance query
|
|
13
|
+
*/
|
|
14
|
+
export const fetchGalaBalancePrompt: MCPPrompt = {
|
|
15
|
+
name: 'galachain-launchpad:fetch-gala-balance',
|
|
16
|
+
description: 'Get GALA balance for a wallet',
|
|
17
|
+
arguments: [
|
|
18
|
+
{
|
|
19
|
+
name: 'address',
|
|
20
|
+
description: 'Wallet address (optional, defaults to SDK wallet)',
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
handler: (args) => {
|
|
25
|
+
if (args.address) {
|
|
26
|
+
validateAddress(args.address);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
role: 'user',
|
|
32
|
+
content: {
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: `Get GALA balance for wallet.
|
|
35
|
+
|
|
36
|
+
${args.address ? `Address: ${args.address}` : 'Using default wallet'}
|
|
37
|
+
|
|
38
|
+
Use ${MCP_TOOLS.FETCH_GALA_BALANCE} to retrieve the GALA balance.
|
|
39
|
+
|
|
40
|
+
Display the balance in a clear format.`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Fetch Token Balance - Single token balance (optimized)
|
|
49
|
+
*/
|
|
50
|
+
export const fetchTokenBalancePrompt: MCPPrompt = {
|
|
51
|
+
name: 'galachain-launchpad:fetch-token-balance',
|
|
52
|
+
description: 'Get balance for a specific token',
|
|
53
|
+
arguments: [
|
|
54
|
+
{
|
|
55
|
+
name: 'tokenName',
|
|
56
|
+
description: 'Token name (e.g., anime)',
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'address',
|
|
61
|
+
description: 'Wallet address',
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
handler: (args) => {
|
|
66
|
+
validateAddress(args.address);
|
|
67
|
+
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
role: 'user',
|
|
71
|
+
content: {
|
|
72
|
+
type: 'text',
|
|
73
|
+
text: `Get balance for specific token.
|
|
74
|
+
|
|
75
|
+
Token: ${args.tokenName}
|
|
76
|
+
Address: ${args.address}
|
|
77
|
+
|
|
78
|
+
Use ${MCP_TOOLS.FETCH_TOKEN_BALANCE} to retrieve the token balance.
|
|
79
|
+
|
|
80
|
+
Display the balance with token details.`,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Fetch Tokens Created - Created tokens query
|
|
89
|
+
*/
|
|
90
|
+
export const fetchTokensCreatedPrompt: MCPPrompt = {
|
|
91
|
+
name: 'galachain-launchpad:fetch-tokens-created',
|
|
92
|
+
description: 'Get tokens created by a wallet',
|
|
93
|
+
arguments: [
|
|
94
|
+
{
|
|
95
|
+
name: 'address',
|
|
96
|
+
description: 'Wallet address',
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'page',
|
|
101
|
+
description: 'Page number (default: 1)',
|
|
102
|
+
required: false,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'limit',
|
|
106
|
+
description: 'Results per page (default: 20)',
|
|
107
|
+
required: false,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'tokenName',
|
|
111
|
+
description: 'Filter by exact token name (optional)',
|
|
112
|
+
required: false,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'search',
|
|
116
|
+
description: 'Filter by fuzzy search (optional)',
|
|
117
|
+
required: false,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
handler: (args) => {
|
|
121
|
+
validateAddress(args.address);
|
|
122
|
+
|
|
123
|
+
return [
|
|
124
|
+
{
|
|
125
|
+
role: 'user',
|
|
126
|
+
content: {
|
|
127
|
+
type: 'text',
|
|
128
|
+
text: `Get tokens created by wallet.
|
|
129
|
+
|
|
130
|
+
Address: ${args.address}
|
|
131
|
+
Page: ${args.page || 1}
|
|
132
|
+
Limit: ${args.limit || 20}
|
|
133
|
+
${args.tokenName ? `Token Name Filter: ${args.tokenName}` : ''}
|
|
134
|
+
${args.search ? `Search Filter: ${args.search}` : ''}
|
|
135
|
+
|
|
136
|
+
Use ${MCP_TOOLS.FETCH_TOKENS_CREATED} to retrieve created tokens.
|
|
137
|
+
|
|
138
|
+
Display the list of tokens created by this wallet.`,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Update Profile - Profile modification
|
|
147
|
+
*/
|
|
148
|
+
export const updateProfilePrompt: MCPPrompt = {
|
|
149
|
+
name: 'galachain-launchpad:update-profile',
|
|
150
|
+
description: 'Update user profile information',
|
|
151
|
+
arguments: [
|
|
152
|
+
{
|
|
153
|
+
name: 'fullName',
|
|
154
|
+
description: 'Full name (letters and spaces only)',
|
|
155
|
+
required: true,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'profileImage',
|
|
159
|
+
description: 'Profile image URL or empty string',
|
|
160
|
+
required: true,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'address',
|
|
164
|
+
description: 'Wallet address (optional)',
|
|
165
|
+
required: false,
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
handler: (args) => {
|
|
169
|
+
if (args.address) {
|
|
170
|
+
validateAddress(args.address);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [
|
|
174
|
+
{
|
|
175
|
+
role: 'user',
|
|
176
|
+
content: {
|
|
177
|
+
type: 'text',
|
|
178
|
+
text: `Update user profile.
|
|
179
|
+
|
|
180
|
+
Full Name: ${args.fullName}
|
|
181
|
+
Profile Image: ${args.profileImage}
|
|
182
|
+
${args.address ? `Address: ${args.address}` : 'Using default wallet'}
|
|
183
|
+
|
|
184
|
+
Use ${MCP_TOOLS.UPDATE_PROFILE} to update the profile.
|
|
185
|
+
|
|
186
|
+
Display confirmation of successful update.`,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const balancePrompts: MCPPrompt[] = [
|
|
194
|
+
fetchGalaBalancePrompt,
|
|
195
|
+
fetchTokenBalancePrompt,
|
|
196
|
+
fetchTokensCreatedPrompt,
|
|
197
|
+
updateProfilePrompt,
|
|
198
|
+
];
|