@gala-chain/launchpad-mcp-server 1.24.1 → 1.25.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 +30 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +3 -3
- package/dist/tools/pools/index.d.ts.map +1 -1
- package/dist/tools/pools/index.js +4 -0
- package/dist/tools/pools/index.js.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts +6 -0
- package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -0
- package/dist/tools/pools/onDexPoolCreation.js +60 -0
- package/dist/tools/pools/onDexPoolCreation.js.map +1 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +6 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.js +54 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -0
- 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/fetchTokenDetails.integration.test.ts +0 -258
- package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
- package/src/__tests__/server.test.ts +0 -255
- package/src/constants/mcpToolNames.ts +0 -183
- package/src/index.ts +0 -19
- package/src/prompts/__tests__/promptStructure.test.ts +0 -187
- package/src/prompts/__tests__/registry.test.ts +0 -349
- package/src/prompts/analysis.ts +0 -380
- package/src/prompts/balances.ts +0 -182
- package/src/prompts/create-token.ts +0 -123
- package/src/prompts/creation-utils.ts +0 -103
- package/src/prompts/dex-trading.ts +0 -86
- package/src/prompts/discover-tokens.ts +0 -86
- package/src/prompts/explore-dex-pools.ts +0 -138
- package/src/prompts/index.ts +0 -178
- package/src/prompts/liquidity-positions.ts +0 -237
- package/src/prompts/pools.ts +0 -496
- package/src/prompts/portfolio.ts +0 -208
- package/src/prompts/social.ts +0 -94
- package/src/prompts/trading-calculations.ts +0 -414
- package/src/prompts/trading.ts +0 -160
- package/src/prompts/transfers.ts +0 -97
- package/src/prompts/utility-tools.ts +0 -266
- package/src/prompts/utility.ts +0 -77
- package/src/prompts/utils/handlerHelpers.ts +0 -55
- package/src/prompts/utils/textTemplates.ts +0 -73
- package/src/prompts/utils/workflowTemplates.ts +0 -511
- package/src/schemas/common-schemas.ts +0 -393
- package/src/scripts/test-all-prompts.ts +0 -184
- package/src/server.ts +0 -367
- package/src/tools/__tests__/dex-tools.test.ts +0 -562
- package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
- package/src/tools/balance/index.ts +0 -174
- package/src/tools/creation/index.ts +0 -182
- package/src/tools/dex/fetchAllDexPools.ts +0 -45
- package/src/tools/dex/fetchDexPools.ts +0 -58
- package/src/tools/dex/index.ts +0 -231
- package/src/tools/dex/liquidity-positions.ts +0 -547
- package/src/tools/index.ts +0 -94
- package/src/tools/pools/fetchAllPools.ts +0 -47
- package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
- 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 -124
- package/src/tools/pools/fetchTokenDetails.ts +0 -77
- package/src/tools/pools/index.ts +0 -284
- 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 -1446
- package/src/tools/utils/getAddress.ts +0 -12
- package/src/tools/utils/getCacheInfo.ts +0 -14
- package/src/tools/utils/getConfig.ts +0 -21
- package/src/tools/utils/getEnvironment.ts +0 -17
- 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/getWallet.ts +0 -25
- package/src/tools/utils/hasWallet.ts +0 -15
- package/src/tools/utils/index.ts +0 -37
- package/src/tools/utils/isTokenGraduated.ts +0 -16
- package/src/tools/utils/setWallet.ts +0 -41
- package/src/tools/utils/switchEnvironment.ts +0 -28
- package/src/types/mcp.ts +0 -72
- package/src/utils/__tests__/validation.test.ts +0 -147
- package/src/utils/constraints.ts +0 -155
- 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 -303
- package/src/utils/tool-registry.ts +0 -296
- package/src/utils/validation.ts +0 -429
- package/tests/wallet-management-integration.test.ts +0 -284
- package/tsconfig.json +0 -23
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch All Price History Tool
|
|
3
|
-
*
|
|
4
|
-
* Queries all historical token price data from DEX Backend API with automatic pagination.
|
|
5
|
-
* Uses the /price-oracle/fetch-price endpoint for complete price history retrieval.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { MCPTool } from '../../types/mcp.js';
|
|
9
|
-
import { formatSuccess } from '../../utils/response-formatter.js';
|
|
10
|
-
import { withErrorHandling } from '../../utils/error-handler.js';
|
|
11
|
-
|
|
12
|
-
export const fetchAllPriceHistoryTool: MCPTool = {
|
|
13
|
-
name: 'gala_launchpad_fetch_all_price_history',
|
|
14
|
-
description: `Fetch all historical price snapshots for DEX tokens from the DEX Backend API with automatic pagination.
|
|
15
|
-
|
|
16
|
-
**Endpoint:** \`/price-oracle/fetch-price\`
|
|
17
|
-
|
|
18
|
-
**Requirements:**
|
|
19
|
-
- DEX Backend API must be configured (dexBackendBaseUrl in SDK config)
|
|
20
|
-
- Node.js environment only (not available in browser)
|
|
21
|
-
- Either tokenName OR tokenId is required (not both)
|
|
22
|
-
|
|
23
|
-
**Token Identification:**
|
|
24
|
-
- Use \`tokenName\` for convenience (e.g., "demonkpop") - automatically resolved to full token ID
|
|
25
|
-
- Use \`tokenId\` for direct specification (e.g., "Token|Unit|DKP|eth:...")
|
|
26
|
-
- Provide exactly ONE of these parameters
|
|
27
|
-
|
|
28
|
-
**Use Cases:**
|
|
29
|
-
- Complete historical price analysis and charting
|
|
30
|
-
- Full price trend identification over time periods
|
|
31
|
-
- Comprehensive volatility analysis
|
|
32
|
-
- Data export for external analytics
|
|
33
|
-
|
|
34
|
-
**Performance:** API-based queries with automatic pagination (max 100 items per page, combined into single result).`,
|
|
35
|
-
|
|
36
|
-
inputSchema: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: {
|
|
39
|
-
tokenName: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
description:
|
|
42
|
-
'Simple token name for convenience (e.g., "demonkpop", "shoewars") - automatically resolves to full token ID. Use this OR tokenId, not both.',
|
|
43
|
-
},
|
|
44
|
-
tokenId: {
|
|
45
|
-
oneOf: [
|
|
46
|
-
{
|
|
47
|
-
type: 'string',
|
|
48
|
-
description:
|
|
49
|
-
'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:...")',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: 'object',
|
|
53
|
-
properties: {
|
|
54
|
-
collection: {
|
|
55
|
-
type: 'string',
|
|
56
|
-
description: 'Token collection (e.g., "Token")',
|
|
57
|
-
},
|
|
58
|
-
category: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'Token category (e.g., "Unit")',
|
|
61
|
-
},
|
|
62
|
-
type: {
|
|
63
|
-
type: 'string',
|
|
64
|
-
description: 'Token type (e.g., "GUSDC")',
|
|
65
|
-
},
|
|
66
|
-
additionalKey: {
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: 'Additional key (e.g., "eth:0x...")',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
required: ['collection', 'category', 'type', 'additionalKey'],
|
|
72
|
-
description: 'TokenClassKey object format',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
description: 'Token identifier (string or TokenClassKey object). Use this OR tokenName, not both.',
|
|
76
|
-
},
|
|
77
|
-
from: {
|
|
78
|
-
type: 'string',
|
|
79
|
-
format: 'date-time',
|
|
80
|
-
description: 'Start date for filtering (ISO 8601 format, defaults to 30 days ago)',
|
|
81
|
-
},
|
|
82
|
-
to: {
|
|
83
|
-
type: 'string',
|
|
84
|
-
format: 'date-time',
|
|
85
|
-
description: 'End date for filtering (ISO 8601 format, defaults to now)',
|
|
86
|
-
},
|
|
87
|
-
sortOrder: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
enum: ['ASC', 'DESC'],
|
|
90
|
-
description: 'Sort order for results (default: DESC for newest-first)',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
required: [],
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
handler: withErrorHandling(async (sdk, args) => {
|
|
97
|
-
// Convert string dates to Date objects if provided
|
|
98
|
-
const options: any = {
|
|
99
|
-
sortOrder: args.sortOrder,
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Support both tokenName and tokenId (mutual exclusivity validation happens in SDK)
|
|
103
|
-
if (args.tokenName) {
|
|
104
|
-
options.tokenName = args.tokenName;
|
|
105
|
-
} else {
|
|
106
|
-
options.tokenId = args.tokenId;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (args.from) {
|
|
110
|
-
options.from = new Date(args.from);
|
|
111
|
-
}
|
|
112
|
-
if (args.to) {
|
|
113
|
-
options.to = new Date(args.to);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const result = await sdk.fetchAllPriceHistory(options);
|
|
117
|
-
return formatSuccess(result);
|
|
118
|
-
}),
|
|
119
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch Pool Details Tool
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { MCPTool } from '../../types/mcp.js';
|
|
6
|
-
import { formatSuccess } from '../../utils/response-formatter.js';
|
|
7
|
-
import { withErrorHandling } from '../../utils/error-handler.js';
|
|
8
|
-
|
|
9
|
-
export const fetchPoolDetailsTool: MCPTool = {
|
|
10
|
-
name: 'gala_launchpad_fetch_pool_details',
|
|
11
|
-
description: 'Get detailed pool state from GalaChain bonding curve',
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
tokenName: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
pattern: '^[a-z0-9_-]{2,20}$',
|
|
18
|
-
description: 'Token name',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
required: ['tokenName'],
|
|
22
|
-
},
|
|
23
|
-
handler: withErrorHandling(async (sdk, args) => {
|
|
24
|
-
const result = await sdk.fetchPoolDetails(args.tokenName);
|
|
25
|
-
return formatSuccess(result);
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch Pool Details for Calculation Tool (73% code reduction via factory pattern)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { createSimpleTokenFetchTool } from '../../utils/tool-factory.js';
|
|
6
|
-
|
|
7
|
-
export const fetchPoolDetailsForCalculationTool = createSimpleTokenFetchTool({
|
|
8
|
-
name: 'gala_launchpad_fetch_pool_details_for_calculation',
|
|
9
|
-
description: `Get optimized pool details for local bonding curve calculations.
|
|
10
|
-
|
|
11
|
-
Returns only essential calculation parameters:
|
|
12
|
-
- currentSupply: Current token supply (computed with full precision)
|
|
13
|
-
- remainingTokens: Tokens available for purchase
|
|
14
|
-
- maxSupply: Maximum token supply
|
|
15
|
-
- reverseBondingCurveMaxFeeFactor: Maximum reverse bonding curve fee (normalized to number)
|
|
16
|
-
- reverseBondingCurveMinFeeFactor: Minimum reverse bonding curve fee (normalized to number)
|
|
17
|
-
- reverseBondingCurveNetFeeFactor: Net fee factor (max - min, for convenience)
|
|
18
|
-
|
|
19
|
-
This is more efficient than fetchPoolDetails as it returns only fields needed for calculations.
|
|
20
|
-
Perfect for use with calculateBuyAmountLocal and calculateSellAmountLocal.`,
|
|
21
|
-
handler: (sdk, tokenName) => sdk.fetchPoolDetailsForCalculation(tokenName),
|
|
22
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch Pools Tool
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { MCPTool } from '../../types/mcp.js';
|
|
6
|
-
import { formatSuccess } from '../../utils/response-formatter.js';
|
|
7
|
-
import { withErrorHandling } from '../../utils/error-handler.js';
|
|
8
|
-
|
|
9
|
-
export const fetchPoolsTool: MCPTool = {
|
|
10
|
-
name: 'gala_launchpad_fetch_pools',
|
|
11
|
-
description: 'Fetch token pools from Gala Launchpad with filtering and pagination',
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
type: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
enum: ['recent', 'popular'],
|
|
18
|
-
description: 'Type of pools to fetch (default: recent)',
|
|
19
|
-
},
|
|
20
|
-
creatorAddress: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
pattern: '^(0x[a-fA-F0-9]{40}|eth\\|[a-fA-F0-9]{40})$',
|
|
23
|
-
description: 'Filter by creator address (optional)',
|
|
24
|
-
},
|
|
25
|
-
page: {
|
|
26
|
-
type: 'number',
|
|
27
|
-
minimum: 1,
|
|
28
|
-
description: 'Page number (default: 1)',
|
|
29
|
-
},
|
|
30
|
-
limit: {
|
|
31
|
-
type: 'number',
|
|
32
|
-
minimum: 1,
|
|
33
|
-
maximum: 100,
|
|
34
|
-
description: 'Results per page (default: 20)',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
handler: withErrorHandling(async (sdk, args) => {
|
|
39
|
-
const result = await sdk.fetchPools({
|
|
40
|
-
type: args.type || 'recent',
|
|
41
|
-
page: args.page || 1,
|
|
42
|
-
limit: args.limit || 20,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
return formatSuccess(result);
|
|
46
|
-
}),
|
|
47
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch Price History Tool
|
|
3
|
-
*
|
|
4
|
-
* Queries historical token price data from DEX Backend API.
|
|
5
|
-
* Uses the /price-oracle/fetch-price endpoint for paginated price history retrieval.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { MCPTool } from '../../types/mcp.js';
|
|
9
|
-
import { formatSuccess } from '../../utils/response-formatter.js';
|
|
10
|
-
import { withErrorHandling } from '../../utils/error-handler.js';
|
|
11
|
-
import { PAGE_SCHEMA, createLimitSchema } from '../../schemas/common-schemas.js';
|
|
12
|
-
|
|
13
|
-
export const fetchPriceHistoryTool: MCPTool = {
|
|
14
|
-
name: 'gala_launchpad_fetch_price_history',
|
|
15
|
-
description: `Fetch historical price snapshots for DEX tokens from the DEX Backend API.
|
|
16
|
-
|
|
17
|
-
**Endpoint:** \`/price-oracle/fetch-price\`
|
|
18
|
-
|
|
19
|
-
**Requirements:**
|
|
20
|
-
- DEX Backend API must be configured (dexBackendBaseUrl in SDK config)
|
|
21
|
-
- Node.js environment only (not available in browser)
|
|
22
|
-
- Either tokenName OR tokenId is required (not both)
|
|
23
|
-
|
|
24
|
-
**Token Identification:**
|
|
25
|
-
- Use \`tokenName\` for convenience (e.g., "demonkpop") - automatically resolved to full token ID
|
|
26
|
-
- Use \`tokenId\` for direct specification (e.g., "Token|Unit|DKP|eth:...")
|
|
27
|
-
- Provide exactly ONE of these parameters
|
|
28
|
-
|
|
29
|
-
**Use Cases:**
|
|
30
|
-
- Historical price analysis and charting
|
|
31
|
-
- Price trend identification
|
|
32
|
-
- Volatility analysis over time periods
|
|
33
|
-
- Data export for external analytics
|
|
34
|
-
|
|
35
|
-
**Performance:** API-based queries with pagination support (max 50 items per page).`,
|
|
36
|
-
|
|
37
|
-
inputSchema: {
|
|
38
|
-
type: 'object',
|
|
39
|
-
properties: {
|
|
40
|
-
tokenName: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description:
|
|
43
|
-
'Simple token name for convenience (e.g., "demonkpop", "shoewars") - automatically resolves to full token ID. Use this OR tokenId, not both.',
|
|
44
|
-
},
|
|
45
|
-
tokenId: {
|
|
46
|
-
oneOf: [
|
|
47
|
-
{
|
|
48
|
-
type: 'string',
|
|
49
|
-
description:
|
|
50
|
-
'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:...")',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'object',
|
|
54
|
-
properties: {
|
|
55
|
-
collection: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Token collection (e.g., "Token")',
|
|
58
|
-
},
|
|
59
|
-
category: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Token category (e.g., "Unit")',
|
|
62
|
-
},
|
|
63
|
-
type: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
description: 'Token type (e.g., "GUSDC")',
|
|
66
|
-
},
|
|
67
|
-
additionalKey: {
|
|
68
|
-
type: 'string',
|
|
69
|
-
description: 'Additional key (e.g., "eth:0x...")',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
required: ['collection', 'category', 'type', 'additionalKey'],
|
|
73
|
-
description: 'TokenClassKey object format',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
description: 'Token identifier (string or TokenClassKey object). Use this OR tokenName, not both.',
|
|
77
|
-
},
|
|
78
|
-
from: {
|
|
79
|
-
type: 'string',
|
|
80
|
-
format: 'date-time',
|
|
81
|
-
description: 'Start date for filtering (ISO 8601 format, defaults to 30 days ago)',
|
|
82
|
-
},
|
|
83
|
-
to: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
format: 'date-time',
|
|
86
|
-
description: 'End date for filtering (ISO 8601 format, defaults to now)',
|
|
87
|
-
},
|
|
88
|
-
sortOrder: {
|
|
89
|
-
type: 'string',
|
|
90
|
-
enum: ['ASC', 'DESC'],
|
|
91
|
-
description: 'Sort order for results (default: DESC for newest-first)',
|
|
92
|
-
},
|
|
93
|
-
page: PAGE_SCHEMA,
|
|
94
|
-
limit: createLimitSchema('priceHistory', 10),
|
|
95
|
-
},
|
|
96
|
-
required: [],
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
handler: withErrorHandling(async (sdk, args) => {
|
|
100
|
-
// Convert string dates to Date objects if provided
|
|
101
|
-
const options: any = {
|
|
102
|
-
sortOrder: args.sortOrder,
|
|
103
|
-
page: args.page,
|
|
104
|
-
limit: args.limit,
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// Support both tokenName and tokenId (mutual exclusivity validation happens in SDK)
|
|
108
|
-
if (args.tokenName) {
|
|
109
|
-
options.tokenName = args.tokenName;
|
|
110
|
-
} else {
|
|
111
|
-
options.tokenId = args.tokenId;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (args.from) {
|
|
115
|
-
options.from = new Date(args.from);
|
|
116
|
-
}
|
|
117
|
-
if (args.to) {
|
|
118
|
-
options.to = new Date(args.to);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const result = await sdk.fetchPriceHistory(options);
|
|
122
|
-
return formatSuccess(result);
|
|
123
|
-
}),
|
|
124
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch Token Details Tool
|
|
3
|
-
*
|
|
4
|
-
* Queries the DEX API platform endpoint to retrieve comprehensive token metadata
|
|
5
|
-
* including image, decimals, description, verification status, network information,
|
|
6
|
-
* and trading capabilities.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type { MCPTool } from '../../types/mcp.js';
|
|
10
|
-
import { formatSuccess } from '../../utils/response-formatter.js';
|
|
11
|
-
import { withErrorHandling } from '../../utils/error-handler.js';
|
|
12
|
-
|
|
13
|
-
export const fetchTokenDetailsTool: MCPTool = {
|
|
14
|
-
name: 'gala_launchpad_fetch_token_details',
|
|
15
|
-
description: `Fetch comprehensive token details from DEX API platform
|
|
16
|
-
|
|
17
|
-
**Endpoint:** \`/v1/tokens?tokenclasskeys=...\`
|
|
18
|
-
|
|
19
|
-
**Requirements:**
|
|
20
|
-
- DEX API platform must be configured (dexApiHttp client)
|
|
21
|
-
- Token identifier required in flexible format (string or object)
|
|
22
|
-
|
|
23
|
-
**Use Cases:**
|
|
24
|
-
- Retrieve complete token metadata and information
|
|
25
|
-
- Verify token specifications (decimals, symbol, description)
|
|
26
|
-
- Check verification status and trading capabilities
|
|
27
|
-
- Access token image and network information
|
|
28
|
-
- Analyze token details before trading
|
|
29
|
-
|
|
30
|
-
**Flexible Token Identification:**
|
|
31
|
-
Supports both pipe-delimited string and object formats for maximum flexibility.`,
|
|
32
|
-
|
|
33
|
-
inputSchema: {
|
|
34
|
-
type: 'object',
|
|
35
|
-
properties: {
|
|
36
|
-
tokenId: {
|
|
37
|
-
oneOf: [
|
|
38
|
-
{
|
|
39
|
-
type: 'string',
|
|
40
|
-
description:
|
|
41
|
-
'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:0x...")',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: 'object',
|
|
45
|
-
properties: {
|
|
46
|
-
collection: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Token collection (e.g., "Token")',
|
|
49
|
-
},
|
|
50
|
-
category: {
|
|
51
|
-
type: 'string',
|
|
52
|
-
description: 'Token category (e.g., "Unit")',
|
|
53
|
-
},
|
|
54
|
-
type: {
|
|
55
|
-
type: 'string',
|
|
56
|
-
description: 'Token type (e.g., "GUSDC")',
|
|
57
|
-
},
|
|
58
|
-
additionalKey: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'Additional key (e.g., "eth:0x...")',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
required: ['collection', 'category', 'type', 'additionalKey'],
|
|
64
|
-
description: 'TokenClassKey object format',
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
description: 'Token identifier in flexible format (string or object)',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
required: ['tokenId'],
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
handler: withErrorHandling(async (sdk, args) => {
|
|
74
|
-
const result = await sdk.fetchTokenDetails(args.tokenId);
|
|
75
|
-
return formatSuccess(result);
|
|
76
|
-
}),
|
|
77
|
-
};
|