get_pairs_by_token_addresses
Retrieve decentralized exchange (DEX) pairs by providing token addresses as input. Use this tool to access real-time DEX pair data across multiple blockchains with up to 30 token addresses in a single query.
Instructions
Get one or multiple pairs by token address (max 30)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenAddresses | Yes | Comma-separated token addresses |
Implementation Reference
- src/services/dexscreener.ts:124-129 (handler)The main handler function that fetches pairs data from DexScreener API endpoint '/latest/dex/tokens/{tokenAddresses}' using the internal fetch method with rate limiting.async getPairsByTokenAddresses({ tokenAddresses }: TokenParams): Promise<DexResponse> { return this.fetch<DexResponse>( `/latest/dex/tokens/${tokenAddresses}`, dexRateLimiter ); }
- src/types/index.ts:87-89 (schema)TypeScript type definition for the tool's input parameters, specifying tokenAddresses as a comma-separated string.export type TokenParams = { tokenAddresses: string; // Comma-separated addresses };
- src/index.ts:155-167 (schema)MCP tool input schema definition in the server capabilities, matching the TokenParams type.get_pairs_by_token_addresses: { description: 'Get one or multiple pairs by token address (max 30)', inputSchema: { type: 'object', properties: { tokenAddresses: { type: 'string', description: 'Comma-separated token addresses', }, }, required: ['tokenAddresses'], }, },
- src/index.ts:331-335 (registration)Registration and dispatching logic in the CallToolRequest handler switch statement, casting arguments and calling the service method.case 'get_pairs_by_token_addresses': { const args = request.params.arguments as { tokenAddresses: string }; result = await this.dexService.getPairsByTokenAddresses(args); break; }