Skip to main content
Glama
openSVM

DexScreener MCP Server

by openSVM

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
NameRequiredDescriptionDefault
chainIdYesChain ID (e.g., "solana")
pairIdYesPair address

Implementation Reference

  • 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
      );
    }
  • 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;
    }
  • 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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic function. It doesn't disclose behavioral traits such as read-only nature, error handling, rate limits, or response format, leaving significant gaps for a tool with two required parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, clearly front-loading the purpose. It's appropriately sized for the tool's complexity, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It lacks details on return values, error cases, or behavioral context needed for effective use, especially with required parameters and sibling tools present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds minimal value by mentioning 'chain and pair address' but doesn't provide additional semantics beyond what's in the schema, aligning with the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('pairs'), specifying retrieval by chain and pair address. It distinguishes from siblings like 'search_pairs' by focusing on direct address lookup rather than search, though it doesn't explicitly contrast with 'get_pairs_by_token_addresses'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_pairs' or 'get_pairs_by_token_addresses'. The description implies usage for direct address-based retrieval but lacks explicit context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/openSVM/dexscreener-mcp-server'

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