getTokenMultiPrices
Retrieve batched token prices for multiple addresses on a specified blockchain network. Input token contract addresses to receive current price data, with unknown tokens automatically filtered out.
Instructions
Get batched prices for multiple tokens on a specific network. Pass an array of token addresses; unknown tokens are omitted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network ID from getNetworks (e.g., "ethereum", "solana") | |
| tokens | Yes | Array of token contract addresses. Serialized as repeatable query (?tokens=a&tokens=b). |
Implementation Reference
- src/index.js:274-279 (handler)The core handler function that builds the API endpoint for fetching prices of multiple tokens on a specific network using the DexPaprika API and formats the response for MCP.async ({ network, tokens }) => { const repeatedTokensQuery = tokens.map(t => `tokens=${encodeURIComponent(t)}`).join('&'); const endpoint = `/networks/${network}/multi/prices?${repeatedTokensQuery}`; const data = await fetchFromAPI(endpoint); return formatMcpResponse(data); }
- src/index.js:270-273 (schema)Zod schema defining the input parameters: network (string) and tokens (non-empty array of strings).{ network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), tokens: z.array(z.string()).nonempty().describe('Array of token contract addresses. Serialized as repeatable query (?tokens=a&tokens=b).') },
- src/index.js:267-279 (registration)The server.tool registration call that defines and registers the 'getTokenMultiPrices' tool with its description, input schema, and handler function.server.tool( 'getTokenMultiPrices', 'Get batched prices for multiple tokens on a specific network. Pass an array of token addresses; unknown tokens are omitted.', { network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), tokens: z.array(z.string()).nonempty().describe('Array of token contract addresses. Serialized as repeatable query (?tokens=a&tokens=b).') }, async ({ network, tokens }) => { const repeatedTokensQuery = tokens.map(t => `tokens=${encodeURIComponent(t)}`).join('&'); const endpoint = `/networks/${network}/multi/prices?${repeatedTokensQuery}`; const data = await fetchFromAPI(endpoint); return formatMcpResponse(data); }