@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.
Files changed (120) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/README.md +83 -8
  3. package/dist/constants/mcpToolNames.d.ts +69 -11
  4. package/dist/constants/mcpToolNames.d.ts.map +1 -1
  5. package/dist/constants/mcpToolNames.js +47 -9
  6. package/dist/constants/mcpToolNames.js.map +1 -1
  7. package/dist/generated/version.d.ts +1 -1
  8. package/dist/generated/version.js +1 -1
  9. package/dist/prompts/balances.d.ts +24 -0
  10. package/dist/prompts/balances.d.ts.map +1 -0
  11. package/dist/prompts/balances.js +191 -0
  12. package/dist/prompts/balances.js.map +1 -0
  13. package/dist/prompts/creation-utils.d.ts +20 -0
  14. package/dist/prompts/creation-utils.d.ts.map +1 -0
  15. package/dist/prompts/creation-utils.js +115 -0
  16. package/dist/prompts/creation-utils.js.map +1 -0
  17. package/dist/prompts/index.d.ts +9 -2
  18. package/dist/prompts/index.d.ts.map +1 -1
  19. package/dist/prompts/index.js +23 -2
  20. package/dist/prompts/index.js.map +1 -1
  21. package/dist/prompts/pools.d.ts +64 -0
  22. package/dist/prompts/pools.d.ts.map +1 -0
  23. package/dist/prompts/pools.js +548 -0
  24. package/dist/prompts/pools.js.map +1 -0
  25. package/dist/prompts/social.d.ts +16 -0
  26. package/dist/prompts/social.d.ts.map +1 -0
  27. package/dist/prompts/social.js +97 -0
  28. package/dist/prompts/social.js.map +1 -0
  29. package/dist/prompts/trading-calculations.d.ts +52 -0
  30. package/dist/prompts/trading-calculations.d.ts.map +1 -0
  31. package/dist/prompts/trading-calculations.js +479 -0
  32. package/dist/prompts/trading-calculations.js.map +1 -0
  33. package/dist/prompts/transfers.d.ts +16 -0
  34. package/dist/prompts/transfers.d.ts.map +1 -0
  35. package/dist/prompts/transfers.js +100 -0
  36. package/dist/prompts/transfers.js.map +1 -0
  37. package/dist/prompts/utility-tools.d.ts +56 -0
  38. package/dist/prompts/utility-tools.d.ts.map +1 -0
  39. package/dist/prompts/utility-tools.js +338 -0
  40. package/dist/prompts/utility-tools.js.map +1 -0
  41. package/docs/AI-AGENT-PATTERNS.md +555 -0
  42. package/docs/CONSTRAINTS-REFERENCE.md +454 -0
  43. package/docs/PROMPT-TOOL-MAPPING.md +352 -0
  44. package/docs/examples/default-values-pattern.md +240 -0
  45. package/docs/examples/tool-factory-pattern.md +217 -0
  46. package/jest.config.js +94 -0
  47. package/package.json +1 -1
  48. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +258 -0
  49. package/src/__tests__/integration/poolTools.integration.test.ts +185 -0
  50. package/src/__tests__/server.test.ts +256 -0
  51. package/src/constants/mcpToolNames.ts +181 -0
  52. package/src/index.ts +19 -0
  53. package/src/prompts/__tests__/promptStructure.test.ts +137 -0
  54. package/src/prompts/__tests__/registry.test.ts +359 -0
  55. package/src/prompts/analysis.ts +429 -0
  56. package/src/prompts/balances.ts +198 -0
  57. package/src/prompts/create-token.ts +123 -0
  58. package/src/prompts/creation-utils.ts +118 -0
  59. package/src/prompts/dex-trading.ts +86 -0
  60. package/src/prompts/discover-tokens.ts +86 -0
  61. package/src/prompts/index.ts +175 -0
  62. package/src/prompts/liquidity-positions.ts +270 -0
  63. package/src/prompts/pools.ts +571 -0
  64. package/src/prompts/portfolio.ts +242 -0
  65. package/src/prompts/social.ts +100 -0
  66. package/src/prompts/trading-calculations.ts +499 -0
  67. package/src/prompts/trading.ts +191 -0
  68. package/src/prompts/transfers.ts +103 -0
  69. package/src/prompts/utility-tools.ts +349 -0
  70. package/src/prompts/utility.ts +92 -0
  71. package/src/prompts/utils/workflowTemplates.ts +511 -0
  72. package/src/schemas/common-schemas.ts +393 -0
  73. package/src/scripts/test-all-prompts.ts +184 -0
  74. package/src/server.ts +367 -0
  75. package/src/tools/__tests__/dex-tools.test.ts +562 -0
  76. package/src/tools/__tests__/liquidity-positions.test.ts +673 -0
  77. package/src/tools/balance/index.ts +174 -0
  78. package/src/tools/creation/index.ts +182 -0
  79. package/src/tools/dex/index.ts +226 -0
  80. package/src/tools/dex/liquidity-positions.ts +547 -0
  81. package/src/tools/index.ts +94 -0
  82. package/src/tools/pools/fetchAllPools.ts +47 -0
  83. package/src/tools/pools/fetchAllPriceHistory.ts +119 -0
  84. package/src/tools/pools/fetchPoolDetails.ts +27 -0
  85. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +22 -0
  86. package/src/tools/pools/fetchPools.ts +47 -0
  87. package/src/tools/pools/fetchPriceHistory.ts +124 -0
  88. package/src/tools/pools/fetchTokenDetails.ts +77 -0
  89. package/src/tools/pools/index.ts +284 -0
  90. package/src/tools/social/index.ts +64 -0
  91. package/src/tools/trading/index.ts +605 -0
  92. package/src/tools/transfers/index.ts +75 -0
  93. package/src/tools/utils/clearCache.ts +36 -0
  94. package/src/tools/utils/createWallet.ts +19 -0
  95. package/src/tools/utils/explainSdkUsage.ts +1446 -0
  96. package/src/tools/utils/getAddress.ts +12 -0
  97. package/src/tools/utils/getCacheInfo.ts +14 -0
  98. package/src/tools/utils/getConfig.ts +21 -0
  99. package/src/tools/utils/getEnvironment.ts +17 -0
  100. package/src/tools/utils/getEthereumAddress.ts +12 -0
  101. package/src/tools/utils/getUrlByTokenName.ts +12 -0
  102. package/src/tools/utils/getVersion.ts +25 -0
  103. package/src/tools/utils/getWallet.ts +25 -0
  104. package/src/tools/utils/hasWallet.ts +15 -0
  105. package/src/tools/utils/index.ts +37 -0
  106. package/src/tools/utils/isTokenGraduated.ts +16 -0
  107. package/src/tools/utils/setWallet.ts +41 -0
  108. package/src/tools/utils/switchEnvironment.ts +28 -0
  109. package/src/types/mcp.ts +72 -0
  110. package/src/utils/__tests__/validation.test.ts +147 -0
  111. package/src/utils/constraints.ts +155 -0
  112. package/src/utils/default-values.ts +208 -0
  113. package/src/utils/error-handler.ts +69 -0
  114. package/src/utils/error-templates.ts +273 -0
  115. package/src/utils/response-formatter.ts +51 -0
  116. package/src/utils/tool-factory.ts +303 -0
  117. package/src/utils/tool-registry.ts +296 -0
  118. package/src/utils/validation.ts +371 -0
  119. package/tests/wallet-management-integration.test.ts +284 -0
  120. package/tsconfig.json +23 -0
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Token Creation Prompts
3
+ *
4
+ * Slash commands for creating new tokens on Gala Launchpad
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { createCreateTokenWorkflow } from './utils/workflowTemplates.js';
9
+ import {
10
+ validateTokenName,
11
+ validateTokenSymbol,
12
+ validateUrl,
13
+ validateNumericAmount,
14
+ } from '../utils/validation.js';
15
+
16
+ /**
17
+ * Create Token - Guided token creation workflow
18
+ */
19
+ export const createTokenPrompt: MCPPrompt = {
20
+ name: 'galachain-launchpad:create-token',
21
+ description:
22
+ 'Guide user through creating a new token on Gala Launchpad with metadata, image upload, and optional pre-buy',
23
+ arguments: [
24
+ {
25
+ name: 'tokenName',
26
+ description:
27
+ 'Name for the new token - must be 3-20 lowercase alphanumeric characters (e.g., "mytoken")',
28
+ required: true,
29
+ },
30
+ {
31
+ name: 'tokenSymbol',
32
+ description: 'Token symbol - must be 1-8 uppercase letters (e.g., "MTK")',
33
+ required: true,
34
+ },
35
+ {
36
+ name: 'description',
37
+ description: 'Token description - brief description of what the token is for (1-500 chars)',
38
+ required: true,
39
+ },
40
+ {
41
+ name: 'websiteUrl',
42
+ description: 'Optional website URL (e.g., "https://mytoken.com") - at least one social URL required',
43
+ required: false,
44
+ },
45
+ {
46
+ name: 'twitterUrl',
47
+ description:
48
+ 'Optional Twitter profile URL (e.g., "https://twitter.com/mytoken") - at least one social URL required',
49
+ required: false,
50
+ },
51
+ {
52
+ name: 'telegramUrl',
53
+ description:
54
+ 'Optional Telegram channel URL (e.g., "https://t.me/mytoken") - at least one social URL required',
55
+ required: false,
56
+ },
57
+ {
58
+ name: 'imagePath',
59
+ description:
60
+ 'Optional path to token image file - will be uploaded to IPFS (e.g., "/path/to/image.png")',
61
+ required: false,
62
+ },
63
+ {
64
+ name: 'preBuyGala',
65
+ description:
66
+ 'Optional GALA amount for initial token purchase (e.g., "100" for 100 GALA) - helps bootstrap liquidity',
67
+ required: false,
68
+ },
69
+ ],
70
+ handler: (args) => {
71
+ // Validate inputs
72
+ validateTokenName(args.tokenName);
73
+ validateTokenSymbol(args.tokenSymbol);
74
+
75
+ // Validate at least one social URL
76
+ const hasSocialUrl = args.websiteUrl || args.twitterUrl || args.telegramUrl;
77
+ if (!hasSocialUrl) {
78
+ throw new Error(
79
+ 'At least one social URL is required: websiteUrl, twitterUrl, or telegramUrl'
80
+ );
81
+ }
82
+
83
+ // Validate social URLs if provided
84
+ if (args.websiteUrl) {
85
+ validateUrl(args.websiteUrl, 'websiteUrl');
86
+ }
87
+ if (args.twitterUrl) {
88
+ validateUrl(args.twitterUrl, 'twitterUrl');
89
+ }
90
+ if (args.telegramUrl) {
91
+ validateUrl(args.telegramUrl, 'telegramUrl');
92
+ }
93
+
94
+ // Validate pre-buy amount if provided
95
+ if (args.preBuyGala) {
96
+ validateNumericAmount(args.preBuyGala, 'preBuyGala');
97
+ }
98
+
99
+ return [
100
+ {
101
+ role: 'user',
102
+ content: {
103
+ type: 'text',
104
+ text: createCreateTokenWorkflow({
105
+ tokenName: args.tokenName,
106
+ tokenSymbol: args.tokenSymbol,
107
+ description: args.description,
108
+ websiteUrl: args.websiteUrl,
109
+ twitterUrl: args.twitterUrl,
110
+ telegramUrl: args.telegramUrl,
111
+ imagePath: args.imagePath,
112
+ preBuyGala: args.preBuyGala,
113
+ }),
114
+ },
115
+ },
116
+ ];
117
+ },
118
+ };
119
+
120
+ /**
121
+ * Export all token creation prompts
122
+ */
123
+ export const creationPrompts: MCPPrompt[] = [createTokenPrompt];
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Token Creation Utilities Prompts
3
+ *
4
+ * Slash commands for creation utility operations
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { MCP_TOOLS } from '../constants/mcpToolNames.js';
9
+ import { validateTokenName } from '../utils/validation.js';
10
+
11
+ /**
12
+ * Upload Profile Image - Standalone profile image upload
13
+ */
14
+ export const uploadProfileImagePrompt: MCPPrompt = {
15
+ name: 'galachain-launchpad:upload-profile-image',
16
+ description: 'Upload profile image from filesystem',
17
+ arguments: [
18
+ {
19
+ name: 'imagePath',
20
+ description: 'Absolute file path to image file',
21
+ required: true,
22
+ },
23
+ {
24
+ name: 'address',
25
+ description: 'Wallet address (optional, defaults to SDK wallet)',
26
+ required: false,
27
+ },
28
+ ],
29
+ handler: (args) => {
30
+ return [
31
+ {
32
+ role: 'user',
33
+ content: {
34
+ type: 'text',
35
+ text: `Upload profile image.
36
+
37
+ Image Path: ${args.imagePath}
38
+ ${args.address ? `Address: ${args.address}` : 'Using default wallet'}
39
+
40
+ Use ${MCP_TOOLS.UPLOAD_PROFILE_IMAGE} to upload the image file.
41
+
42
+ Display confirmation and the image URL.`,
43
+ },
44
+ },
45
+ ];
46
+ },
47
+ };
48
+
49
+ /**
50
+ * Upload Token Image - Token image file upload
51
+ */
52
+ export const uploadTokenImagePrompt: MCPPrompt = {
53
+ name: 'galachain-launchpad:upload-token-image',
54
+ description: 'Upload token image from filesystem (Node.js only)',
55
+ arguments: [
56
+ {
57
+ name: 'tokenName',
58
+ description: 'Token name (e.g., anime, mytoken)',
59
+ required: true,
60
+ },
61
+ {
62
+ name: 'imagePath',
63
+ description: 'Absolute file path to image file',
64
+ required: true,
65
+ },
66
+ ],
67
+ handler: (args) => {
68
+ validateTokenName(args.tokenName);
69
+
70
+ return [
71
+ {
72
+ role: 'user',
73
+ content: {
74
+ type: 'text',
75
+ text: `Upload token image.
76
+
77
+ Token: ${args.tokenName}
78
+ Image Path: ${args.imagePath}
79
+
80
+ Use ${MCP_TOOLS.UPLOAD_TOKEN_IMAGE} to upload the token image file.
81
+
82
+ This tool is Node.js only (not available in browser).
83
+
84
+ Display confirmation and the uploaded image URL.`,
85
+ },
86
+ },
87
+ ];
88
+ },
89
+ };
90
+
91
+ /**
92
+ * Fetch Launch Token Fee - Current launch fee query
93
+ */
94
+ export const fetchLaunchTokenFeePrompt: MCPPrompt = {
95
+ name: 'galachain-launchpad:fetch-launch-token-fee',
96
+ description: 'Get the current GALA fee required to launch a new token',
97
+ handler: () => {
98
+ return [
99
+ {
100
+ role: 'user',
101
+ content: {
102
+ type: 'text',
103
+ text: `Check the current token launch fee.
104
+
105
+ Use ${MCP_TOOLS.FETCH_LAUNCH_TOKEN_FEE} to retrieve the current GALA fee.
106
+
107
+ This is a dynamic value that may change. Display the current fee amount.`,
108
+ },
109
+ },
110
+ ];
111
+ },
112
+ };
113
+
114
+ export const creationUtilityPrompts: MCPPrompt[] = [
115
+ uploadProfileImagePrompt,
116
+ uploadTokenImagePrompt,
117
+ fetchLaunchTokenFeePrompt,
118
+ ];
@@ -0,0 +1,86 @@
1
+ /**
2
+ * DEX Trading Prompts
3
+ *
4
+ * Slash commands for GalaSwap DEX trading operations (for graduated tokens)
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { validateNumericAmount, validateSlippage } from '../utils/validation.js';
9
+
10
+ /**
11
+ * DEX Swap - Guided swap workflow for graduated tokens
12
+ *
13
+ * This prompt guides users through swapping tokens on GalaSwap DEX.
14
+ * It's designed for tokens that have graduated from bonding curves.
15
+ */
16
+ export const dexSwapPrompt: MCPPrompt = {
17
+ name: 'galachain-launchpad:dex-swap',
18
+ description:
19
+ 'Execute a token swap on GalaSwap DEX for graduated tokens. Get a quote first, then execute with slippage protection.',
20
+ arguments: [
21
+ {
22
+ name: 'fromToken',
23
+ description: 'Source token symbol (e.g., GALA, GUSDC)',
24
+ required: true,
25
+ },
26
+ {
27
+ name: 'toToken',
28
+ description: 'Destination token symbol (e.g., GUSDC, GALA)',
29
+ required: true,
30
+ },
31
+ {
32
+ name: 'amount',
33
+ description: 'Amount to swap (e.g., 100)',
34
+ required: true,
35
+ },
36
+ {
37
+ name: 'slippage',
38
+ description: 'Slippage tolerance percentage (default: 1)',
39
+ required: false,
40
+ },
41
+ ],
42
+ handler: (args) => {
43
+ // Validate inputs
44
+ validateNumericAmount(args.amount, 'amount');
45
+ if (args.slippage) {
46
+ validateSlippage(args.slippage);
47
+ }
48
+
49
+ const slippageValue = args.slippage || '1';
50
+
51
+ return [
52
+ {
53
+ role: 'user',
54
+ content: {
55
+ type: 'text',
56
+ text: `I want to swap tokens on GalaSwap DEX:
57
+
58
+ **Swap Details:**
59
+ - From Token: ${args.fromToken}
60
+ - To Token: ${args.toToken}
61
+ - Amount: ${args.amount} ${args.fromToken}
62
+ - Slippage Tolerance: ${slippageValue}%
63
+
64
+ **Workflow:**
65
+ 1. Get a swap quote for ${args.amount} ${args.fromToken} → ${args.toToken}
66
+ 2. Review the estimated output and price impact
67
+ 3. Execute the swap with ${slippageValue}% slippage protection
68
+
69
+ Please use the following MCP tools to complete this workflow:
70
+ - gala_launchpad_get_swap_quote_exact_input: Get initial quote before swapping
71
+ - gala_launchpad_get_swap_quote_exact_output: Get quote for specific desired output
72
+ - gala_launchpad_execute_swap: Execute the swap after review
73
+ - gala_launchpad_get_swap_user_assets: Check wallet balances
74
+ - gala_launchpad_get_swap_pool_info: Get pool details and fee tiers
75
+
76
+ Please proceed with getting the quote first, then guide me through the execution.`,
77
+ },
78
+ },
79
+ ];
80
+ },
81
+ };
82
+
83
+ /**
84
+ * Export all DEX trading prompts
85
+ */
86
+ export const dexTradingPrompts: MCPPrompt[] = [dexSwapPrompt];
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Token Discovery Prompts
3
+ *
4
+ * Slash commands for discovering and researching tokens on Gala Launchpad
5
+ */
6
+
7
+ import type { MCPPrompt } from '../types/mcp.js';
8
+ import { createDiscoverTokensWorkflow } from './utils/workflowTemplates.js';
9
+ import { validateNumericAmount } from '../utils/validation.js';
10
+
11
+ /**
12
+ * Discover Tokens - Token discovery and exploration workflow
13
+ */
14
+ export const discoverTokensPrompt: MCPPrompt = {
15
+ name: 'galachain-launchpad:discover-tokens',
16
+ description:
17
+ 'Discover new opportunities on Gala Launchpad - find recently launched tokens, popular tokens, or tokens near graduation',
18
+ arguments: [
19
+ {
20
+ name: 'type',
21
+ description:
22
+ 'Type of discovery - "recent" for newly launched tokens (default), "popular" for most traded tokens, or "near-graduation" for tokens close to completing their bonding curve',
23
+ required: false,
24
+ },
25
+ {
26
+ name: 'limit',
27
+ description: 'Number of tokens to show (default: 10, max: 50)',
28
+ required: false,
29
+ },
30
+ {
31
+ name: 'minProgress',
32
+ description:
33
+ 'Minimum graduation progress percentage - only for "near-graduation" type (e.g., "85" for 85%+ progress)',
34
+ required: false,
35
+ },
36
+ {
37
+ name: 'maxPrice',
38
+ description:
39
+ 'Maximum USD price for tokens (e.g., "1.50" to find tokens under $1.50) - useful for finding low-cost tokens to accumulate',
40
+ required: false,
41
+ },
42
+ ],
43
+ handler: (args) => {
44
+ // Parse and validate inputs
45
+ const type = (args.type || 'recent') as 'recent' | 'popular' | 'near-graduation';
46
+ const limit = Math.min(Math.max(1, parseInt(args.limit || '10', 10)), 50);
47
+
48
+ // Validate type
49
+ if (!['recent', 'popular', 'near-graduation'].includes(type)) {
50
+ throw new Error('Type must be "recent", "popular", or "near-graduation"');
51
+ }
52
+
53
+ // Validate minProgress if provided
54
+ if (args.minProgress) {
55
+ const progress = parseInt(args.minProgress, 10);
56
+ if (isNaN(progress) || progress < 0 || progress > 100) {
57
+ throw new Error('minProgress must be a number between 0 and 100');
58
+ }
59
+ }
60
+
61
+ // Validate maxPrice if provided
62
+ if (args.maxPrice) {
63
+ validateNumericAmount(args.maxPrice, 'maxPrice');
64
+ }
65
+
66
+ return [
67
+ {
68
+ role: 'user',
69
+ content: {
70
+ type: 'text',
71
+ text: createDiscoverTokensWorkflow({
72
+ type,
73
+ limit,
74
+ minProgress: args.minProgress,
75
+ maxPrice: args.maxPrice,
76
+ }),
77
+ },
78
+ },
79
+ ];
80
+ },
81
+ };
82
+
83
+ /**
84
+ * Export all discovery prompts
85
+ */
86
+ export const discoveryPrompts: MCPPrompt[] = [discoverTokensPrompt];
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Gala Launchpad MCP Prompts (Slash Commands)
3
+ *
4
+ * Provides user-friendly slash commands for common Launchpad workflows
5
+ */
6
+
7
+ import { tradingPrompts } from './trading.js';
8
+ import { portfolioPrompts } from './portfolio.js';
9
+ import { analysisPrompts } from './analysis.js';
10
+ import { utilityPrompts } from './utility.js';
11
+ import { creationPrompts } from './create-token.js';
12
+ import { discoveryPrompts } from './discover-tokens.js';
13
+ import { dexTradingPrompts } from './dex-trading.js';
14
+ import { liquidityPositionPrompts } from './liquidity-positions.js';
15
+ import { poolPrompts } from './pools.js';
16
+ import { tradingCalculationPrompts } from './trading-calculations.js';
17
+ import { balancePrompts } from './balances.js';
18
+ import { creationUtilityPrompts } from './creation-utils.js';
19
+ import { socialPrompts } from './social.js';
20
+ import { transferPrompts } from './transfers.js';
21
+ import { utilityToolPrompts } from './utility-tools.js';
22
+ import type { MCPPrompt } from '../types/mcp.js';
23
+
24
+ /**
25
+ * All available prompts (72 total)
26
+ */
27
+ export const prompts: MCPPrompt[] = [
28
+ ...tradingPrompts,
29
+ ...portfolioPrompts,
30
+ ...analysisPrompts,
31
+ ...creationPrompts,
32
+ ...discoveryPrompts,
33
+ ...dexTradingPrompts,
34
+ ...liquidityPositionPrompts,
35
+ ...utilityPrompts,
36
+ ...poolPrompts,
37
+ ...tradingCalculationPrompts,
38
+ ...balancePrompts,
39
+ ...creationUtilityPrompts,
40
+ ...socialPrompts,
41
+ ...transferPrompts,
42
+ ...utilityToolPrompts,
43
+ ];
44
+
45
+ /**
46
+ * Optimized prompt registry using Map for O(1) lookups
47
+ * Improves performance for large prompt collections
48
+ */
49
+ const promptMap = new Map<string, MCPPrompt>(
50
+ prompts.map((prompt) => [prompt.name, prompt])
51
+ );
52
+
53
+ /**
54
+ * Get prompt by name (optimized with Map lookup)
55
+ *
56
+ * @param name - Prompt name (e.g., 'galachain-launchpad:analyze-token')
57
+ * @returns Prompt object or undefined if not found
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const prompt = getPrompt('galachain-launchpad:buy-tokens');
62
+ * if (prompt) {
63
+ * const messages = prompt.handler({ tokenName: 'anime', galaAmount: '100' });
64
+ * }
65
+ * ```
66
+ */
67
+ export function getPrompt(name: string): MCPPrompt | undefined {
68
+ return promptMap.get(name);
69
+ }
70
+
71
+ /**
72
+ * Get all prompt names
73
+ *
74
+ * @returns Array of all registered prompt names
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const names = getPromptNames();
79
+ * // ['galachain-launchpad:analyze-token', 'galachain-launchpad:buy-tokens', ...]
80
+ * ```
81
+ */
82
+ export function getPromptNames(): string[] {
83
+ return Array.from(promptMap.keys());
84
+ }
85
+
86
+ /**
87
+ * Check if a prompt exists by name
88
+ *
89
+ * @param name - Prompt name to check
90
+ * @returns True if prompt exists, false otherwise
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * if (hasPrompt('galachain-launchpad:analyze-token')) {
95
+ * console.log('Prompt is available');
96
+ * }
97
+ * ```
98
+ */
99
+ export function hasPrompt(name: string): boolean {
100
+ return promptMap.has(name);
101
+ }
102
+
103
+ /**
104
+ * Get prompts by category
105
+ *
106
+ * @param category - Category name ('trading', 'portfolio', 'analysis', 'creation', 'discovery', 'dex', or 'utility')
107
+ * @returns Array of prompts in the specified category
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * const tradingCommands = getPromptsByCategory('trading');
112
+ * // Returns [analyzeTokenPrompt, buyTokensPrompt, sellTokensPrompt, graduateTokenPrompt]
113
+ * const dexCommands = getPromptsByCategory('dex');
114
+ * // Returns [dexSwapPrompt]
115
+ * ```
116
+ */
117
+ export function getPromptsByCategory(
118
+ category: 'trading' | 'portfolio' | 'analysis' | 'creation' | 'discovery' | 'dex' | 'liquidity' | 'utility'
119
+ ): MCPPrompt[] {
120
+ switch (category) {
121
+ case 'trading':
122
+ return tradingPrompts;
123
+ case 'portfolio':
124
+ return portfolioPrompts;
125
+ case 'analysis':
126
+ return analysisPrompts;
127
+ case 'creation':
128
+ return creationPrompts;
129
+ case 'discovery':
130
+ return discoveryPrompts;
131
+ case 'dex':
132
+ return dexTradingPrompts;
133
+ case 'liquidity':
134
+ return liquidityPositionPrompts;
135
+ case 'utility':
136
+ return utilityPrompts;
137
+ default:
138
+ return [];
139
+ }
140
+ }
141
+
142
+ /**
143
+ * Get prompt count
144
+ *
145
+ * @returns Total number of registered prompts
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * console.log(`Total prompts: ${getPromptCount()}`); // Total prompts: 15
150
+ * ```
151
+ */
152
+ export function getPromptCount(): number {
153
+ return promptMap.size;
154
+ }
155
+
156
+ /**
157
+ * Export individual prompt categories for documentation
158
+ */
159
+ export {
160
+ tradingPrompts,
161
+ portfolioPrompts,
162
+ analysisPrompts,
163
+ creationPrompts,
164
+ discoveryPrompts,
165
+ dexTradingPrompts,
166
+ liquidityPositionPrompts,
167
+ utilityPrompts,
168
+ poolPrompts,
169
+ tradingCalculationPrompts,
170
+ balancePrompts,
171
+ creationUtilityPrompts,
172
+ socialPrompts,
173
+ transferPrompts,
174
+ utilityToolPrompts,
175
+ };