Skip to main content
Glama

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
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (e.g., "ethereum", "solana")
tokensYesArray of token contract addresses. Serialized as repeatable query (?tokens=a&tokens=b).

Implementation Reference

  • 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); }
  • 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); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/coinpaprika/dexpaprika-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server