@gala-chain/launchpad-mcp-server 1.13.2 → 1.13.3
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 +21 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/package.json +2 -2
- package/docs/AI-AGENT-PATTERNS.md +0 -555
- package/docs/CONSTRAINTS-REFERENCE.md +0 -454
- package/docs/PROMPT-TOOL-MAPPING.md +0 -352
- package/docs/examples/default-values-pattern.md +0 -240
- package/docs/examples/tool-factory-pattern.md +0 -217
- package/jest.config.js +0 -94
- package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
- package/src/constants/mcpToolNames.ts +0 -141
- package/src/index.ts +0 -19
- package/src/prompts/__tests__/promptStructure.test.ts +0 -114
- package/src/prompts/__tests__/registry.test.ts +0 -143
- package/src/prompts/analysis.ts +0 -429
- package/src/prompts/index.ts +0 -127
- package/src/prompts/portfolio.ts +0 -242
- package/src/prompts/trading.ts +0 -191
- package/src/prompts/utility.ts +0 -43
- package/src/prompts/utils/workflowTemplates.ts +0 -344
- package/src/schemas/common-schemas.ts +0 -392
- package/src/scripts/test-all-prompts.ts +0 -184
- package/src/server.ts +0 -247
- package/src/tools/balance/index.ts +0 -174
- package/src/tools/creation/index.ts +0 -182
- package/src/tools/index.ts +0 -80
- package/src/tools/pools/fetchAllPools.ts +0 -47
- package/src/tools/pools/fetchAllPriceHistory.ts +0 -103
- package/src/tools/pools/fetchAllPrices.ts +0 -39
- package/src/tools/pools/fetchPoolDetails.ts +0 -27
- package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
- package/src/tools/pools/fetchPools.ts +0 -47
- package/src/tools/pools/fetchPriceHistory.ts +0 -108
- package/src/tools/pools/fetchPrices.ts +0 -52
- package/src/tools/pools/index.ts +0 -248
- package/src/tools/social/index.ts +0 -64
- package/src/tools/trading/index.ts +0 -605
- package/src/tools/transfers/index.ts +0 -75
- package/src/tools/utils/clearCache.ts +0 -36
- package/src/tools/utils/createWallet.ts +0 -19
- package/src/tools/utils/explainSdkUsage.ts +0 -853
- package/src/tools/utils/getAddress.ts +0 -12
- package/src/tools/utils/getCacheInfo.ts +0 -14
- package/src/tools/utils/getConfig.ts +0 -11
- package/src/tools/utils/getEthereumAddress.ts +0 -12
- package/src/tools/utils/getUrlByTokenName.ts +0 -12
- package/src/tools/utils/getVersion.ts +0 -25
- package/src/tools/utils/index.ts +0 -27
- package/src/tools/utils/isTokenGraduated.ts +0 -16
- package/src/types/mcp.ts +0 -72
- package/src/utils/__tests__/validation.test.ts +0 -147
- package/src/utils/constraints.ts +0 -146
- package/src/utils/default-values.ts +0 -208
- package/src/utils/error-handler.ts +0 -69
- package/src/utils/error-templates.ts +0 -273
- package/src/utils/response-formatter.ts +0 -51
- package/src/utils/tool-factory.ts +0 -257
- package/src/utils/tool-registry.ts +0 -296
- package/src/utils/validation.ts +0 -336
- package/tsconfig.json +0 -23
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt Structure Tests
|
|
3
|
-
*
|
|
4
|
-
* Validates that all prompts conform to MCP protocol specification
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { prompts } from '../index';
|
|
8
|
-
|
|
9
|
-
describe('Prompt Structure', () => {
|
|
10
|
-
// Helper to generate valid args for each prompt type
|
|
11
|
-
function getValidArgsForPrompt(promptName: string): Record<string, string> {
|
|
12
|
-
if (promptName.includes('analyze-token') || promptName.includes('pool-details')) {
|
|
13
|
-
return { tokenName: 'anime' };
|
|
14
|
-
}
|
|
15
|
-
if (promptName.includes('buy-tokens')) {
|
|
16
|
-
return { tokenName: 'anime', galaAmount: '100' };
|
|
17
|
-
}
|
|
18
|
-
if (promptName.includes('sell-tokens')) {
|
|
19
|
-
return { tokenName: 'anime', tokenAmount: '1000' };
|
|
20
|
-
}
|
|
21
|
-
if (promptName.includes('graduate-token')) {
|
|
22
|
-
return { tokenName: 'anime' };
|
|
23
|
-
}
|
|
24
|
-
if (promptName.includes('compare-tokens')) {
|
|
25
|
-
return { token1: 'anime', token2: 'test' };
|
|
26
|
-
}
|
|
27
|
-
if (promptName.includes('graduation-status') || promptName.includes('spot-prices')) {
|
|
28
|
-
return { tokens: 'anime,test,dragon' };
|
|
29
|
-
}
|
|
30
|
-
return {}; // For prompts with no required args (portfolio, balance, etc.)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
describe('MCP Protocol Compliance', () => {
|
|
34
|
-
it.each(prompts)('$name should have required fields', (prompt) => {
|
|
35
|
-
expect(prompt).toHaveProperty('name');
|
|
36
|
-
expect(prompt).toHaveProperty('description');
|
|
37
|
-
expect(prompt).toHaveProperty('handler');
|
|
38
|
-
expect(typeof prompt.name).toBe('string');
|
|
39
|
-
expect(typeof prompt.description).toBe('string');
|
|
40
|
-
expect(typeof prompt.handler).toBe('function');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it.each(prompts)('$name should have valid argument structure', (prompt) => {
|
|
44
|
-
if (prompt.arguments) {
|
|
45
|
-
expect(Array.isArray(prompt.arguments)).toBe(true);
|
|
46
|
-
prompt.arguments.forEach((arg) => {
|
|
47
|
-
expect(arg).toHaveProperty('name');
|
|
48
|
-
expect(arg).toHaveProperty('description');
|
|
49
|
-
expect(arg).toHaveProperty('required');
|
|
50
|
-
expect(typeof arg.name).toBe('string');
|
|
51
|
-
expect(typeof arg.description).toBe('string');
|
|
52
|
-
expect(typeof arg.required).toBe('boolean');
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it.each(prompts)('$name handler should return PromptMessage array', (prompt) => {
|
|
58
|
-
const args = getValidArgsForPrompt(prompt.name);
|
|
59
|
-
const messages = prompt.handler(args);
|
|
60
|
-
expect(Array.isArray(messages)).toBe(true);
|
|
61
|
-
expect(messages.length).toBeGreaterThan(0);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it.each(prompts)('$name messages should have valid structure', (prompt) => {
|
|
65
|
-
const args = getValidArgsForPrompt(prompt.name);
|
|
66
|
-
const messages = prompt.handler(args);
|
|
67
|
-
messages.forEach((msg) => {
|
|
68
|
-
expect(msg).toHaveProperty('role');
|
|
69
|
-
expect(msg).toHaveProperty('content');
|
|
70
|
-
expect(['user', 'assistant']).toContain(msg.role);
|
|
71
|
-
expect(msg.content).toHaveProperty('type');
|
|
72
|
-
expect(['text', 'image', 'resource']).toContain(msg.content.type);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('Handler Execution', () => {
|
|
78
|
-
it('analyze-token handler should accept tokenName', () => {
|
|
79
|
-
const prompt = prompts.find((p) => p.name === 'galachain-launchpad:analyze-token');
|
|
80
|
-
expect(() => prompt?.handler({ tokenName: 'anime' })).not.toThrow();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('buy-tokens handler should accept required args', () => {
|
|
84
|
-
const prompt = prompts.find((p) => p.name === 'galachain-launchpad:buy-tokens');
|
|
85
|
-
expect(() => prompt?.handler({ tokenName: 'anime', galaAmount: '100' })).not.toThrow();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('graduate-token handler should accept optional slippage', () => {
|
|
89
|
-
const prompt = prompts.find((p) => p.name === 'galachain-launchpad:graduate-token');
|
|
90
|
-
expect(() => prompt?.handler({ tokenName: 'anime', slippage: '2' })).not.toThrow();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe('Message Content', () => {
|
|
95
|
-
it.each(prompts)('$name should generate non-empty text content', (prompt) => {
|
|
96
|
-
const args = getValidArgsForPrompt(prompt.name);
|
|
97
|
-
const messages = prompt.handler(args);
|
|
98
|
-
messages.forEach((msg) => {
|
|
99
|
-
if (msg.content.type === 'text') {
|
|
100
|
-
expect(msg.content.text).toBeDefined();
|
|
101
|
-
expect(msg.content.text!.length).toBeGreaterThan(10);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it.each(prompts)('$name should reference MCP tools in instructions', (prompt) => {
|
|
107
|
-
const args = getValidArgsForPrompt(prompt.name);
|
|
108
|
-
const messages = prompt.handler(args);
|
|
109
|
-
const text = messages[0].content.text || '';
|
|
110
|
-
// Should contain at least one tool reference
|
|
111
|
-
expect(text).toMatch(/gala_launchpad_/);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
});
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt Registry Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for prompt registration, lookup, and utility functions
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
prompts,
|
|
9
|
-
getPrompt,
|
|
10
|
-
getPromptNames,
|
|
11
|
-
hasPrompt,
|
|
12
|
-
getPromptsByCategory,
|
|
13
|
-
getPromptCount,
|
|
14
|
-
} from '../index';
|
|
15
|
-
|
|
16
|
-
describe('Prompt Registry', () => {
|
|
17
|
-
describe('prompts array', () => {
|
|
18
|
-
it('should contain exactly 14 prompts', () => {
|
|
19
|
-
expect(prompts).toHaveLength(14);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should have all unique prompt names', () => {
|
|
23
|
-
const names = prompts.map((p) => p.name);
|
|
24
|
-
const uniqueNames = new Set(names);
|
|
25
|
-
expect(uniqueNames.size).toBe(names.length);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should have all prompts with galachain-launchpad prefix', () => {
|
|
29
|
-
prompts.forEach((prompt) => {
|
|
30
|
-
expect(prompt.name).toMatch(/^galachain-launchpad:/);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe('getPrompt()', () => {
|
|
36
|
-
it('should return prompt for valid name', () => {
|
|
37
|
-
const prompt = getPrompt('galachain-launchpad:analyze-token');
|
|
38
|
-
expect(prompt).toBeDefined();
|
|
39
|
-
expect(prompt?.name).toBe('galachain-launchpad:analyze-token');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should return undefined for invalid name', () => {
|
|
43
|
-
const prompt = getPrompt('non-existent-prompt');
|
|
44
|
-
expect(prompt).toBeUndefined();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should find all 14 prompts by name', () => {
|
|
48
|
-
const names = [
|
|
49
|
-
'galachain-launchpad:analyze-token',
|
|
50
|
-
'galachain-launchpad:buy-tokens',
|
|
51
|
-
'galachain-launchpad:sell-tokens',
|
|
52
|
-
'galachain-launchpad:graduate-token',
|
|
53
|
-
'galachain-launchpad:portfolio',
|
|
54
|
-
'galachain-launchpad:tokens-held',
|
|
55
|
-
'galachain-launchpad:tokens-created',
|
|
56
|
-
'galachain-launchpad:balance',
|
|
57
|
-
'galachain-launchpad:profile',
|
|
58
|
-
'galachain-launchpad:compare-tokens',
|
|
59
|
-
'galachain-launchpad:graduation-status',
|
|
60
|
-
'galachain-launchpad:spot-prices',
|
|
61
|
-
'galachain-launchpad:pool-details',
|
|
62
|
-
'galachain-launchpad:trade-history',
|
|
63
|
-
];
|
|
64
|
-
|
|
65
|
-
names.forEach((name) => {
|
|
66
|
-
const prompt = getPrompt(name);
|
|
67
|
-
expect(prompt).toBeDefined();
|
|
68
|
-
expect(prompt?.name).toBe(name);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should use O(1) Map lookup (performance test)', () => {
|
|
73
|
-
const iterations = 10000;
|
|
74
|
-
const start = Date.now();
|
|
75
|
-
|
|
76
|
-
for (let i = 0; i < iterations; i++) {
|
|
77
|
-
getPrompt('galachain-launchpad:analyze-token');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const duration = Date.now() - start;
|
|
81
|
-
// Should complete 10k lookups in under 100ms (Map is O(1))
|
|
82
|
-
expect(duration).toBeLessThan(100);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe('getPromptNames()', () => {
|
|
87
|
-
it('should return array of all prompt names', () => {
|
|
88
|
-
const names = getPromptNames();
|
|
89
|
-
expect(names).toHaveLength(14);
|
|
90
|
-
expect(names).toContain('galachain-launchpad:analyze-token');
|
|
91
|
-
expect(names).toContain('galachain-launchpad:buy-tokens');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should return names in consistent order', () => {
|
|
95
|
-
const names1 = getPromptNames();
|
|
96
|
-
const names2 = getPromptNames();
|
|
97
|
-
expect(names1).toEqual(names2);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe('hasPrompt()', () => {
|
|
102
|
-
it('should return true for existing prompts', () => {
|
|
103
|
-
expect(hasPrompt('galachain-launchpad:analyze-token')).toBe(true);
|
|
104
|
-
expect(hasPrompt('galachain-launchpad:buy-tokens')).toBe(true);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should return false for non-existent prompts', () => {
|
|
108
|
-
expect(hasPrompt('invalid-prompt')).toBe(false);
|
|
109
|
-
expect(hasPrompt('')).toBe(false);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
describe('getPromptsByCategory()', () => {
|
|
114
|
-
it('should return 4 trading prompts', () => {
|
|
115
|
-
const trading = getPromptsByCategory('trading');
|
|
116
|
-
expect(trading).toHaveLength(4);
|
|
117
|
-
expect(trading[0].name).toContain('analyze-token');
|
|
118
|
-
expect(trading[1].name).toContain('buy-tokens');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should return 5 portfolio prompts', () => {
|
|
122
|
-
const portfolio = getPromptsByCategory('portfolio');
|
|
123
|
-
expect(portfolio).toHaveLength(5);
|
|
124
|
-
expect(portfolio[0].name).toContain('portfolio');
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('should return 5 analysis prompts', () => {
|
|
128
|
-
const analysis = getPromptsByCategory('analysis');
|
|
129
|
-
expect(analysis).toHaveLength(5);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('should return empty array for invalid category', () => {
|
|
133
|
-
const result = getPromptsByCategory('invalid' as any);
|
|
134
|
-
expect(result).toEqual([]);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
describe('getPromptCount()', () => {
|
|
139
|
-
it('should return 14', () => {
|
|
140
|
-
expect(getPromptCount()).toBe(14);
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
});
|
package/src/prompts/analysis.ts
DELETED
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Analysis Prompts
|
|
3
|
-
*
|
|
4
|
-
* Slash commands for token analysis and comparison on Gala Launchpad
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { MCPPrompt } from '../types/mcp.js';
|
|
8
|
-
import { MCP_TOOLS } from '../constants/mcpToolNames.js';
|
|
9
|
-
import { validateTokenName, validateTokenList, validatePaginationLimit } from '../utils/validation.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Compare Tokens - Side-by-side comparison
|
|
13
|
-
*/
|
|
14
|
-
export const compareTokensPrompt: MCPPrompt = {
|
|
15
|
-
name: 'galachain-launchpad:compare-tokens',
|
|
16
|
-
description: 'Compare two Launchpad tokens side-by-side with detailed metrics',
|
|
17
|
-
arguments: [
|
|
18
|
-
{
|
|
19
|
-
name: 'token1',
|
|
20
|
-
description: 'First token to compare (e.g., anime)',
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'token2',
|
|
25
|
-
description: 'Second token to compare (e.g., test216253)',
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
handler: (args) => {
|
|
30
|
-
// Validate inputs
|
|
31
|
-
validateTokenName(args.token1, 'token1');
|
|
32
|
-
validateTokenName(args.token2, 'token2');
|
|
33
|
-
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
role: 'user',
|
|
37
|
-
content: {
|
|
38
|
-
type: 'text',
|
|
39
|
-
text: `Compare two Launchpad tokens side-by-side:
|
|
40
|
-
|
|
41
|
-
Token 1: ${args.token1}
|
|
42
|
-
Token 2: ${args.token2}
|
|
43
|
-
|
|
44
|
-
For EACH token, use the optimized pattern:
|
|
45
|
-
|
|
46
|
-
1. Fetch pool details using ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
47
|
-
|
|
48
|
-
2. Calculate metrics using LOCAL mode:
|
|
49
|
-
- Spot price: ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE}
|
|
50
|
-
- Graduation cost: ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION}
|
|
51
|
-
- Is graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
52
|
-
|
|
53
|
-
3. Get additional data:
|
|
54
|
-
- Full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
55
|
-
- Token distribution: ${MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION}
|
|
56
|
-
- Badges: ${MCP_TOOLS.FETCH_TOKEN_BADGES}
|
|
57
|
-
|
|
58
|
-
Present a comparison table:
|
|
59
|
-
|
|
60
|
-
| Metric | ${args.token1} | ${args.token2} |
|
|
61
|
-
|--------|--------|--------|
|
|
62
|
-
| Spot Price (USD) | ... | ... |
|
|
63
|
-
| Market Cap Estimate | ... | ... |
|
|
64
|
-
| Pool Status | ... | ... |
|
|
65
|
-
| Progress to Graduation | ... | ... |
|
|
66
|
-
| Remaining Tokens | ... | ... |
|
|
67
|
-
| GALA to Graduate | ... | ... |
|
|
68
|
-
| Holder Count | ... | ... |
|
|
69
|
-
| Creator Status | ... | ... |
|
|
70
|
-
|
|
71
|
-
Provide analysis:
|
|
72
|
-
- Which token is closer to graduation?
|
|
73
|
-
- Which has better liquidity?
|
|
74
|
-
- Which might be a better investment and why?
|
|
75
|
-
- Any notable badges or achievements?`,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Graduation Status - Check multiple tokens for graduation readiness
|
|
84
|
-
*/
|
|
85
|
-
export const graduationStatusPrompt: MCPPrompt = {
|
|
86
|
-
name: 'galachain-launchpad:graduation-status',
|
|
87
|
-
description: 'Check graduation status and readiness for multiple tokens',
|
|
88
|
-
arguments: [
|
|
89
|
-
{
|
|
90
|
-
name: 'tokens',
|
|
91
|
-
description: 'Comma-separated token names (e.g., anime,test216253,dragnrkti)',
|
|
92
|
-
required: true,
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
handler: (args) => {
|
|
96
|
-
// Validate inputs
|
|
97
|
-
const tokenArray = validateTokenList(args.tokens);
|
|
98
|
-
|
|
99
|
-
return [
|
|
100
|
-
{
|
|
101
|
-
role: 'user',
|
|
102
|
-
content: {
|
|
103
|
-
type: 'text',
|
|
104
|
-
text: `Check graduation status for multiple tokens:
|
|
105
|
-
|
|
106
|
-
Tokens: ${args.tokens}
|
|
107
|
-
|
|
108
|
-
For EACH token in the list:
|
|
109
|
-
|
|
110
|
-
1. Check if graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
111
|
-
|
|
112
|
-
2. If not graduated, use optimized pattern:
|
|
113
|
-
a. Fetch pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
114
|
-
b. Calculate graduation cost: ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION} (LOCAL mode)
|
|
115
|
-
c. Calculate progress: (currentSupply / maxSupply * 100)
|
|
116
|
-
|
|
117
|
-
3. Get full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
118
|
-
|
|
119
|
-
Present a table:
|
|
120
|
-
|
|
121
|
-
| Token | Status | Progress | Remaining Tokens | GALA to Graduate | Frontend URL |
|
|
122
|
-
|-------|--------|----------|------------------|------------------|--------------|
|
|
123
|
-
| ... | ... | ... | ... | ... | ... |
|
|
124
|
-
|
|
125
|
-
Summary:
|
|
126
|
-
- Total tokens analyzed: ${tokenArray.length}
|
|
127
|
-
- Already graduated: [count]
|
|
128
|
-
- Close to graduation (>90%): [count]
|
|
129
|
-
- Mid-progress (50-90%): [count]
|
|
130
|
-
- Early stage (<50%): [count]
|
|
131
|
-
|
|
132
|
-
Provide recommendations:
|
|
133
|
-
- Which tokens are good graduation opportunities?
|
|
134
|
-
- Which tokens might be undervalued?`,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
];
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Spot Prices - Batch spot price lookup
|
|
143
|
-
*/
|
|
144
|
-
export const spotPricesPrompt: MCPPrompt = {
|
|
145
|
-
name: 'galachain-launchpad:spot-prices',
|
|
146
|
-
description: 'Get spot prices for multiple Launchpad tokens efficiently',
|
|
147
|
-
arguments: [
|
|
148
|
-
{
|
|
149
|
-
name: 'tokens',
|
|
150
|
-
description: 'Comma-separated token names (e.g., anime,test216253,dragnrkti)',
|
|
151
|
-
required: true,
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
handler: (args) => {
|
|
155
|
-
// Validate inputs
|
|
156
|
-
validateTokenList(args.tokens);
|
|
157
|
-
|
|
158
|
-
return [
|
|
159
|
-
{
|
|
160
|
-
role: 'user',
|
|
161
|
-
content: {
|
|
162
|
-
type: 'text',
|
|
163
|
-
text: `Get spot prices for multiple Launchpad tokens:
|
|
164
|
-
|
|
165
|
-
Tokens: ${args.tokens}
|
|
166
|
-
|
|
167
|
-
Use the optimized batch pattern for EACH token:
|
|
168
|
-
|
|
169
|
-
1. Fetch pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
170
|
-
2. Calculate spot price: ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE} (LOCAL mode)
|
|
171
|
-
|
|
172
|
-
Also get GALA spot price: ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE}
|
|
173
|
-
|
|
174
|
-
Present results:
|
|
175
|
-
|
|
176
|
-
**GALA Spot Price:** $[price]
|
|
177
|
-
|
|
178
|
-
**Launchpad Token Prices:**
|
|
179
|
-
| Token | USD Price | GALA Price | Market Cap Est. |
|
|
180
|
-
|-------|-----------|------------|-----------------|
|
|
181
|
-
| ... | ... | ... | ... |
|
|
182
|
-
|
|
183
|
-
Performance note: Using LOCAL calculations - instant results with <0.01% difference from external!
|
|
184
|
-
|
|
185
|
-
Sort by USD price (highest to lowest).`,
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
];
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Pool Details - Comprehensive pool information
|
|
194
|
-
*/
|
|
195
|
-
export const poolDetailsPrompt: MCPPrompt = {
|
|
196
|
-
name: 'galachain-launchpad:pool-details',
|
|
197
|
-
description: 'Get comprehensive pool information including distribution and badges',
|
|
198
|
-
arguments: [
|
|
199
|
-
{
|
|
200
|
-
name: 'tokenName',
|
|
201
|
-
description: 'Token to analyze (e.g., anime)',
|
|
202
|
-
required: true,
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
handler: (args) => {
|
|
206
|
-
// Validate inputs
|
|
207
|
-
validateTokenName(args.tokenName);
|
|
208
|
-
|
|
209
|
-
return [
|
|
210
|
-
{
|
|
211
|
-
role: 'user',
|
|
212
|
-
content: {
|
|
213
|
-
type: 'text',
|
|
214
|
-
text: `Get comprehensive pool information for "${args.tokenName}":
|
|
215
|
-
|
|
216
|
-
1. Full pool details: ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
217
|
-
2. Token distribution: ${MCP_TOOLS.FETCH_TOKEN_DISTRIBUTION}
|
|
218
|
-
3. Achievement badges: ${MCP_TOOLS.FETCH_TOKEN_BADGES}
|
|
219
|
-
4. Recent volume data (last 24h): ${MCP_TOOLS.FETCH_VOLUME_DATA} with 1h resolution
|
|
220
|
-
5. Check if graduated: ${MCP_TOOLS.IS_TOKEN_GRADUATED}
|
|
221
|
-
6. Frontend URL: ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME}
|
|
222
|
-
|
|
223
|
-
Display organized sections:
|
|
224
|
-
|
|
225
|
-
**Basic Info:**
|
|
226
|
-
- Token name and symbol
|
|
227
|
-
- Pool status
|
|
228
|
-
- Created by
|
|
229
|
-
- Frontend URL
|
|
230
|
-
|
|
231
|
-
**Supply Metrics:**
|
|
232
|
-
- Current supply
|
|
233
|
-
- Maximum supply
|
|
234
|
-
- Remaining tokens
|
|
235
|
-
- Progress percentage
|
|
236
|
-
|
|
237
|
-
**Distribution:**
|
|
238
|
-
- Total holders
|
|
239
|
-
- Top holders (if available)
|
|
240
|
-
- Distribution metrics
|
|
241
|
-
|
|
242
|
-
**Achievements:**
|
|
243
|
-
- Volume badges
|
|
244
|
-
- Engagement badges
|
|
245
|
-
- Other achievements
|
|
246
|
-
|
|
247
|
-
**Recent Activity (24h):**
|
|
248
|
-
- Trading volume
|
|
249
|
-
- Price movement
|
|
250
|
-
- Number of trades
|
|
251
|
-
|
|
252
|
-
**Reverse Bonding Curve:**
|
|
253
|
-
- Max fee factor
|
|
254
|
-
- Min fee factor
|
|
255
|
-
- Current fee structure`,
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
];
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Trade History - Recent trades with filters
|
|
264
|
-
*/
|
|
265
|
-
export const tradeHistoryPrompt: MCPPrompt = {
|
|
266
|
-
name: 'galachain-launchpad:trade-history',
|
|
267
|
-
description: 'View recent trades for a token or user with filtering options',
|
|
268
|
-
arguments: [
|
|
269
|
-
{
|
|
270
|
-
name: 'tokenName',
|
|
271
|
-
description: 'Token to view trades for (optional)',
|
|
272
|
-
required: false,
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: 'userAddress',
|
|
276
|
-
description: 'User address to filter by (optional)',
|
|
277
|
-
required: false,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
name: 'tradeType',
|
|
281
|
-
description: 'Trade type filter: BUY or SELL (optional)',
|
|
282
|
-
required: false,
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
name: 'limit',
|
|
286
|
-
description: 'Number of trades to show (default: 20)',
|
|
287
|
-
required: false,
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
handler: (args) => {
|
|
291
|
-
// Validate inputs
|
|
292
|
-
if (args.tokenName) {
|
|
293
|
-
validateTokenName(args.tokenName);
|
|
294
|
-
}
|
|
295
|
-
if (args.limit) {
|
|
296
|
-
validatePaginationLimit(args.limit, 20);
|
|
297
|
-
}
|
|
298
|
-
if (args.tradeType && args.tradeType !== 'BUY' && args.tradeType !== 'SELL') {
|
|
299
|
-
throw new Error('tradeType must be either BUY or SELL');
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
const limit = args.limit || '20';
|
|
303
|
-
|
|
304
|
-
return [
|
|
305
|
-
{
|
|
306
|
-
role: 'user',
|
|
307
|
-
content: {
|
|
308
|
-
type: 'text',
|
|
309
|
-
text: `Show recent trade history:
|
|
310
|
-
|
|
311
|
-
${args.tokenName ? `Token: ${args.tokenName}` : 'All tokens'}
|
|
312
|
-
${args.userAddress ? `User: ${args.userAddress}` : 'All users'}
|
|
313
|
-
${args.tradeType ? `Type: ${args.tradeType}` : 'All trade types'}
|
|
314
|
-
Limit: ${limit}
|
|
315
|
-
|
|
316
|
-
Use ${MCP_TOOLS.FETCH_TRADES} with:
|
|
317
|
-
${args.tokenName ? `- tokenName: "${args.tokenName}"` : ''}
|
|
318
|
-
${args.userAddress ? `- userAddress: "${args.userAddress}"` : ''}
|
|
319
|
-
${args.tradeType ? `- tradeType: "${args.tradeType}"` : ''}
|
|
320
|
-
- limit: ${limit}
|
|
321
|
-
- sortOrder: "DESC" (newest first)
|
|
322
|
-
|
|
323
|
-
For each trade, display:
|
|
324
|
-
- Timestamp (formatted)
|
|
325
|
-
- Token name
|
|
326
|
-
- Trade type (BUY/SELL)
|
|
327
|
-
- Amount (tokens)
|
|
328
|
-
- Price (GALA)
|
|
329
|
-
- User address (truncated)
|
|
330
|
-
- Transaction ID
|
|
331
|
-
|
|
332
|
-
Calculate summary:
|
|
333
|
-
- Total trades shown
|
|
334
|
-
- Total volume (GALA)
|
|
335
|
-
- Average trade size
|
|
336
|
-
- Buy vs Sell ratio (if not filtered)`,
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
];
|
|
340
|
-
},
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Fetch All Pools - Get all available pools with automatic pagination
|
|
345
|
-
*/
|
|
346
|
-
export const fetchAllPoolsPrompt: MCPPrompt = {
|
|
347
|
-
name: 'galachain-launchpad:fetch-all-pools',
|
|
348
|
-
description: 'Fetch all available Launchpad pools with automatic pagination (no limit needed)',
|
|
349
|
-
arguments: [
|
|
350
|
-
{
|
|
351
|
-
name: 'search',
|
|
352
|
-
description: 'Optional search filter for token names (fuzzy match)',
|
|
353
|
-
required: false,
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
name: 'type',
|
|
357
|
-
description: 'Pool type filter: recent or popular (optional, default: recent)',
|
|
358
|
-
required: false,
|
|
359
|
-
},
|
|
360
|
-
],
|
|
361
|
-
handler: (args) => {
|
|
362
|
-
// Validate type if provided
|
|
363
|
-
if (args.type && args.type !== 'recent' && args.type !== 'popular') {
|
|
364
|
-
throw new Error('type must be either "recent" or "popular"');
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
const searchFilter = args.search
|
|
368
|
-
? `- search: "${args.search}" (fuzzy match filter)`
|
|
369
|
-
: '- No search filter';
|
|
370
|
-
const typeFilter = args.type ? args.type : 'recent';
|
|
371
|
-
|
|
372
|
-
return [
|
|
373
|
-
{
|
|
374
|
-
role: 'user',
|
|
375
|
-
content: {
|
|
376
|
-
type: 'text',
|
|
377
|
-
text: `Fetch ALL available Launchpad pools with automatic pagination:
|
|
378
|
-
|
|
379
|
-
Use ${MCP_TOOLS.FETCH_ALL_POOLS} with:
|
|
380
|
-
${searchFilter}
|
|
381
|
-
- type: "${typeFilter}"
|
|
382
|
-
|
|
383
|
-
This tool automatically:
|
|
384
|
-
- Fetches the first page to determine total available pools
|
|
385
|
-
- Concurrently fetches remaining pages (up to 5 at a time)
|
|
386
|
-
- Returns ALL matching pools in a single result
|
|
387
|
-
|
|
388
|
-
For each pool, display:
|
|
389
|
-
- Token name and symbol
|
|
390
|
-
- Pool status (Ongoing/Completed)
|
|
391
|
-
- Current price (if available)
|
|
392
|
-
- Progress percentage
|
|
393
|
-
- Creator address (truncated)
|
|
394
|
-
- Frontend URL (use ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME})
|
|
395
|
-
|
|
396
|
-
Provide summary:
|
|
397
|
-
- Total pools found
|
|
398
|
-
- How many are graduated (Completed)
|
|
399
|
-
- How many are active (Ongoing)
|
|
400
|
-
- Distribution by progress stage:
|
|
401
|
-
* Early (<25%)
|
|
402
|
-
* Growing (25-75%)
|
|
403
|
-
* Near graduation (75-99%)
|
|
404
|
-
* Graduated (100%)
|
|
405
|
-
|
|
406
|
-
Performance note:
|
|
407
|
-
- Uses concurrent fetching with ${MCP_TOOLS.FETCH_ALL_POOLS}
|
|
408
|
-
- Max 5 concurrent requests to avoid rate limiting
|
|
409
|
-
- Automatic cache warming for token metadata
|
|
410
|
-
- Much faster than manual pagination!
|
|
411
|
-
|
|
412
|
-
Sort pools by creation date (newest first) or progress (closest to graduation first).`,
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
];
|
|
416
|
-
},
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Export all analysis prompts
|
|
421
|
-
*/
|
|
422
|
-
export const analysisPrompts: MCPPrompt[] = [
|
|
423
|
-
compareTokensPrompt,
|
|
424
|
-
graduationStatusPrompt,
|
|
425
|
-
spotPricesPrompt,
|
|
426
|
-
poolDetailsPrompt,
|
|
427
|
-
tradeHistoryPrompt,
|
|
428
|
-
fetchAllPoolsPrompt,
|
|
429
|
-
];
|