@gala-chain/launchpad-mcp-server 1.22.4 → 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 +118 -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/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,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Transfer Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for transferring tokens and GALA
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
+
import { validateAddress, validateNumericAmount, validateTokenName } from '../utils/validation.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transfer GALA - GALA token transfer
|
|
13
|
+
*/
|
|
14
|
+
export const transferGalaPrompt: MCPPrompt = {
|
|
15
|
+
name: 'galachain-launchpad:transfer-gala',
|
|
16
|
+
description: 'Transfer GALA tokens to another wallet',
|
|
17
|
+
arguments: [
|
|
18
|
+
{
|
|
19
|
+
name: 'recipientAddress',
|
|
20
|
+
description: 'Recipient wallet address',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'amount',
|
|
25
|
+
description: 'Amount of GALA to transfer',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
handler: (args) => {
|
|
30
|
+
validateAddress(args.recipientAddress, 'recipientAddress');
|
|
31
|
+
validateNumericAmount(args.amount, 'amount');
|
|
32
|
+
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
role: 'user',
|
|
36
|
+
content: {
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: `Transfer GALA tokens.
|
|
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.`,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Transfer Token - Launchpad token transfer
|
|
54
|
+
*/
|
|
55
|
+
export const transferTokenPrompt: MCPPrompt = {
|
|
56
|
+
name: 'galachain-launchpad:transfer-token',
|
|
57
|
+
description: 'Transfer launchpad tokens to another wallet',
|
|
58
|
+
arguments: [
|
|
59
|
+
{
|
|
60
|
+
name: 'to',
|
|
61
|
+
description: 'Recipient wallet address',
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'tokenName',
|
|
66
|
+
description: 'Token name (e.g., anime)',
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'amount',
|
|
71
|
+
description: 'Token amount to transfer',
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
handler: (args) => {
|
|
76
|
+
validateAddress(args.to, 'to');
|
|
77
|
+
validateTokenName(args.tokenName, 'tokenName');
|
|
78
|
+
validateNumericAmount(args.amount, 'amount');
|
|
79
|
+
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
role: 'user',
|
|
83
|
+
content: {
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: `Transfer launchpad tokens.
|
|
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.`,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const transferPrompts: MCPPrompt[] = [
|
|
101
|
+
transferGalaPrompt,
|
|
102
|
+
transferTokenPrompt,
|
|
103
|
+
];
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Tools Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for utility and system operations
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create Wallet - Generate new wallet
|
|
12
|
+
*/
|
|
13
|
+
export const createWalletPrompt: MCPPrompt = {
|
|
14
|
+
name: 'galachain-launchpad:create-wallet',
|
|
15
|
+
description: 'Generate a new wallet with random private key',
|
|
16
|
+
handler: () => {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
role: 'user',
|
|
20
|
+
content: {
|
|
21
|
+
type: 'text',
|
|
22
|
+
text: `Create a new wallet with random private key.
|
|
23
|
+
|
|
24
|
+
Use ${MCP_TOOLS.CREATE_WALLET} to generate:
|
|
25
|
+
- New wallet address
|
|
26
|
+
- Random private key
|
|
27
|
+
- Wallet credentials for authentication
|
|
28
|
+
|
|
29
|
+
Display the wallet details with a security warning about private key storage.`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get Address - Get GalaChain address
|
|
38
|
+
*/
|
|
39
|
+
export const getAddressPrompt: MCPPrompt = {
|
|
40
|
+
name: 'galachain-launchpad:get-address',
|
|
41
|
+
description: 'Get the GalaChain address format of authenticated wallet',
|
|
42
|
+
handler: () => {
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
role: 'user',
|
|
46
|
+
content: {
|
|
47
|
+
type: 'text',
|
|
48
|
+
text: `Get the GalaChain format address of the authenticated wallet.
|
|
49
|
+
|
|
50
|
+
Use ${MCP_TOOLS.GET_ADDRESS} to retrieve the address in GalaChain format (eth|0x...).
|
|
51
|
+
|
|
52
|
+
Display the wallet address.`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get Ethereum Address - Get Ethereum address
|
|
61
|
+
*/
|
|
62
|
+
export const getEthereumAddressPrompt: MCPPrompt = {
|
|
63
|
+
name: 'galachain-launchpad:get-ethereum-address',
|
|
64
|
+
description: 'Get the standard Ethereum address format of authenticated wallet',
|
|
65
|
+
handler: () => {
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
role: 'user',
|
|
69
|
+
content: {
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: `Get the standard Ethereum format address of the authenticated wallet.
|
|
72
|
+
|
|
73
|
+
Use ${MCP_TOOLS.GET_ETHEREUM_ADDRESS} to retrieve the address in Ethereum format (0x...).
|
|
74
|
+
|
|
75
|
+
Display the wallet address.`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get Config - View SDK configuration
|
|
84
|
+
*/
|
|
85
|
+
export const getConfigPrompt: MCPPrompt = {
|
|
86
|
+
name: 'galachain-launchpad:get-config',
|
|
87
|
+
description: 'View current SDK and MCP server configuration',
|
|
88
|
+
handler: () => {
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
91
|
+
role: 'user',
|
|
92
|
+
content: {
|
|
93
|
+
type: 'text',
|
|
94
|
+
text: `Get the current SDK and MCP server configuration.
|
|
95
|
+
|
|
96
|
+
Use ${MCP_TOOLS.GET_CONFIG} to retrieve:
|
|
97
|
+
- Environment (production, development, testing)
|
|
98
|
+
- Base URLs
|
|
99
|
+
- Timeout settings
|
|
100
|
+
- Feature flags
|
|
101
|
+
- Effective slippage tolerance factors
|
|
102
|
+
- Current MCP server environment state
|
|
103
|
+
|
|
104
|
+
Display the configuration in a readable format.`,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Get URL by Token Name - Generate launchpad URL
|
|
113
|
+
*/
|
|
114
|
+
export const getUrlByTokenNamePrompt: MCPPrompt = {
|
|
115
|
+
name: 'galachain-launchpad:get-url-by-token-name',
|
|
116
|
+
description: 'Get the launchpad frontend URL for a token',
|
|
117
|
+
arguments: [
|
|
118
|
+
{
|
|
119
|
+
name: 'tokenName',
|
|
120
|
+
description: 'Token name (e.g., anime)',
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
handler: (args) => {
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
role: 'user',
|
|
128
|
+
content: {
|
|
129
|
+
type: 'text',
|
|
130
|
+
text: `Get the launchpad frontend URL for a token.
|
|
131
|
+
|
|
132
|
+
Token: ${args.tokenName}
|
|
133
|
+
|
|
134
|
+
Use ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME} to generate the URL.
|
|
135
|
+
|
|
136
|
+
Display the complete launchpad URL for viewing/trading the token.`,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Explain SDK Usage - SDK documentation helper
|
|
145
|
+
*/
|
|
146
|
+
export const explainSdkUsagePrompt: MCPPrompt = {
|
|
147
|
+
name: 'galachain-launchpad:explain-sdk-usage',
|
|
148
|
+
description: 'Get detailed SDK usage examples for a topic',
|
|
149
|
+
arguments: [
|
|
150
|
+
{
|
|
151
|
+
name: 'topic',
|
|
152
|
+
description: 'Topic: buy-tokens, sell-tokens, pool-graduation, fetch-pools, balances, dex-trading, liquidity-positions, price-history, token-details, token-distribution, token-creation, profile-management, multi-wallet, transfers, error-handling, installation, local-calculations, mcp-to-sdk-mapping',
|
|
153
|
+
required: true,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
handler: (args) => {
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
role: 'user',
|
|
160
|
+
content: {
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: `Get detailed SDK usage examples for topic: ${args.topic}
|
|
163
|
+
|
|
164
|
+
Use ${MCP_TOOLS.EXPLAIN_SDK_USAGE} to retrieve complete runnable code examples.
|
|
165
|
+
|
|
166
|
+
Display the examples with explanations for integrating the SDK directly.`,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get Cache Info - Cache statistics
|
|
175
|
+
*/
|
|
176
|
+
export const getCacheInfoPrompt: MCPPrompt = {
|
|
177
|
+
name: 'galachain-launchpad:get-cache-info',
|
|
178
|
+
description: 'Get token metadata cache statistics',
|
|
179
|
+
handler: () => {
|
|
180
|
+
return [
|
|
181
|
+
{
|
|
182
|
+
role: 'user',
|
|
183
|
+
content: {
|
|
184
|
+
type: 'text',
|
|
185
|
+
text: `Get token metadata cache statistics.
|
|
186
|
+
|
|
187
|
+
Use ${MCP_TOOLS.GET_CACHE_INFO} to retrieve:
|
|
188
|
+
- Total tokens cached
|
|
189
|
+
- Cache size in bytes
|
|
190
|
+
- Timestamp of oldest entry
|
|
191
|
+
|
|
192
|
+
Display the cache information.`,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Clear Cache - Cache management
|
|
201
|
+
*/
|
|
202
|
+
export const clearCachePrompt: MCPPrompt = {
|
|
203
|
+
name: 'galachain-launchpad:clear-cache',
|
|
204
|
+
description: 'Clear token metadata cache',
|
|
205
|
+
arguments: [
|
|
206
|
+
{
|
|
207
|
+
name: 'tokenName',
|
|
208
|
+
description: 'Token name to clear (optional, clears all if not provided)',
|
|
209
|
+
required: false,
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
handler: (args) => {
|
|
213
|
+
return [
|
|
214
|
+
{
|
|
215
|
+
role: 'user',
|
|
216
|
+
content: {
|
|
217
|
+
type: 'text',
|
|
218
|
+
text: `Clear token metadata cache.
|
|
219
|
+
|
|
220
|
+
${args.tokenName ? `Token: ${args.tokenName}` : 'Clearing entire cache'}
|
|
221
|
+
|
|
222
|
+
Use ${MCP_TOOLS.CLEAR_CACHE} to clear the cache.
|
|
223
|
+
|
|
224
|
+
Display confirmation of cache clearing.`,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
];
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Has Wallet - Check wallet status
|
|
233
|
+
*/
|
|
234
|
+
export const hasWalletPrompt: MCPPrompt = {
|
|
235
|
+
name: 'galachain-launchpad:has-wallet',
|
|
236
|
+
description: 'Check if a wallet is configured in the MCP server',
|
|
237
|
+
handler: () => {
|
|
238
|
+
return [
|
|
239
|
+
{
|
|
240
|
+
role: 'user',
|
|
241
|
+
content: {
|
|
242
|
+
type: 'text',
|
|
243
|
+
text: `Check wallet configuration status.
|
|
244
|
+
|
|
245
|
+
Use ${MCP_TOOLS.HAS_WALLET} to determine:
|
|
246
|
+
- Whether a wallet is configured
|
|
247
|
+
- Whether MCP server is in full-access or read-only mode
|
|
248
|
+
|
|
249
|
+
Display the wallet status clearly.`,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Get Wallet - Get wallet instance
|
|
258
|
+
*/
|
|
259
|
+
export const getWalletPrompt: MCPPrompt = {
|
|
260
|
+
name: 'galachain-launchpad:get-wallet',
|
|
261
|
+
description: 'Get the currently configured wallet instance',
|
|
262
|
+
handler: () => {
|
|
263
|
+
return [
|
|
264
|
+
{
|
|
265
|
+
role: 'user',
|
|
266
|
+
content: {
|
|
267
|
+
type: 'text',
|
|
268
|
+
text: `Get the currently configured wallet instance.
|
|
269
|
+
|
|
270
|
+
Use ${MCP_TOOLS.GET_WALLET} to retrieve:
|
|
271
|
+
- Wallet object if available
|
|
272
|
+
- Null if in read-only mode
|
|
273
|
+
|
|
274
|
+
Display the wallet information.`,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
];
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Set Wallet - Configure wallet
|
|
283
|
+
*/
|
|
284
|
+
export const setWalletPrompt: MCPPrompt = {
|
|
285
|
+
name: 'galachain-launchpad:set-wallet',
|
|
286
|
+
description: 'Configure a wallet for signing operations',
|
|
287
|
+
arguments: [
|
|
288
|
+
{
|
|
289
|
+
name: 'privateKey',
|
|
290
|
+
description: 'Private key in hex format (0x + 64 hex characters)',
|
|
291
|
+
required: true,
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
handler: (args) => {
|
|
295
|
+
return [
|
|
296
|
+
{
|
|
297
|
+
role: 'user',
|
|
298
|
+
content: {
|
|
299
|
+
type: 'text',
|
|
300
|
+
text: `Configure wallet for signing operations.
|
|
301
|
+
|
|
302
|
+
Private Key: ${args.privateKey.substring(0, 10)}...${args.privateKey.substring(60)}
|
|
303
|
+
|
|
304
|
+
Use ${MCP_TOOLS.SET_WALLET} to configure the wallet.
|
|
305
|
+
|
|
306
|
+
Display confirmation that wallet is configured for full-access mode.`,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
];
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Get Environment - Current environment query
|
|
315
|
+
*/
|
|
316
|
+
export const getEnvironmentPrompt: MCPPrompt = {
|
|
317
|
+
name: 'galachain-launchpad:get-environment',
|
|
318
|
+
description: 'Get the current MCP server environment',
|
|
319
|
+
handler: () => {
|
|
320
|
+
return [
|
|
321
|
+
{
|
|
322
|
+
role: 'user',
|
|
323
|
+
content: {
|
|
324
|
+
type: 'text',
|
|
325
|
+
text: `Get the current MCP server environment.
|
|
326
|
+
|
|
327
|
+
Use ${MCP_TOOLS.GET_ENVIRONMENT} to retrieve the active environment.
|
|
328
|
+
|
|
329
|
+
Display the current environment (production, development, or testing).`,
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
];
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export const utilityToolPrompts: MCPPrompt[] = [
|
|
337
|
+
createWalletPrompt,
|
|
338
|
+
getAddressPrompt,
|
|
339
|
+
getEthereumAddressPrompt,
|
|
340
|
+
getConfigPrompt,
|
|
341
|
+
getUrlByTokenNamePrompt,
|
|
342
|
+
explainSdkUsagePrompt,
|
|
343
|
+
getCacheInfoPrompt,
|
|
344
|
+
clearCachePrompt,
|
|
345
|
+
hasWalletPrompt,
|
|
346
|
+
getWalletPrompt,
|
|
347
|
+
setWalletPrompt,
|
|
348
|
+
getEnvironmentPrompt,
|
|
349
|
+
];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for utility and information operations on Gala Launchpad
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get Version - Display SDK and MCP server version information
|
|
11
|
+
*
|
|
12
|
+
* Shows the current versions of both the Gala Launchpad SDK and the MCP server,
|
|
13
|
+
* useful for debugging version mismatch issues or verifying installed versions.
|
|
14
|
+
*/
|
|
15
|
+
export const getVersionPrompt: MCPPrompt = {
|
|
16
|
+
name: 'galachain-launchpad:version',
|
|
17
|
+
description: 'Get SDK and MCP server version information',
|
|
18
|
+
handler: () => {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
role: 'user',
|
|
22
|
+
content: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: `Get version information for the Gala Launchpad SDK and MCP server.
|
|
25
|
+
|
|
26
|
+
Use the gala_launchpad_get_version tool to fetch the version details.
|
|
27
|
+
|
|
28
|
+
Display the results in a clear, formatted response showing:
|
|
29
|
+
1. SDK Version
|
|
30
|
+
2. MCP Server Version
|
|
31
|
+
3. Timestamp
|
|
32
|
+
|
|
33
|
+
This is helpful for debugging version compatibility issues or confirming installed versions.`,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Switch Environment - Dynamically change the MCP server environment
|
|
42
|
+
*
|
|
43
|
+
* Allows switching between production, development, and testing environments
|
|
44
|
+
* while preserving wallet configuration. Useful for testing against different
|
|
45
|
+
* backends or performing administrative operations.
|
|
46
|
+
*/
|
|
47
|
+
export const switchEnvironmentPrompt: MCPPrompt = {
|
|
48
|
+
name: 'galachain-launchpad:switch-environment',
|
|
49
|
+
description: 'Switch the MCP server to a different environment (production, development, or testing)',
|
|
50
|
+
arguments: [
|
|
51
|
+
{
|
|
52
|
+
name: 'environment',
|
|
53
|
+
description: 'Target environment: production, development, or testing',
|
|
54
|
+
required: false,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
handler: (args) => {
|
|
58
|
+
const targetEnv = args.environment?.toLowerCase() || '';
|
|
59
|
+
const validEnvs = ['production', 'development', 'testing'];
|
|
60
|
+
const isValidEnv = validEnvs.includes(targetEnv);
|
|
61
|
+
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
role: 'user',
|
|
65
|
+
content: {
|
|
66
|
+
type: 'text',
|
|
67
|
+
text: `Switch the Gala Launchpad MCP server to a different environment.
|
|
68
|
+
|
|
69
|
+
Current task: Switch to the ${isValidEnv ? targetEnv : 'specified'} environment
|
|
70
|
+
|
|
71
|
+
Steps:
|
|
72
|
+
1. First, get the current environment using the gala_launchpad_get_environment tool to see what we're currently on
|
|
73
|
+
2. If switching is needed, use the gala_launchpad_switch_environment tool with environment="${targetEnv || 'production'}"
|
|
74
|
+
3. After switching, verify the change by calling gala_launchpad_get_environment again
|
|
75
|
+
4. Confirm the environment switch was successful and display the results
|
|
76
|
+
|
|
77
|
+
Available environments:
|
|
78
|
+
- production: Production environment (default)
|
|
79
|
+
- development: Development environment for testing features
|
|
80
|
+
- testing: Testing environment for local/staging tests
|
|
81
|
+
|
|
82
|
+
Wallet Preservation: The wallet configuration will be preserved during the switch, maintaining your current signing capabilities if configured.`,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* All utility prompts
|
|
91
|
+
*/
|
|
92
|
+
export const utilityPrompts: MCPPrompt[] = [getVersionPrompt, switchEnvironmentPrompt];
|