get_pairs_by_chain_and_address
Retrieve decentralized exchange (DEX) pair data using chain ID and pair address for real-time market insights and token profiles across multiple blockchains.
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 handler function that executes the tool logic by fetching pair data from the DexScreener API endpoint using the provided chainId and pairId parameters.async getPairsByChainAndAddress({ chainId, pairId }: PairParams): Promise<DexResponse> { return this.fetch<DexResponse>( `/latest/dex/pairs/${chainId}/${pairId}`, dexRateLimiter ); }
- src/types/index.ts:82-85 (schema)Type definition for the input parameters (PairParams) used by the getPairsByChainAndAddress handler.export type PairParams = { chainId: string; pairId: string; };
- src/index.ts:138-154 (registration)Tool registration in MCP server capabilities, including description and input schema.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)Dispatch logic in the CallTool handler that routes the tool call to the DexScreenerService method.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:251-267 (schema)Tool schema returned by the ListTools 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'], }, },