elfa_trending_tokens
Identify trending cryptocurrency tokens by analyzing aggregated sentiment data across specified timeframes and blockchain networks to support market analysis decisions.
Instructions
Trending tokens aggregation. Params: timeframe, chain, limit, cursor.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeframe | No | ||
| chain | No | ||
| limit | No | ||
| cursor | No |
Implementation Reference
- mcp-server.js:189-196 (handler)Primary MCP tool handler for 'elfa_trending_tokens'. Parses input arguments into query parameters and delegates to the generic 'elfa_query' tool which fetches from the ELFA API endpoint '/v2/aggregations/trending-tokens'."elfa_trending_tokens": async (args, meta) => { const query = {}; if (args && args.timeframe !== undefined) query.timeframe = args.timeframe; // "24h","7d","30d" if (args && args.chain !== undefined) query.chain = args.chain; if (args && args.limit !== undefined) query.limit = args.limit; if (args && args.cursor !== undefined) query.cursor = args.cursor; return toolHandlers["elfa_query"]({ path: "/v2/aggregations/trending-tokens", method: "GET", query }, meta); },
- mcp-server.js:303-308 (schema)Tool schema definition including input schema, description, and annotations for registration in the MCP tools list.{ name:"elfa_trending_tokens", description:"Trending tokens aggregation. Params: timeframe, chain, limit, cursor.", inputSchema:{ type:"object", properties:{ timeframe:{type:"string"}, chain:{type:"string"}, limit:{type:"number"}, cursor:{type:"string"} }}, annotations:{ title:"ELFA: Trending Tokens", readOnlyHint:true, openWorldHint:true }
- services/elfa.js:47-52 (handler)Supporting handler function 'elfaTrendingTokens' (camelCase) that performs the API call to the same ELFA endpoint. Used in the HTTP debug server (index.js).export const elfaTrendingTokens = async ({ timeWindow='7d', page=1, pageSize=50, minMentions=5, from=null, to=null }) => { const params = { page, pageSize, minMentions }; if (from != null && to != null) { params.from = from; params.to = to; } else { params.timeWindow = timeWindow; } return safeGet('/v2/aggregations/trending-tokens', params); };
- mcp-server.js:185-187 (registration)Alias handler 'elfa_trending' that registers and delegates directly to the 'elfa_trending_tokens' implementation."elfa_trending": async (args, meta) => { return toolHandlers["elfa_trending_tokens"](args, meta); },
- mcp-server.js:98-120 (helper)Generic helper 'elfaFetch' used by the 'elfa_query' tool to perform HTTP requests to the ELFA API.async function elfaFetch(pathname, options){ const o = options || {}; const method = (o.method || "GET").toUpperCase(); const query = o.query || null; const body = o.body || null; const url = new URL(pathname, ELFA_BASE); if (query && typeof query === "object") { for (const k of Object.keys(query)) { const v = query[k]; if (v !== undefined && v !== null) url.searchParams.set(k, String(v)); } } const headers = { "Accept": "application/json" }; applyAuth(headers); if (body && method !== "GET") headers["Content-Type"] = "application/json"; const res = await fetch(url, { method, headers, body: body && method !== "GET" ? JSON.stringify(body) : undefined }); const raw = await res.text(); let data; try { data = raw ? JSON.parse(raw) : null; } catch { data = { raw }; } return { ok: res.ok, status: res.status, data }; }