get_pairs_by_chain_and_address
Retrieve DEX trading pair data by specifying blockchain and contract address to analyze liquidity, prices, and market activity.
Instructions
Get one or multiple pairs by chain and pair address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | Chain ID (e.g., "solana") | |
| pairId | Yes | Pair address |
Implementation Reference
- src/services/dexscreener.ts:117-122 (handler)The core handler function in DexScreenerService that performs the API fetch for pairs by chain ID and pair address, including rate limiting.async getPairsByChainAndAddress({ chainId, pairId }: PairParams): Promise<DexResponse> { return this.fetch<DexResponse>( `/latest/dex/pairs/${chainId}/${pairId}`, dexRateLimiter ); }
- src/index.ts:138-154 (schema)Input schema for the tool defined in MCP server capabilities, requiring chainId and pairId strings.get_pairs_by_chain_and_address: { description: 'Get one or multiple pairs by chain and pair address', inputSchema: { type: 'object', properties: { chainId: { type: 'string', description: 'Chain ID (e.g., "solana")', }, pairId: { type: 'string', description: 'Pair address', }, }, required: ['chainId', 'pairId'], }, },
- src/index.ts:325-329 (registration)Registration and dispatching logic in the MCP tools/call handler switch statement, calling the service method with parsed arguments.case 'get_pairs_by_chain_and_address': { const args = request.params.arguments as { chainId: string; pairId: string }; result = await this.dexService.getPairsByChainAndAddress(args); break; }
- src/index.ts:250-267 (schema)Duplicate input schema and tool metadata returned by the listTools MCP handler.{ name: 'get_pairs_by_chain_and_address', description: 'Get one or multiple pairs by chain and pair address', inputSchema: { type: 'object', properties: { chainId: { type: 'string', description: 'Chain ID (e.g., "solana")', }, pairId: { type: 'string', description: 'Pair address', }, }, required: ['chainId', 'pairId'], }, },