@gala-chain/launchpad-mcp-server 1.22.0 → 1.22.1

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 (73) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/package.json +2 -2
  5. package/docs/AI-AGENT-PATTERNS.md +0 -555
  6. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  7. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  8. package/docs/examples/default-values-pattern.md +0 -240
  9. package/docs/examples/tool-factory-pattern.md +0 -217
  10. package/jest.config.js +0 -94
  11. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  12. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  13. package/src/constants/mcpToolNames.ts +0 -141
  14. package/src/index.ts +0 -19
  15. package/src/prompts/__tests__/promptStructure.test.ts +0 -137
  16. package/src/prompts/__tests__/registry.test.ts +0 -191
  17. package/src/prompts/analysis.ts +0 -429
  18. package/src/prompts/create-token.ts +0 -123
  19. package/src/prompts/dex-trading.ts +0 -86
  20. package/src/prompts/discover-tokens.ts +0 -86
  21. package/src/prompts/index.ts +0 -154
  22. package/src/prompts/liquidity-positions.ts +0 -270
  23. package/src/prompts/portfolio.ts +0 -242
  24. package/src/prompts/trading.ts +0 -191
  25. package/src/prompts/utility.ts +0 -43
  26. package/src/prompts/utils/workflowTemplates.ts +0 -511
  27. package/src/schemas/common-schemas.ts +0 -393
  28. package/src/scripts/test-all-prompts.ts +0 -184
  29. package/src/server.ts +0 -277
  30. package/src/tools/__tests__/dex-tools.test.ts +0 -562
  31. package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
  32. package/src/tools/balance/index.ts +0 -174
  33. package/src/tools/creation/index.ts +0 -182
  34. package/src/tools/dex/index.ts +0 -226
  35. package/src/tools/dex/liquidity-positions.ts +0 -547
  36. package/src/tools/index.ts +0 -86
  37. package/src/tools/pools/fetchAllPools.ts +0 -47
  38. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  39. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  40. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  41. package/src/tools/pools/fetchPools.ts +0 -47
  42. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  43. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  44. package/src/tools/pools/index.ts +0 -284
  45. package/src/tools/social/index.ts +0 -64
  46. package/src/tools/trading/index.ts +0 -605
  47. package/src/tools/transfers/index.ts +0 -75
  48. package/src/tools/utils/clearCache.ts +0 -36
  49. package/src/tools/utils/createWallet.ts +0 -19
  50. package/src/tools/utils/explainSdkUsage.ts +0 -1446
  51. package/src/tools/utils/getAddress.ts +0 -12
  52. package/src/tools/utils/getCacheInfo.ts +0 -14
  53. package/src/tools/utils/getConfig.ts +0 -11
  54. package/src/tools/utils/getEthereumAddress.ts +0 -12
  55. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  56. package/src/tools/utils/getVersion.ts +0 -25
  57. package/src/tools/utils/getWallet.ts +0 -25
  58. package/src/tools/utils/hasWallet.ts +0 -15
  59. package/src/tools/utils/index.ts +0 -33
  60. package/src/tools/utils/isTokenGraduated.ts +0 -16
  61. package/src/tools/utils/setWallet.ts +0 -41
  62. package/src/types/mcp.ts +0 -72
  63. package/src/utils/__tests__/validation.test.ts +0 -147
  64. package/src/utils/constraints.ts +0 -155
  65. package/src/utils/default-values.ts +0 -208
  66. package/src/utils/error-handler.ts +0 -69
  67. package/src/utils/error-templates.ts +0 -273
  68. package/src/utils/response-formatter.ts +0 -51
  69. package/src/utils/tool-factory.ts +0 -257
  70. package/src/utils/tool-registry.ts +0 -296
  71. package/src/utils/validation.ts +0 -371
  72. package/tests/wallet-management-integration.test.ts +0 -284
  73. package/tsconfig.json +0 -23
