@gala-chain/launchpad-mcp-server 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/DRY_REFACTORING_GUIDE.md +272 -0
- package/README.md +34 -6
- package/dist/constants/mcpToolNames.d.ts +6 -2
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +4 -2
- 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/analysis.d.ts.map +1 -1
- package/dist/prompts/analysis.js +14 -63
- package/dist/prompts/analysis.js.map +1 -1
- package/dist/prompts/balances.d.ts.map +1 -1
- package/dist/prompts/balances.js +46 -70
- package/dist/prompts/balances.js.map +1 -1
- package/dist/prompts/creation-utils.d.ts.map +1 -1
- package/dist/prompts/creation-utils.js +27 -50
- package/dist/prompts/creation-utils.js.map +1 -1
- package/dist/prompts/explore-dex-pools.d.ts +20 -0
- package/dist/prompts/explore-dex-pools.d.ts.map +1 -0
- package/dist/prompts/explore-dex-pools.js +132 -0
- package/dist/prompts/explore-dex-pools.js.map +1 -0
- package/dist/prompts/index.d.ts +3 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +6 -3
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/liquidity-positions.d.ts.map +1 -1
- package/dist/prompts/liquidity-positions.js +9 -44
- package/dist/prompts/liquidity-positions.js.map +1 -1
- package/dist/prompts/pools.d.ts.map +1 -1
- package/dist/prompts/pools.js +125 -228
- package/dist/prompts/pools.js.map +1 -1
- package/dist/prompts/portfolio.d.ts.map +1 -1
- package/dist/prompts/portfolio.js +13 -48
- package/dist/prompts/portfolio.js.map +1 -1
- package/dist/prompts/social.d.ts.map +1 -1
- package/dist/prompts/social.js +21 -31
- package/dist/prompts/social.js.map +1 -1
- package/dist/prompts/trading-calculations.d.ts.map +1 -1
- package/dist/prompts/trading-calculations.js +37 -126
- package/dist/prompts/trading-calculations.js.map +1 -1
- package/dist/prompts/trading.d.ts.map +1 -1
- package/dist/prompts/trading.js +23 -60
- package/dist/prompts/trading.js.map +1 -1
- package/dist/prompts/transfers.d.ts.map +1 -1
- package/dist/prompts/transfers.js +21 -31
- package/dist/prompts/transfers.js.map +1 -1
- package/dist/prompts/utility-tools.d.ts.map +1 -1
- package/dist/prompts/utility-tools.js +83 -202
- package/dist/prompts/utility-tools.js.map +1 -1
- package/dist/prompts/utility.d.ts.map +1 -1
- package/dist/prompts/utility.js +5 -20
- package/dist/prompts/utility.js.map +1 -1
- package/dist/prompts/utils/handlerHelpers.d.ts +35 -0
- package/dist/prompts/utils/handlerHelpers.d.ts.map +1 -0
- package/dist/prompts/utils/handlerHelpers.js +53 -0
- package/dist/prompts/utils/handlerHelpers.js.map +1 -0
- package/dist/prompts/utils/textTemplates.d.ts +42 -0
- package/dist/prompts/utils/textTemplates.d.ts.map +1 -0
- package/dist/prompts/utils/textTemplates.js +51 -0
- package/dist/prompts/utils/textTemplates.js.map +1 -0
- package/dist/tools/dex/fetchAllDexPools.d.ts +9 -0
- package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -0
- package/dist/tools/dex/fetchAllDexPools.js +45 -0
- package/dist/tools/dex/fetchAllDexPools.js.map +1 -0
- package/dist/tools/dex/fetchDexPools.d.ts +9 -0
- package/dist/tools/dex/fetchDexPools.d.ts.map +1 -0
- package/dist/tools/dex/fetchDexPools.js +58 -0
- package/dist/tools/dex/fetchDexPools.js.map +1 -0
- package/dist/tools/dex/index.d.ts +4 -3
- package/dist/tools/dex/index.d.ts.map +1 -1
- package/dist/tools/dex/index.js +9 -4
- package/dist/tools/dex/index.js.map +1 -1
- package/dist/utils/validation.d.ts +38 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +52 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/server.test.ts +1 -2
- package/src/constants/mcpToolNames.ts +4 -2
- package/src/prompts/__tests__/promptStructure.test.ts +50 -0
- package/src/prompts/__tests__/registry.test.ts +23 -33
- package/src/prompts/analysis.ts +15 -64
- package/src/prompts/balances.ts +57 -73
- package/src/prompts/creation-utils.ts +34 -49
- package/src/prompts/explore-dex-pools.ts +138 -0
- package/src/prompts/index.ts +5 -2
- package/src/prompts/liquidity-positions.ts +11 -44
- package/src/prompts/pools.ts +156 -231
- package/src/prompts/portfolio.ts +13 -47
- package/src/prompts/social.ts +25 -31
- package/src/prompts/trading-calculations.ts +42 -127
- package/src/prompts/trading.ts +30 -61
- package/src/prompts/transfers.ts +25 -31
- package/src/prompts/utility-tools.ts +116 -199
- package/src/prompts/utility.ts +5 -20
- package/src/prompts/utils/handlerHelpers.ts +55 -0
- package/src/prompts/utils/textTemplates.ts +73 -0
- package/src/tools/dex/fetchAllDexPools.ts +45 -0
- package/src/tools/dex/fetchDexPools.ts +58 -0
- package/src/tools/dex/index.ts +9 -4
- package/src/utils/validation.ts +58 -0
package/src/prompts/social.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
8
|
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
9
|
import { validateTokenName } from '../utils/validation.js';
|
|
10
|
+
import { createPromptResponse } from './utils/handlerHelpers.js';
|
|
11
|
+
import { createSimpleOperationText } from './utils/textTemplates.js';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Post Comment - Post comment on token
|
|
@@ -29,22 +31,18 @@ export const postCommentPrompt: MCPPrompt = {
|
|
|
29
31
|
handler: (args) => {
|
|
30
32
|
validateTokenName(args.tokenName);
|
|
31
33
|
|
|
32
|
-
return
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Token: ${args.tokenName}
|
|
40
|
-
Message: ${args.message}
|
|
41
|
-
|
|
42
|
-
Use ${MCP_TOOLS.POST_COMMENT} to post the comment.
|
|
43
|
-
|
|
44
|
-
Display confirmation of successful comment posting.`,
|
|
34
|
+
return createPromptResponse(
|
|
35
|
+
createSimpleOperationText({
|
|
36
|
+
operation: 'Post comment on token pool.',
|
|
37
|
+
parameters: {
|
|
38
|
+
token: `Token: ${args.tokenName}`,
|
|
39
|
+
message: `Message: ${args.message}`,
|
|
45
40
|
},
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
toolName: MCP_TOOLS.POST_COMMENT,
|
|
42
|
+
actionDescription: 'post the comment',
|
|
43
|
+
displayFormat: 'Display confirmation of successful comment posting.',
|
|
44
|
+
})
|
|
45
|
+
);
|
|
48
46
|
},
|
|
49
47
|
};
|
|
50
48
|
|
|
@@ -74,23 +72,19 @@ export const fetchCommentsPrompt: MCPPrompt = {
|
|
|
74
72
|
handler: (args) => {
|
|
75
73
|
validateTokenName(args.tokenName);
|
|
76
74
|
|
|
77
|
-
return
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Token: ${args.tokenName}
|
|
85
|
-
Page: ${args.page || 1}
|
|
86
|
-
Limit: ${args.limit || 20}
|
|
87
|
-
|
|
88
|
-
Use ${MCP_TOOLS.FETCH_COMMENTS} to retrieve comments.
|
|
89
|
-
|
|
90
|
-
Display the comments with author information and timestamps.`,
|
|
75
|
+
return createPromptResponse(
|
|
76
|
+
createSimpleOperationText({
|
|
77
|
+
operation: 'Fetch comments for token pool.',
|
|
78
|
+
parameters: {
|
|
79
|
+
token: `Token: ${args.tokenName}`,
|
|
80
|
+
page: `Page: ${args.page || 1}`,
|
|
81
|
+
limit: `Limit: ${args.limit || 20}`,
|
|
91
82
|
},
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
toolName: MCP_TOOLS.FETCH_COMMENTS,
|
|
84
|
+
actionDescription: 'retrieve comments',
|
|
85
|
+
displayFormat: 'Display the comments with author information and timestamps.',
|
|
86
|
+
})
|
|
87
|
+
);
|
|
94
88
|
},
|
|
95
89
|
};
|
|
96
90
|
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
8
|
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
-
import { validateTokenName, validateNumericAmount } from '../utils/validation.js';
|
|
9
|
+
import { validateTokenName, validateNumericAmount, validateOptional } from '../utils/validation.js';
|
|
10
|
+
import { createPromptResponse } from './utils/handlerHelpers.js';
|
|
11
|
+
import { createSimpleOperationText } from './utils/textTemplates.js';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Calculate Buy Amount - Buy cost calculation
|
|
@@ -35,12 +37,7 @@ export const calculateBuyAmountPrompt: MCPPrompt = {
|
|
|
35
37
|
validateTokenName(args.tokenName, 'tokenName');
|
|
36
38
|
validateNumericAmount(args.amount, 'amount');
|
|
37
39
|
|
|
38
|
-
return
|
|
39
|
-
{
|
|
40
|
-
role: 'user',
|
|
41
|
-
content: {
|
|
42
|
-
type: 'text',
|
|
43
|
-
text: `Calculate buy amount and fee breakdown.
|
|
40
|
+
return createPromptResponse(`Calculate buy amount and fee breakdown.
|
|
44
41
|
|
|
45
42
|
Token: ${args.tokenName}
|
|
46
43
|
Amount: ${args.amount}
|
|
@@ -52,10 +49,7 @@ Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT} to get:
|
|
|
52
49
|
- Gas fee
|
|
53
50
|
- Reverse bonding curve fee
|
|
54
51
|
|
|
55
|
-
Display the complete cost breakdown
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
];
|
|
52
|
+
Display the complete cost breakdown.`);
|
|
59
53
|
},
|
|
60
54
|
};
|
|
61
55
|
|
|
@@ -86,12 +80,7 @@ export const calculateSellAmountPrompt: MCPPrompt = {
|
|
|
86
80
|
validateTokenName(args.tokenName, 'tokenName');
|
|
87
81
|
validateNumericAmount(args.amount, 'amount');
|
|
88
82
|
|
|
89
|
-
return
|
|
90
|
-
{
|
|
91
|
-
role: 'user',
|
|
92
|
-
content: {
|
|
93
|
-
type: 'text',
|
|
94
|
-
text: `Calculate sell amount and fee breakdown.
|
|
83
|
+
return createPromptResponse(`Calculate sell amount and fee breakdown.
|
|
95
84
|
|
|
96
85
|
Token: ${args.tokenName}
|
|
97
86
|
Amount: ${args.amount}
|
|
@@ -103,10 +92,7 @@ Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT} to get:
|
|
|
103
92
|
- Gas fee
|
|
104
93
|
- Reverse bonding curve fee
|
|
105
94
|
|
|
106
|
-
Display the complete proceeds breakdown
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
];
|
|
95
|
+
Display the complete proceeds breakdown.`);
|
|
110
96
|
},
|
|
111
97
|
};
|
|
112
98
|
|
|
@@ -139,16 +125,9 @@ export const fetchTradesPrompt: MCPPrompt = {
|
|
|
139
125
|
},
|
|
140
126
|
],
|
|
141
127
|
handler: (args) => {
|
|
142
|
-
|
|
143
|
-
validateTokenName(args.tokenName, 'tokenName');
|
|
144
|
-
}
|
|
128
|
+
validateOptional(args.tokenName, (val) => validateTokenName(val, 'tokenName'));
|
|
145
129
|
|
|
146
|
-
return
|
|
147
|
-
{
|
|
148
|
-
role: 'user',
|
|
149
|
-
content: {
|
|
150
|
-
type: 'text',
|
|
151
|
-
text: `Fetch trading history.
|
|
130
|
+
return createPromptResponse(`Fetch trading history.
|
|
152
131
|
|
|
153
132
|
${args.tokenName ? `Token: ${args.tokenName}` : ''}
|
|
154
133
|
${args.tradeType ? `Trade Type: ${args.tradeType}` : ''}
|
|
@@ -157,10 +136,7 @@ Limit: ${args.limit || 20}
|
|
|
157
136
|
|
|
158
137
|
Use ${MCP_TOOLS.FETCH_TRADES} to retrieve your trades.
|
|
159
138
|
|
|
160
|
-
Display trade details including amounts, prices, and timestamps
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
];
|
|
139
|
+
Display trade details including amounts, prices, and timestamps.`);
|
|
164
140
|
},
|
|
165
141
|
};
|
|
166
142
|
|
|
@@ -180,12 +156,7 @@ export const calculateInitialBuyPrompt: MCPPrompt = {
|
|
|
180
156
|
handler: (args) => {
|
|
181
157
|
validateNumericAmount(args.amount, 'amount');
|
|
182
158
|
|
|
183
|
-
return
|
|
184
|
-
{
|
|
185
|
-
role: 'user',
|
|
186
|
-
content: {
|
|
187
|
-
type: 'text',
|
|
188
|
-
text: `Calculate pre-buy amounts for token creation.
|
|
159
|
+
return createPromptResponse(`Calculate pre-buy amounts for token creation.
|
|
189
160
|
|
|
190
161
|
GALA Amount: ${args.amount}
|
|
191
162
|
|
|
@@ -193,10 +164,7 @@ Use ${MCP_TOOLS.CALCULATE_INITIAL_BUY} to calculate:
|
|
|
193
164
|
- Token quantity from initial buy
|
|
194
165
|
- Applied fees and costs
|
|
195
166
|
|
|
196
|
-
Display the calculated results
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
];
|
|
167
|
+
Display the calculated results.`);
|
|
200
168
|
},
|
|
201
169
|
};
|
|
202
170
|
|
|
@@ -214,12 +182,7 @@ export const getBundlerTransactionResultPrompt: MCPPrompt = {
|
|
|
214
182
|
},
|
|
215
183
|
],
|
|
216
184
|
handler: (args) => {
|
|
217
|
-
return
|
|
218
|
-
{
|
|
219
|
-
role: 'user',
|
|
220
|
-
content: {
|
|
221
|
-
type: 'text',
|
|
222
|
-
text: `Get bundler transaction result.
|
|
185
|
+
return createPromptResponse(`Get bundler transaction result.
|
|
223
186
|
|
|
224
187
|
Transaction ID: ${args.transactionId}
|
|
225
188
|
|
|
@@ -228,10 +191,7 @@ Use ${MCP_TOOLS.GET_BUNDLER_TRANSACTION_RESULT} to check:
|
|
|
228
191
|
- Transaction method
|
|
229
192
|
- Metadata
|
|
230
193
|
|
|
231
|
-
Display the transaction status clearly
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
];
|
|
194
|
+
Display the transaction status clearly.`);
|
|
235
195
|
},
|
|
236
196
|
};
|
|
237
197
|
|
|
@@ -251,24 +211,17 @@ export const calculateBuyAmountForGraduationPrompt: MCPPrompt = {
|
|
|
251
211
|
handler: (args) => {
|
|
252
212
|
validateTokenName(args.tokenName, 'tokenName');
|
|
253
213
|
|
|
254
|
-
return
|
|
255
|
-
{
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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.`,
|
|
214
|
+
return createPromptResponse(
|
|
215
|
+
createSimpleOperationText({
|
|
216
|
+
operation: 'Calculate graduation cost for token pool.',
|
|
217
|
+
parameters: {
|
|
218
|
+
token_name: `Token: ${args.tokenName}`,
|
|
269
219
|
},
|
|
270
|
-
|
|
271
|
-
|
|
220
|
+
toolName: MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION,
|
|
221
|
+
actionDescription: 'determine GALA cost to buy all remaining tokens, transaction fees, and complete cost breakdown',
|
|
222
|
+
displayFormat: 'Display how much GALA is needed to graduate this token.',
|
|
223
|
+
})
|
|
224
|
+
);
|
|
272
225
|
},
|
|
273
226
|
};
|
|
274
227
|
|
|
@@ -294,12 +247,7 @@ export const calculateBuyAmountLocalPrompt: MCPPrompt = {
|
|
|
294
247
|
validateTokenName(args.tokenName, 'tokenName');
|
|
295
248
|
validateNumericAmount(args.amount, 'amount');
|
|
296
249
|
|
|
297
|
-
return
|
|
298
|
-
{
|
|
299
|
-
role: 'user',
|
|
300
|
-
content: {
|
|
301
|
-
type: 'text',
|
|
302
|
-
text: `Calculate buy amount using LOCAL bonding curve formula.
|
|
250
|
+
return createPromptResponse(`Calculate buy amount using LOCAL bonding curve formula.
|
|
303
251
|
|
|
304
252
|
Token: ${args.tokenName}
|
|
305
253
|
Amount: ${args.amount} GALA
|
|
@@ -309,10 +257,7 @@ Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_LOCAL} for instant calculation:
|
|
|
309
257
|
- No network call required
|
|
310
258
|
- Results within <0.01% of external calculation
|
|
311
259
|
|
|
312
|
-
Perfect for price discovery and UI updates
|
|
313
|
-
},
|
|
314
|
-
},
|
|
315
|
-
];
|
|
260
|
+
Perfect for price discovery and UI updates.`);
|
|
316
261
|
},
|
|
317
262
|
};
|
|
318
263
|
|
|
@@ -338,12 +283,7 @@ export const calculateBuyAmountExternalPrompt: MCPPrompt = {
|
|
|
338
283
|
validateTokenName(args.tokenName, 'tokenName');
|
|
339
284
|
validateNumericAmount(args.amount, 'amount');
|
|
340
285
|
|
|
341
|
-
return
|
|
342
|
-
{
|
|
343
|
-
role: 'user',
|
|
344
|
-
content: {
|
|
345
|
-
type: 'text',
|
|
346
|
-
text: `Calculate buy amount using EXTERNAL GalaChain network call.
|
|
286
|
+
return createPromptResponse(`Calculate buy amount using EXTERNAL GalaChain network call.
|
|
347
287
|
|
|
348
288
|
Token: ${args.tokenName}
|
|
349
289
|
Amount: ${args.amount} GALA
|
|
@@ -353,10 +293,7 @@ Use ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_EXTERNAL} for real-time calculation:
|
|
|
353
293
|
- Most accurate pricing available
|
|
354
294
|
- Includes reverse bonding curve fees
|
|
355
295
|
|
|
356
|
-
Use this for precise trading decisions
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
];
|
|
296
|
+
Use this for precise trading decisions.`);
|
|
360
297
|
},
|
|
361
298
|
};
|
|
362
299
|
|
|
@@ -382,12 +319,7 @@ export const calculateSellAmountLocalPrompt: MCPPrompt = {
|
|
|
382
319
|
validateTokenName(args.tokenName, 'tokenName');
|
|
383
320
|
validateNumericAmount(args.amount, 'amount');
|
|
384
321
|
|
|
385
|
-
return
|
|
386
|
-
{
|
|
387
|
-
role: 'user',
|
|
388
|
-
content: {
|
|
389
|
-
type: 'text',
|
|
390
|
-
text: `Calculate sell proceeds using LOCAL bonding curve formula.
|
|
322
|
+
return createPromptResponse(`Calculate sell proceeds using LOCAL bonding curve formula.
|
|
391
323
|
|
|
392
324
|
Token: ${args.tokenName}
|
|
393
325
|
Sell Amount: ${args.amount} tokens
|
|
@@ -397,10 +329,7 @@ Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT_LOCAL} for instant calculation:
|
|
|
397
329
|
- Requires pool details (fetch separately)
|
|
398
330
|
- No network call required
|
|
399
331
|
|
|
400
|
-
Display the expected GALA proceeds
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
];
|
|
332
|
+
Display the expected GALA proceeds.`);
|
|
404
333
|
},
|
|
405
334
|
};
|
|
406
335
|
|
|
@@ -426,12 +355,7 @@ export const calculateSellAmountExternalPrompt: MCPPrompt = {
|
|
|
426
355
|
validateTokenName(args.tokenName, 'tokenName');
|
|
427
356
|
validateNumericAmount(args.amount, 'amount');
|
|
428
357
|
|
|
429
|
-
return
|
|
430
|
-
{
|
|
431
|
-
role: 'user',
|
|
432
|
-
content: {
|
|
433
|
-
type: 'text',
|
|
434
|
-
text: `Calculate sell proceeds using EXTERNAL GalaChain network call.
|
|
358
|
+
return createPromptResponse(`Calculate sell proceeds using EXTERNAL GalaChain network call.
|
|
435
359
|
|
|
436
360
|
Token: ${args.tokenName}
|
|
437
361
|
Sell Amount: ${args.amount} tokens
|
|
@@ -441,10 +365,7 @@ Use ${MCP_TOOLS.CALCULATE_SELL_AMOUNT_EXTERNAL} for real-time calculation:
|
|
|
441
365
|
- Most accurate pricing available
|
|
442
366
|
- Includes reverse bonding curve fees
|
|
443
367
|
|
|
444
|
-
Use this for precise selling decisions
|
|
445
|
-
},
|
|
446
|
-
},
|
|
447
|
-
];
|
|
368
|
+
Use this for precise selling decisions.`);
|
|
448
369
|
},
|
|
449
370
|
};
|
|
450
371
|
|
|
@@ -464,23 +385,17 @@ export const isTokenGraduatedPrompt: MCPPrompt = {
|
|
|
464
385
|
handler: (args) => {
|
|
465
386
|
validateTokenName(args.tokenName, 'tokenName');
|
|
466
387
|
|
|
467
|
-
return
|
|
468
|
-
{
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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.`,
|
|
388
|
+
return createPromptResponse(
|
|
389
|
+
createSimpleOperationText({
|
|
390
|
+
operation: 'Check token graduation status.',
|
|
391
|
+
parameters: {
|
|
392
|
+
token_name: `Token: ${args.tokenName}`,
|
|
481
393
|
},
|
|
482
|
-
|
|
483
|
-
|
|
394
|
+
toolName: MCP_TOOLS.IS_TOKEN_GRADUATED,
|
|
395
|
+
actionDescription: 'determine whether token has completed bonding curve and is trading on full DEX',
|
|
396
|
+
displayFormat: 'Display the graduation status clearly.',
|
|
397
|
+
})
|
|
398
|
+
);
|
|
484
399
|
},
|
|
485
400
|
};
|
|
486
401
|
|
package/src/prompts/trading.ts
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
createTradingWorkflow,
|
|
10
10
|
createAnalysisWorkflow,
|
|
11
11
|
} from './utils/workflowTemplates.js';
|
|
12
|
-
import { validateTokenName, validateNumericAmount,
|
|
12
|
+
import { validateTokenName, validateNumericAmount, validateOptionalSlippage } from '../utils/validation.js';
|
|
13
|
+
import { createPromptResponse } from './utils/handlerHelpers.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Analyze Token - Complete token analysis workflow
|
|
@@ -29,15 +30,7 @@ export const analyzeTokenPrompt: MCPPrompt = {
|
|
|
29
30
|
// Validate inputs
|
|
30
31
|
validateTokenName(args.tokenName);
|
|
31
32
|
|
|
32
|
-
return
|
|
33
|
-
{
|
|
34
|
-
role: 'user',
|
|
35
|
-
content: {
|
|
36
|
-
type: 'text',
|
|
37
|
-
text: createAnalysisWorkflow(args.tokenName),
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
];
|
|
33
|
+
return createPromptResponse(createAnalysisWorkflow(args.tokenName));
|
|
41
34
|
},
|
|
42
35
|
};
|
|
43
36
|
|
|
@@ -68,25 +61,17 @@ export const buyTokensPrompt: MCPPrompt = {
|
|
|
68
61
|
// Validate inputs
|
|
69
62
|
validateTokenName(args.tokenName);
|
|
70
63
|
validateNumericAmount(args.galaAmount, 'galaAmount');
|
|
71
|
-
|
|
72
|
-
validateSlippage(args.slippage);
|
|
73
|
-
}
|
|
64
|
+
validateOptionalSlippage(args.slippage);
|
|
74
65
|
|
|
75
|
-
return
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
amountType: 'gala',
|
|
85
|
-
slippage: args.slippage || '1',
|
|
86
|
-
}),
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
];
|
|
66
|
+
return createPromptResponse(
|
|
67
|
+
createTradingWorkflow({
|
|
68
|
+
operation: 'buy',
|
|
69
|
+
tokenName: args.tokenName,
|
|
70
|
+
amount: args.galaAmount,
|
|
71
|
+
amountType: 'gala',
|
|
72
|
+
slippage: args.slippage || '1',
|
|
73
|
+
})
|
|
74
|
+
);
|
|
90
75
|
},
|
|
91
76
|
};
|
|
92
77
|
|
|
@@ -117,24 +102,16 @@ export const sellTokensPrompt: MCPPrompt = {
|
|
|
117
102
|
// Validate inputs
|
|
118
103
|
validateTokenName(args.tokenName);
|
|
119
104
|
validateNumericAmount(args.tokenAmount, 'tokenAmount');
|
|
120
|
-
|
|
121
|
-
validateSlippage(args.slippage);
|
|
122
|
-
}
|
|
105
|
+
validateOptionalSlippage(args.slippage);
|
|
123
106
|
|
|
124
|
-
return
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
amount: args.tokenAmount,
|
|
133
|
-
slippage: args.slippage || '1',
|
|
134
|
-
}),
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
];
|
|
107
|
+
return createPromptResponse(
|
|
108
|
+
createTradingWorkflow({
|
|
109
|
+
operation: 'sell',
|
|
110
|
+
tokenName: args.tokenName,
|
|
111
|
+
amount: args.tokenAmount,
|
|
112
|
+
slippage: args.slippage || '1',
|
|
113
|
+
})
|
|
114
|
+
);
|
|
138
115
|
},
|
|
139
116
|
};
|
|
140
117
|
|
|
@@ -160,23 +137,15 @@ export const graduateTokenPrompt: MCPPrompt = {
|
|
|
160
137
|
handler: (args) => {
|
|
161
138
|
// Validate inputs
|
|
162
139
|
validateTokenName(args.tokenName);
|
|
163
|
-
|
|
164
|
-
validateSlippage(args.slippage);
|
|
165
|
-
}
|
|
140
|
+
validateOptionalSlippage(args.slippage);
|
|
166
141
|
|
|
167
|
-
return
|
|
168
|
-
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
tokenName: args.tokenName,
|
|
175
|
-
slippage: args.slippage || '1',
|
|
176
|
-
}),
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
];
|
|
142
|
+
return createPromptResponse(
|
|
143
|
+
createTradingWorkflow({
|
|
144
|
+
operation: 'graduate',
|
|
145
|
+
tokenName: args.tokenName,
|
|
146
|
+
slippage: args.slippage || '1',
|
|
147
|
+
})
|
|
148
|
+
);
|
|
180
149
|
},
|
|
181
150
|
};
|
|
182
151
|
|
package/src/prompts/transfers.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
8
|
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
9
|
import { validateAddress, validateNumericAmount, validateTokenName } from '../utils/validation.js';
|
|
10
|
+
import { createPromptResponse } from './utils/handlerHelpers.js';
|
|
11
|
+
import { createSimpleOperationText } from './utils/textTemplates.js';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Transfer GALA - GALA token transfer
|
|
@@ -30,22 +32,18 @@ export const transferGalaPrompt: MCPPrompt = {
|
|
|
30
32
|
validateAddress(args.recipientAddress, 'recipientAddress');
|
|
31
33
|
validateNumericAmount(args.amount, 'amount');
|
|
32
34
|
|
|
33
|
-
return
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Recipient: ${args.recipientAddress}
|
|
41
|
-
Amount: ${args.amount} GALA
|
|
42
|
-
|
|
43
|
-
Use ${MCP_TOOLS.TRANSFER_GALA} to execute the transfer.
|
|
44
|
-
|
|
45
|
-
Display the transaction details and confirmation.`,
|
|
35
|
+
return createPromptResponse(
|
|
36
|
+
createSimpleOperationText({
|
|
37
|
+
operation: 'Transfer GALA tokens.',
|
|
38
|
+
parameters: {
|
|
39
|
+
recipient: `Recipient: ${args.recipientAddress}`,
|
|
40
|
+
amount: `Amount: ${args.amount} GALA`,
|
|
46
41
|
},
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
toolName: MCP_TOOLS.TRANSFER_GALA,
|
|
43
|
+
actionDescription: 'execute the transfer',
|
|
44
|
+
displayFormat: 'Display the transaction details and confirmation.',
|
|
45
|
+
})
|
|
46
|
+
);
|
|
49
47
|
},
|
|
50
48
|
};
|
|
51
49
|
|
|
@@ -77,23 +75,19 @@ export const transferTokenPrompt: MCPPrompt = {
|
|
|
77
75
|
validateTokenName(args.tokenName, 'tokenName');
|
|
78
76
|
validateNumericAmount(args.amount, 'amount');
|
|
79
77
|
|
|
80
|
-
return
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Recipient: ${args.to}
|
|
88
|
-
Token: ${args.tokenName}
|
|
89
|
-
Amount: ${args.amount}
|
|
90
|
-
|
|
91
|
-
Use ${MCP_TOOLS.TRANSFER_TOKEN} to execute the transfer.
|
|
92
|
-
|
|
93
|
-
Display the transaction details and confirmation.`,
|
|
78
|
+
return createPromptResponse(
|
|
79
|
+
createSimpleOperationText({
|
|
80
|
+
operation: 'Transfer launchpad tokens.',
|
|
81
|
+
parameters: {
|
|
82
|
+
recipient: `Recipient: ${args.to}`,
|
|
83
|
+
token: `Token: ${args.tokenName}`,
|
|
84
|
+
amount: `Amount: ${args.amount}`,
|
|
94
85
|
},
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
toolName: MCP_TOOLS.TRANSFER_TOKEN,
|
|
87
|
+
actionDescription: 'execute the transfer',
|
|
88
|
+
displayFormat: 'Display the transaction details and confirmation.',
|
|
89
|
+
})
|
|
90
|
+
);
|
|
97
91
|
},
|
|
98
92
|
};
|
|
99
93
|
|