get_recently_updated_tokens
Retrieve recently updated token information for DeFi trading analysis, with optional network filtering to support cross-chain portfolio decisions.
Instructions
Get recently updated tokens with their information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Attributes to include: 'network' (optional) | |
| network | No | Network ID to filter by (optional, e.g., 'eth', 'bsc', 'polygon_pos') |
Implementation Reference
- src/toolService.js:357-368 (handler)The primary handler function for the 'get_recently_updated_tokens' tool. It calls the CoinGecko API service and formats the response for the MCP protocol.async getRecentlyUpdatedTokens(options = {}) { const result = await this.coinGeckoApi.getRecentlyUpdatedTokens(options); return { message: "Recently updated tokens retrieved successfully", data: result, summary: `Found ${result.data?.length || 0} recently updated tokens${ options.network ? ` on ${options.network}` : " across all networks" }`, includes: options.include ? options.include.split(",") : [], }; }
- src/index.js:538-557 (schema)The tool schema definition including name, description, and input schema for validation in the MCP ListTools response.{ name: TOOL_NAMES.GET_RECENTLY_UPDATED_TOKENS, description: "Get recently updated tokens with their information", inputSchema: { type: "object", properties: { include: { type: "string", description: "Attributes to include: 'network' (optional)", enum: ["network"], }, network: { type: "string", description: "Network ID to filter by (optional, e.g., 'eth', 'bsc', 'polygon_pos')", }, }, required: [], }, },
- src/index.js:1104-1109 (registration)The switch case registration that routes CallTool requests for 'get_recently_updated_tokens' to the toolService handler.case TOOL_NAMES.GET_RECENTLY_UPDATED_TOKENS: result = await toolService.getRecentlyUpdatedTokens({ include: args.include, network: args.network, }); break;
- The underlying API service method that performs the actual HTTP request to CoinGecko's /tokens/info_recently_updated endpoint.async getRecentlyUpdatedTokens(options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.network) queryParams.append('network', options.network); const url = `${this.baseUrl}/tokens/info_recently_updated${queryParams.toString() ? '?' + queryParams.toString() : ''}`; 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 recently updated tokens: ${error.message}`); } }
- src/constants.js:34-34 (helper)Constant definition mapping the tool name enum to the string 'get_recently_updated_tokens' used throughout the codebase.GET_RECENTLY_UPDATED_TOKENS: "get_recently_updated_tokens",