@@ -1,454 +0,0 @@
1
- # Constraints Reference - SDK to MCP Server Mapping
2
-
3
- This document provides a comprehensive reference for all constraint mappings between the Gala Launchpad SDK and the MCP Server tool schemas. It serves as the single source of truth for validation limits and helps maintain consistency across the codebase.
4
-
5
- ## Overview
6
-
7
- The MCP Server tool schemas must match the SDK's internal constraint definitions to prevent validation errors. This document tracks all constraint sources and their proper usage in MCP tool schemas.
8
-
9
- ---
10
-
11
- ## Constraint Sources in SDK
12
-
13
- ### 1. Trade Constraints
14
-
15
- **Source File:** `packages/sdk/src/types/trade.dto.ts`
16
-
17
- **Lines:** 325-355
18
-
19
- ```typescript
20
- export const TRADE_CONSTRAINTS = {
21
- PAGINATION: {
22
- MAX_LIMIT: 20,
23
- DEFAULT_LIMIT: 20,
24
- MIN_LIMIT: 1,
25
- MAX_PAGE: 1000,
26
- MIN_PAGE: 1,
27
- },
28
- // ... other trade constraints
29
- } as const;
30
- ```
31
-
32
- **Affected MCP Tools:**
33
- - `gala_launchpad_fetch_trades` (packages/mcp-server/src/tools/trading/index.ts:271)
34
-
35
- **Usage in MCP Schema:**
36
- ```typescript
37
- limit: {
38
- type: 'number',
39
- minimum: 1,
40
- maximum: 20, // TRADE_CONSTRAINTS.PAGINATION.MAX_LIMIT
41
- description: 'Results per page (default: 20, maximum: 20)',
42
- }
43
- ```
44
-
45
- ---
46
-
47
- ### 2. User Constraints
48
-
49
- **Source File:** `packages/sdk/src/types/user.dto.ts`
50
-
51
- **Lines:** 291-307
52
-
53
- ```typescript
54
- export const USER_CONSTRAINTS = {
55
- PAGINATION: {
56
- MAX_LIMIT: 20,
57
- DEFAULT_LIMIT: 20,
58
- MIN_LIMIT: 1,
59
- MAX_PAGE: 1000,
60
- MIN_PAGE: 1,
61
- },
62
- // ... other user constraints
63
- } as const;
64
- ```
65
-
66
- **Affected MCP Tools:**
67
- - `gala_launchpad_fetch_tokens_held` (packages/mcp-server/src/tools/balance/index.ts)
68
- - `gala_launchpad_fetch_tokens_created` (packages/mcp-server/src/tools/balance/index.ts)
69
-
70
- **Usage in MCP Schema:**
71
- ```typescript
72
- limit: {
73
- type: 'number',
74
- minimum: 1,
75
- maximum: 20, // USER_CONSTRAINTS.PAGINATION.MAX_LIMIT
76
- description: 'Results per page (default: 20, maximum: 20)',
77
- }
78
- ```
79
-
80
- ---
81
-
82
- ### 3. General Pagination Constraints
83
-
84
- **Source File:** `packages/sdk/src/types/launchpad.dto.ts`
85
-
86
- **Lines:** 583-592
87
-
88
- ```typescript
89
- export const PAGINATION_CONSTRAINTS = {
90
- MAX_LIMIT: 100,
91
- DEFAULT_LIMIT: 20,
92
- MIN_LIMIT: 1,
93
- MAX_PAGE: 1000,
94
- MIN_PAGE: 1,
95
- } as const;
96
- ```
97
-
98
- **Affected MCP Tools:**
99
- - `gala_launchpad_fetch_pools` (packages/mcp-server/src/tools/pools/index.ts:34)
100
-
101
- **Usage in MCP Schema:**
102
- ```typescript
103
- limit: {
104
- type: 'number',
105
- minimum: 1,
106
- maximum: 100, // PAGINATION_CONSTRAINTS.MAX_LIMIT
107
- description: 'Results per page (default: 20, maximum: 100)',
108
- }
109
- ```
110
-
111
- ---
112
-
113
- ### 4. Comment Constraints
114
-
115
- **Source File:** `packages/sdk/src/types/comment.dto.ts`
116
-
117
- **Lines:** 149
118
-
119
- ```typescript
120
- export const COMMENT_CONSTRAINTS = {
121
- PAGINATION: {
122
- MAX_LIMIT: 50,
123
- DEFAULT_LIMIT: 20,
124
- MIN_LIMIT: 1,
125
- MAX_PAGE: 1000,
126
- MIN_PAGE: 1,
127
- },
128
- // ... other comment constraints
129
- } as const;
130
- ```
131
-
132
- **Affected MCP Tools:**
133
- - `gala_launchpad_fetch_comments` (packages/mcp-server/src/tools/social/index.ts:58)
134
-
135
- **Usage in MCP Schema:**
136
- ```typescript
137
- limit: {
138
- type: 'number',
139
- minimum: 1,
140
- maximum: 50, // COMMENT_CONSTRAINTS.PAGINATION.MAX_LIMIT
141
- description: 'Results per page (default: 20, maximum: 50)',
142
- }
143
- ```
144
-
145
- ---
146
-
147
- ## MCP Constraints Utility
148
-
149
- **File:** `packages/mcp-server/src/utils/constraints.ts`
150
-
151
- This utility file centralizes all constraint constants for use in MCP tool schemas:
152
-
153
- ```typescript
154
- export const MCP_CONSTRAINTS = {
155
- /**
156
- * Trade operations limit (fetchTrades)
157
- * Source: TRADE_CONSTRAINTS.PAGINATION.MAX_LIMIT
158
- * SDK File: packages/sdk/src/types/trade.dto.ts:331
159
- */
160
- TRADE_LIMIT: 20,
161
-
162
- /**
163
- * User operations limit (fetchTokensHeld, fetchTokensCreated)
164
- * Source: USER_CONSTRAINTS.PAGINATION.MAX_LIMIT
165
- * SDK File: packages/sdk/src/types/user.dto.ts:297
166
- */
167
- USER_LIMIT: 20,
168
-
169
- /**
170
- * General pool operations limit (fetchPools)
171
- * Source: PAGINATION_CONSTRAINTS.MAX_LIMIT
172
- * SDK File: packages/sdk/src/types/launchpad.dto.ts:587
173
- */
174
- POOL_LIMIT: 100,
175
-
176
- /**
177
- * Comment operations limit (fetchComments)
178
- * Source: COMMENT_CONSTRAINTS.PAGINATION.MAX_LIMIT
179
- * SDK File: packages/sdk/src/types/comment.dto.ts:149
180
- */
181
- COMMENT_LIMIT: 50,
182
-
183
- /**
184
- * Minimum limit for all pagination operations
185
- */
186
- MIN_LIMIT: 1,
187
-
188
- /**
189
- * Minimum page number for all pagination operations
190
- */
191
- MIN_PAGE: 1,
192
-
193
- /**
194
- * Maximum page number for all pagination operations
195
- */
196
- MAX_PAGE: 1000,
197
- } as const;
198
- ```
199
-
200
- ---
201
-
202
- ## Complete Mapping Table
203
-
204
- | SDK Constraint | Value | MCP Constant | MCP Tools |
205
- |---------------|-------|--------------|-----------|
206
- | `TRADE_CONSTRAINTS.PAGINATION.MAX_LIMIT` | 20 | `MCP_CONSTRAINTS.TRADE_LIMIT` | `gala_launchpad_fetch_trades` |
207
- | `USER_CONSTRAINTS.PAGINATION.MAX_LIMIT` | 20 | `MCP_CONSTRAINTS.USER_LIMIT` | `gala_launchpad_fetch_tokens_held`<br>`gala_launchpad_fetch_tokens_created` |
208
- | `PAGINATION_CONSTRAINTS.MAX_LIMIT` | 100 | `MCP_CONSTRAINTS.POOL_LIMIT` | `gala_launchpad_fetch_pools` |
209
- | `COMMENT_CONSTRAINTS.PAGINATION.MAX_LIMIT` | 50 | `MCP_CONSTRAINTS.COMMENT_LIMIT` | `gala_launchpad_fetch_comments` |
210
- | All constraints `.MIN_LIMIT` | 1 | `MCP_CONSTRAINTS.MIN_LIMIT` | All pagination tools |
211
- | All constraints `.MIN_PAGE` | 1 | `MCP_CONSTRAINTS.MIN_PAGE` | All pagination tools |
212
- | All constraints `.MAX_PAGE` | 1000 | `MCP_CONSTRAINTS.MAX_PAGE` | All pagination tools |
213
-
214
- ---
215
-
216
- ## Validation Pattern Examples
217
-
218
- ### Trading Tools Example
219
-
220
- ```typescript
221
- import { MCP_CONSTRAINTS } from '../../utils/constraints.js';
222
-
223
- export const fetchTradesTool: MCPTool = {
224
- inputSchema: {
225
- properties: {
226
- limit: {
227
- type: 'number',
228
- minimum: MCP_CONSTRAINTS.MIN_LIMIT,
229
- maximum: MCP_CONSTRAINTS.TRADE_LIMIT,
230
- description: `Results per page (default: 20, maximum: ${MCP_CONSTRAINTS.TRADE_LIMIT})`
231
- },
232
- page: {
233
- type: 'number',
234
- minimum: MCP_CONSTRAINTS.MIN_PAGE,
235
- maximum: MCP_CONSTRAINTS.MAX_PAGE,
236
- description: 'Page number (default: 1)'
237
- }
238
- }
239
- }
240
- };
241
- ```
242
-
243
- ### Balance/User Tools Example
244
-
245
- ```typescript
246
- export const fetchTokensHeldTool: MCPTool = {
247
- inputSchema: {
248
- properties: {
249
- limit: {
250
- type: 'number',
251
- minimum: MCP_CONSTRAINTS.MIN_LIMIT,
252
- maximum: MCP_CONSTRAINTS.USER_LIMIT,
253
- description: `Results per page (default: 20, maximum: ${MCP_CONSTRAINTS.USER_LIMIT})`
254
- }
255
- }
256
- }
257
- };
258
- ```
259
-
260
- ### Pool Tools Example
261
-
262
- ```typescript
263
- export const fetchPoolsTool: MCPTool = {
264
- inputSchema: {
265
- properties: {
266
- limit: {
267
- type: 'number',
268
- minimum: MCP_CONSTRAINTS.MIN_LIMIT,
269
- maximum: MCP_CONSTRAINTS.POOL_LIMIT,
270
- description: `Results per page (default: 20, maximum: ${MCP_CONSTRAINTS.POOL_LIMIT})`
271
- }
272
- }
273
- }
274
- };
275
- ```
276
-
277
- ### Social Tools Example
278
-
279
- ```typescript
280
- export const fetchCommentsTool: MCPTool = {
281
- inputSchema: {
282
- properties: {
283
- limit: {
284
- type: 'number',
285
- minimum: MCP_CONSTRAINTS.MIN_LIMIT,
286
- maximum: MCP_CONSTRAINTS.COMMENT_LIMIT,
287
- description: `Results per page (default: 20, maximum: ${MCP_CONSTRAINTS.COMMENT_LIMIT})`
288
- }
289
- }
290
- }
291
- };
292
- ```
293
-
294
- ---
295
-
296
- ## Validation Helpers
297
-
298
- The constraints utility provides validation helpers for programmatic checks:
299
-
300
- ### `isValidLimit(limit: number, operationType: string): boolean`
301
-
302
- Validates if a limit value is valid for a specific operation type.
303
-
304
- ```typescript
305
- import { isValidLimit } from './utils/constraints.js';
306
-
307
- // Returns true if valid, false otherwise
308
- isValidLimit(20, 'trade') // true
309
- isValidLimit(100, 'trade') // false (max is 20)
310
- isValidLimit(100, 'pool') // true
311
- isValidLimit(50, 'comment') // true
312
- ```
313
-
314
- ### `getMaxLimit(operationType: string): number`
315
-
316
- Returns the maximum limit for a specific operation type.
317
-
318
- ```typescript
319
- import { getMaxLimit } from './utils/constraints.js';
320
-
321
- getMaxLimit('trade') // 20
322
- getMaxLimit('user') // 20
323
- getMaxLimit('pool') // 100
324
- getMaxLimit('comment') // 50
325
- ```
326
-
327
- ---
328
-
329
- ## Maintenance Guidelines
330
-
331
- ### When SDK Constraints Change
332
-
333
- If the SDK updates any constraint values, follow these steps:
334
-
335
- 1. **Update `packages/mcp-server/src/utils/constraints.ts`:**
336
- - Update the relevant constant value
337
- - Update the JSDoc comment with new SDK file line number
338
- - Update usage examples if needed
339
-
340
- 2. **Verify MCP Tool Schemas:**
341
- - Search for all usages of the changed constraint
342
- - Ensure all tool schemas reference the constant correctly
343
- - Update inline comments if needed
344
-
345
- 3. **Update This Documentation:**
346
- - Update the constraint value in all tables
347
- - Update the line numbers in "Constraint Sources" section
348
- - Add changelog entry if significant change
349
-
350
- 4. **Test Validation:**
351
- - Run MCP server with edge case limit values
352
- - Verify validation errors match SDK errors
353
- - Test with AI agents to ensure no surprises
354
-
355
- ### Adding New Constraints
356
-
357
- When adding new constraint types:
358
-
359
- 1. **Add to `constraints.ts`:**
360
- - Add constant with descriptive name
361
- - Add JSDoc with SDK source reference
362
- - Add validation helper if needed
363
- - Export constant
364
-
365
- 2. **Document in This File:**
366
- - Add to "Constraint Sources" section
367
- - Add to "Complete Mapping Table"
368
- - Add usage example
369
- - Add to validation helpers if applicable
370
-
371
- 3. **Update MCP Tools:**
372
- - Apply new constraint to relevant tools
373
- - Update inline comments
374
- - Verify against SDK behavior
375
-
376
- ---
377
-
378
- ## Testing Constraint Sync
379
-
380
- ### Manual Testing Checklist
381
-
382
- Test each operation type with boundary values:
383
-
384
- ```typescript
385
- // Trade Operations (Max: 20)
386
- gala_launchpad_fetch_trades({ limit: 20 }) // Should succeed
387
- gala_launchpad_fetch_trades({ limit: 21 }) // Should fail validation
388
-
389
- // User Operations (Max: 20)
390
- gala_launchpad_fetch_tokens_held({ limit: 20 }) // Should succeed
391
- gala_launchpad_fetch_tokens_held({ limit: 21 }) // Should fail validation
392
-
393
- // Pool Operations (Max: 100)
394
- gala_launchpad_fetch_pools({ limit: 100 }) // Should succeed
395
- gala_launchpad_fetch_pools({ limit: 101 }) // Should fail validation
396
-
397
- // Comment Operations (Max: 50)
398
- gala_launchpad_fetch_comments({ limit: 50 }) // Should succeed
399
- gala_launchpad_fetch_comments({ limit: 51 }) // Should fail validation
400
- ```
401
-
402
- ### Automated Testing
403
-
404
- Consider adding constraint validation tests:
405
-
406
- ```typescript
407
- describe('MCP Constraint Validation', () => {
408
- it('should reject trades with limit > 20', () => {
409
- expect(() => fetchTradesValidation({ limit: 21 })).toThrow();
410
- });
411
-
412
- it('should accept pools with limit = 100', () => {
413
- expect(() => fetchPoolsValidation({ limit: 100 })).not.toThrow();
414
- });
415
-
416
- // ... more tests
417
- });
418
- ```
419
-
420
- ---
421
-
422
- ## Changelog
423
-
424
- ### 2025-09-30
425
- - **BREAKING:** Fixed constraint mismatches across all MCP tools
426
- - `fetchTrades`: Reduced limit from 100 → 20 (matches SDK)
427
- - `fetchTokensHeld`: Reduced limit from 100 → 20 (matches SDK)
428
- - `fetchTokensCreated`: Reduced limit from 100 → 20 (matches SDK)
429
- - `fetchComments`: Reduced limit from 100 → 50 (matches SDK)
430
- - `fetchPools`: Verified limit 100 is correct (matches SDK)
431
- - Created `packages/mcp-server/src/utils/constraints.ts` utility
432
- - Added inline comments linking to SDK constraint sources
433
- - Created this comprehensive constraints reference document
434
-
435
- ---
436
-
437
- ## Related Documentation
438
-
439
- - [AI Agent Patterns](./AI-AGENT-PATTERNS.md) - Common workflows and gotchas
440
- - [MCP Server README](../README.md) - Installation and usage guide
441
- - [SDK Documentation](../../sdk/README.md) - Full SDK reference
442
-
443
- ---
444
-
445
- ## Quick Reference
446
-
447
- | Operation | Max Limit | SDK Source |
448
- |-----------|-----------|------------|
449
- | Trade | 20 | `TRADE_CONSTRAINTS.PAGINATION.MAX_LIMIT` |
450
- | User | 20 | `USER_CONSTRAINTS.PAGINATION.MAX_LIMIT` |
451
- | Pool | 100 | `PAGINATION_CONSTRAINTS.MAX_LIMIT` |
452
- | Comment | 50 | `COMMENT_CONSTRAINTS.PAGINATION.MAX_LIMIT` |
453
-
454
- **Golden Rule:** When in doubt, check `packages/mcp-server/src/utils/constraints.ts` first!