get_token_info
Retrieve detailed token information including socials, websites, and descriptions for DeFi trading analysis and decision-making.
Instructions
Get detailed token information including socials, websites, and description
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network ID (e.g., 'eth', 'bsc', 'polygon_pos') | |
| address | Yes | Token contract address |
Implementation Reference
- src/index.js:520-537 (schema)MCP tool schema definition and registration in the ListTools handler, specifying input schema requiring network and address.name: TOOL_NAMES.GET_TOKEN_INFO, description: "Get detailed token information including socials, websites, and description", inputSchema: { type: "object", properties: { network: { type: "string", description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')", }, address: { type: "string", description: "Token contract address", }, }, required: ["network", "address"], }, },
- src/index.js:1100-1102 (registration)Tool dispatching/registration in the CallToolRequestSchema handler switch statement.case TOOL_NAMES.GET_TOKEN_INFO: result = await toolService.getTokenInfo(args.network, args.address); break;
- src/toolService.js:340-355 (handler)Service layer handler that validates parameters, calls CoinGeckoApiService, and formats the response for the MCP tool.async getTokenInfo(network, address) { if (!network || !address) { throw new Error("Missing required parameters: network, address"); } const result = await this.coinGeckoApi.getTokenInfo(network, address); return { message: `Token info for ${address} on ${network} retrieved successfully`, data: result, summary: `Retrieved detailed info for token ${ result.data?.attributes?.symbol || address }`, note: "This endpoint provides additional token information like socials, websites, and description", }; }
- Core implementation handler that performs the actual HTTP fetch to CoinGecko's onchain API endpoint for detailed token information.async getTokenInfo(network, address) { try { const url = `${this.baseUrl}/networks/${network}/tokens/${address}/info`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to get token info: ${error.message}`); } }
- src/constants.js:33-33 (helper)Constant definition mapping the symbolic name TOOL_NAMES.GET_TOKEN_INFO to the string tool name 'get_token_info' used throughout the codebase.GET_TOKEN_INFO: "get_token_info",