@gala-chain/launchpad-mcp-server 1.7.15 → 1.8.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 +24 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.d.ts.map +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/generated/version.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 +2 -2
- 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 +143 -0
- package/src/prompts/analysis.ts +429 -0
- package/src/prompts/index.ts +123 -0
- package/src/prompts/portfolio.ts +242 -0
- package/src/prompts/trading.ts +191 -0
- package/src/prompts/utils/workflowTemplates.ts +344 -0
- package/src/schemas/common-schemas.ts +392 -0
- package/src/scripts/test-all-prompts.ts +184 -0
- package/src/server.ts +241 -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/fetchPoolDetails.ts +27 -0
- package/src/tools/pools/fetchPoolDetailsForCalculation.ts +22 -0
- package/src/tools/pools/fetchPools.ts +47 -0
- package/src/tools/pools/index.ts +240 -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 +853 -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/index.ts +27 -0
- package/src/tools/utils/isTokenGraduated.ts +16 -0
- package/src/types/mcp.ts +72 -0
- package/src/utils/__tests__/validation.test.ts +147 -0
- package/src/utils/constraints.ts +146 -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/tsconfig.json +23 -0
|
@@ -0,0 +1,123 @@
|
|
|
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 type { MCPPrompt } from '../types/mcp.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* All available prompts
|
|
14
|
+
*/
|
|
15
|
+
export const prompts: MCPPrompt[] = [
|
|
16
|
+
...tradingPrompts,
|
|
17
|
+
...portfolioPrompts,
|
|
18
|
+
...analysisPrompts,
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optimized prompt registry using Map for O(1) lookups
|
|
23
|
+
* Improves performance for large prompt collections
|
|
24
|
+
*/
|
|
25
|
+
const promptMap = new Map<string, MCPPrompt>(
|
|
26
|
+
prompts.map((prompt) => [prompt.name, prompt])
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get prompt by name (optimized with Map lookup)
|
|
31
|
+
*
|
|
32
|
+
* @param name - Prompt name (e.g., 'galachain-launchpad:analyze-token')
|
|
33
|
+
* @returns Prompt object or undefined if not found
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const prompt = getPrompt('galachain-launchpad:buy-tokens');
|
|
38
|
+
* if (prompt) {
|
|
39
|
+
* const messages = prompt.handler({ tokenName: 'anime', galaAmount: '100' });
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export function getPrompt(name: string): MCPPrompt | undefined {
|
|
44
|
+
return promptMap.get(name);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get all prompt names
|
|
49
|
+
*
|
|
50
|
+
* @returns Array of all registered prompt names
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const names = getPromptNames();
|
|
55
|
+
* // ['galachain-launchpad:analyze-token', 'galachain-launchpad:buy-tokens', ...]
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function getPromptNames(): string[] {
|
|
59
|
+
return Array.from(promptMap.keys());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a prompt exists by name
|
|
64
|
+
*
|
|
65
|
+
* @param name - Prompt name to check
|
|
66
|
+
* @returns True if prompt exists, false otherwise
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* if (hasPrompt('galachain-launchpad:analyze-token')) {
|
|
71
|
+
* console.log('Prompt is available');
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export function hasPrompt(name: string): boolean {
|
|
76
|
+
return promptMap.has(name);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get prompts by category
|
|
81
|
+
*
|
|
82
|
+
* @param category - Category name ('trading', 'portfolio', or 'analysis')
|
|
83
|
+
* @returns Array of prompts in the specified category
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const tradingCommands = getPromptsByCategory('trading');
|
|
88
|
+
* // Returns [analyzeTokenPrompt, buyTokensPrompt, sellTokensPrompt, graduateTokenPrompt]
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export function getPromptsByCategory(
|
|
92
|
+
category: 'trading' | 'portfolio' | 'analysis'
|
|
93
|
+
): MCPPrompt[] {
|
|
94
|
+
switch (category) {
|
|
95
|
+
case 'trading':
|
|
96
|
+
return tradingPrompts;
|
|
97
|
+
case 'portfolio':
|
|
98
|
+
return portfolioPrompts;
|
|
99
|
+
case 'analysis':
|
|
100
|
+
return analysisPrompts;
|
|
101
|
+
default:
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get prompt count
|
|
108
|
+
*
|
|
109
|
+
* @returns Total number of registered prompts
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* console.log(`Total prompts: ${getPromptCount()}`); // Total prompts: 14
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export function getPromptCount(): number {
|
|
117
|
+
return promptMap.size;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Export individual prompt categories for documentation
|
|
122
|
+
*/
|
|
123
|
+
export { tradingPrompts, portfolioPrompts, analysisPrompts };
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portfolio Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for portfolio management on Gala Launchpad
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
+
import { createPortfolioWorkflow } from './utils/workflowTemplates.js';
|
|
10
|
+
import { validateTokenName, validatePaginationLimit } from '../utils/validation.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Portfolio - Complete portfolio analysis
|
|
14
|
+
*/
|
|
15
|
+
export const portfolioPrompt: MCPPrompt = {
|
|
16
|
+
name: 'galachain-launchpad:portfolio',
|
|
17
|
+
description: 'Analyze complete portfolio with GALA balance, token holdings, and total USD value',
|
|
18
|
+
handler: () => [
|
|
19
|
+
{
|
|
20
|
+
role: 'user',
|
|
21
|
+
content: {
|
|
22
|
+
type: 'text',
|
|
23
|
+
text: createPortfolioWorkflow(),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Tokens Held - List all token holdings
|
|
31
|
+
*/
|
|
32
|
+
export const tokensHeldPrompt: MCPPrompt = {
|
|
33
|
+
name: 'galachain-launchpad:tokens-held',
|
|
34
|
+
description: 'List all Launchpad tokens currently held with balances',
|
|
35
|
+
arguments: [
|
|
36
|
+
{
|
|
37
|
+
name: 'search',
|
|
38
|
+
description: 'Optional search filter for token names (fuzzy match)',
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'limit',
|
|
43
|
+
description: 'Number of tokens to show (default: 20)',
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
handler: (args) => {
|
|
48
|
+
// Validate inputs
|
|
49
|
+
if (args.limit) {
|
|
50
|
+
validatePaginationLimit(args.limit, 100);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const limit = args.limit || '20';
|
|
54
|
+
const searchFilter = args.search
|
|
55
|
+
? `- search: "${args.search}" (fuzzy match filter)`
|
|
56
|
+
: '- No search filter (show all tokens)';
|
|
57
|
+
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
role: 'user',
|
|
61
|
+
content: {
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: `Show me all Launchpad tokens I'm currently holding:
|
|
64
|
+
|
|
65
|
+
Use ${MCP_TOOLS.FETCH_TOKENS_HELD} with:
|
|
66
|
+
${searchFilter}
|
|
67
|
+
- limit: ${limit}
|
|
68
|
+
|
|
69
|
+
For each token, display:
|
|
70
|
+
- Token name
|
|
71
|
+
- Balance (formatted with decimals)
|
|
72
|
+
- Whether I created this token (if applicable)
|
|
73
|
+
|
|
74
|
+
Sort by balance (highest to lowest).
|
|
75
|
+
|
|
76
|
+
If I have more tokens than the limit, show pagination info and offer to fetch more.`,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Tokens Created - Show tokens created by user
|
|
85
|
+
*/
|
|
86
|
+
export const tokensCreatedPrompt: MCPPrompt = {
|
|
87
|
+
name: 'galachain-launchpad:tokens-created',
|
|
88
|
+
description: 'List all Launchpad tokens created by the user with their current status',
|
|
89
|
+
arguments: [
|
|
90
|
+
{
|
|
91
|
+
name: 'search',
|
|
92
|
+
description: 'Optional search filter for token names (fuzzy match)',
|
|
93
|
+
required: false,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'limit',
|
|
97
|
+
description: 'Number of tokens to show (default: 20)',
|
|
98
|
+
required: false,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
handler: (args) => {
|
|
102
|
+
// Validate inputs
|
|
103
|
+
if (args.limit) {
|
|
104
|
+
validatePaginationLimit(args.limit, 100);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const limit = args.limit || '20';
|
|
108
|
+
const searchFilter = args.search
|
|
109
|
+
? `- search: "${args.search}" (fuzzy match filter)`
|
|
110
|
+
: '- No search filter (show all tokens)';
|
|
111
|
+
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
role: 'user',
|
|
115
|
+
content: {
|
|
116
|
+
type: 'text',
|
|
117
|
+
text: `Show me all Launchpad tokens I've created:
|
|
118
|
+
|
|
119
|
+
Use ${MCP_TOOLS.FETCH_TOKENS_CREATED} with:
|
|
120
|
+
${searchFilter}
|
|
121
|
+
- limit: ${limit}
|
|
122
|
+
|
|
123
|
+
For each token, display:
|
|
124
|
+
- Token name and symbol
|
|
125
|
+
- Current status (check using ${MCP_TOOLS.FETCH_POOL_DETAILS}):
|
|
126
|
+
* Pool status (Ongoing/Completed)
|
|
127
|
+
* Current supply
|
|
128
|
+
* Remaining tokens
|
|
129
|
+
* Progress percentage
|
|
130
|
+
- Whether graduated (use ${MCP_TOOLS.IS_TOKEN_GRADUATED})
|
|
131
|
+
- Frontend URL (use ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME})
|
|
132
|
+
|
|
133
|
+
Provide a summary:
|
|
134
|
+
- Total tokens created
|
|
135
|
+
- How many are graduated
|
|
136
|
+
- How many are still in bonding curve phase`,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Balance - Check GALA and specific token balances
|
|
145
|
+
*/
|
|
146
|
+
export const balancePrompt: MCPPrompt = {
|
|
147
|
+
name: 'galachain-launchpad:balance',
|
|
148
|
+
description: 'Check GALA balance and optionally a specific token balance',
|
|
149
|
+
arguments: [
|
|
150
|
+
{
|
|
151
|
+
name: 'tokenName',
|
|
152
|
+
description: 'Optional token name to check balance for (e.g., anime)',
|
|
153
|
+
required: false,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
handler: (args) => {
|
|
157
|
+
// Validate inputs
|
|
158
|
+
if (args.tokenName) {
|
|
159
|
+
validateTokenName(args.tokenName);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
role: 'user',
|
|
165
|
+
content: {
|
|
166
|
+
type: 'text',
|
|
167
|
+
text: args.tokenName
|
|
168
|
+
? `Check my balances:
|
|
169
|
+
|
|
170
|
+
1. GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}
|
|
171
|
+
2. ${args.tokenName} token balance using ${MCP_TOOLS.FETCH_TOKEN_BALANCE}
|
|
172
|
+
3. Calculate USD values:
|
|
173
|
+
- GALA USD value using ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE}
|
|
174
|
+
- ${args.tokenName} USD value using ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE}
|
|
175
|
+
|
|
176
|
+
Display:
|
|
177
|
+
- GALA: [amount] ($[USD value])
|
|
178
|
+
- ${args.tokenName}: [amount] ($[USD value])
|
|
179
|
+
- Total value: $[combined USD value]`
|
|
180
|
+
: `Check my GALA balance:
|
|
181
|
+
|
|
182
|
+
Use ${MCP_TOOLS.FETCH_GALA_BALANCE} to get current GALA balance.
|
|
183
|
+
Use ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE} to calculate USD value.
|
|
184
|
+
|
|
185
|
+
Display:
|
|
186
|
+
- GALA: [amount]
|
|
187
|
+
- USD value: $[calculated value]
|
|
188
|
+
|
|
189
|
+
Tip: Add tokenName argument to check a specific token balance.`,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Profile - Show user profile information
|
|
198
|
+
*/
|
|
199
|
+
export const profilePrompt: MCPPrompt = {
|
|
200
|
+
name: 'galachain-launchpad:profile',
|
|
201
|
+
description: 'Show user profile information and activity summary',
|
|
202
|
+
handler: () => [
|
|
203
|
+
{
|
|
204
|
+
role: 'user',
|
|
205
|
+
content: {
|
|
206
|
+
type: 'text',
|
|
207
|
+
text: `Show my Gala Launchpad profile:
|
|
208
|
+
|
|
209
|
+
1. Get profile info using ${MCP_TOOLS.FETCH_PROFILE}
|
|
210
|
+
- Full name
|
|
211
|
+
- Profile image URL
|
|
212
|
+
- Wallet address
|
|
213
|
+
|
|
214
|
+
2. Get activity summary:
|
|
215
|
+
- Tokens held count: ${MCP_TOOLS.FETCH_TOKENS_HELD} (limit: 1) for total
|
|
216
|
+
- Tokens created count: ${MCP_TOOLS.FETCH_TOKENS_CREATED} (limit: 1) for total
|
|
217
|
+
|
|
218
|
+
3. Get wallet info:
|
|
219
|
+
- GalaChain address format: ${MCP_TOOLS.GET_ADDRESS}
|
|
220
|
+
- Ethereum address format: ${MCP_TOOLS.GET_ETHEREUM_ADDRESS}
|
|
221
|
+
- GALA balance: ${MCP_TOOLS.FETCH_GALA_BALANCE}
|
|
222
|
+
|
|
223
|
+
Display:
|
|
224
|
+
- Profile details
|
|
225
|
+
- Activity metrics
|
|
226
|
+
- Wallet addresses
|
|
227
|
+
- Current balance`,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Export all portfolio prompts
|
|
235
|
+
*/
|
|
236
|
+
export const portfolioPrompts: MCPPrompt[] = [
|
|
237
|
+
portfolioPrompt,
|
|
238
|
+
tokensHeldPrompt,
|
|
239
|
+
tokensCreatedPrompt,
|
|
240
|
+
balancePrompt,
|
|
241
|
+
profilePrompt,
|
|
242
|
+
];
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
];
|