Skip to main content
Glama

Get Top DEX Pairs

get-top-pairs
Read-onlyIdempotent

Retrieve the top PulseX DEX trading pairs sorted by trading volume. Specify a limit up to 500 pairs to get the most active markets on PulseChain.

Instructions

List top PulseX DEX trading pairs by volume.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of pairs (default 20, max 500)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairsYesArray of top trading pairs

Implementation Reference

  • Registration of 'get-top-pairs' tool via server.registerTool() with its name, schema, and handler.
    server.registerTool(
      'get-top-pairs',
      {
        title: 'Get Top DEX Pairs',
        description: 'List top PulseX DEX trading pairs by volume.',
        inputSchema: {
          limit: z.number().min(1).max(500).optional().describe('Number of pairs (default 20, max 500)'),
        },
        outputSchema: z.object({
          pairs: z.array(z.object({
            pair_address: z.string().describe('DEX pair contract address'),
            token0_symbol: z.string().describe('First token symbol'),
            token1_symbol: z.string().describe('Second token symbol'),
            volume_24h: z.number().describe('24-hour volume in USD'),
            liquidity_usd: z.number().describe('Total pair liquidity in USD'),
          }).passthrough()).describe('Array of top trading pairs'),
        }).passthrough(),
        annotations: READ_ONLY_ANNOTATIONS,
      },
      async ({ limit }) => {
        const data = await fetchJSON(`${API}/api/v1/pairs?limit=${limit ?? 20}`)
        return wrapResult(data)
      }
    )
  • Input/output schema definitions for get-top-pairs: input accepts optional 'limit' (number, 1-500), output returns array of pairs with pair_address, token0_symbol, token1_symbol, volume_24h, liquidity_usd.
    {
      title: 'Get Top DEX Pairs',
      description: 'List top PulseX DEX trading pairs by volume.',
      inputSchema: {
        limit: z.number().min(1).max(500).optional().describe('Number of pairs (default 20, max 500)'),
      },
      outputSchema: z.object({
        pairs: z.array(z.object({
          pair_address: z.string().describe('DEX pair contract address'),
          token0_symbol: z.string().describe('First token symbol'),
          token1_symbol: z.string().describe('Second token symbol'),
          volume_24h: z.number().describe('24-hour volume in USD'),
          liquidity_usd: z.number().describe('Total pair liquidity in USD'),
        }).passthrough()).describe('Array of top trading pairs'),
      }).passthrough(),
      annotations: READ_ONLY_ANNOTATIONS,
  • Handler function for get-top-pairs: accepts { limit }, calls fetchJSON to fetch pairs from API endpoint /api/v1/pairs, and wraps the result via wrapResult().
      },
      async ({ limit }) => {
        const data = await fetchJSON(`${API}/api/v1/pairs?limit=${limit ?? 20}`)
        return wrapResult(data)
      }
    )
  • fetchJSON helper: generic async function to fetch JSON from a URL with auth header and timeout.
    async function fetchJSON(url: string): Promise<any> {
      const headers: Record<string, string> = { 'Accept': 'application/json' }
      if (HAS_API_KEY) headers['Authorization'] = `Bearer ${API_KEY}`
      const controller = new AbortController()
      const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS)
      try {
        const res = await fetch(url, { headers, signal: controller.signal })
        if (!res.ok) {
          if (res.status === 401 || res.status === 403) {
            throw new Error(
              `API ${res.status}: This endpoint requires a valid API key. ` +
              `Get one at ${PRICING_URL}`
            )
          }
          throw new Error(`API request failed with status ${res.status}`)
        }
        return res.json()
      } finally {
        clearTimeout(timer)
      }
    }
  • wrapResult helper: wraps API response data into MCP-compatible ToolResult format with text JSON and structuredContent.
    function wrapResult(data: any): ToolResult {
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        structuredContent: data,
      }
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds no further behavioral details (e.g., data freshness, pagination, or rate limits) beyond what annotations provide.

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 sentence with no wasted words. It front-loads the key action and resource, making it easy to scan.

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

Completeness4/5

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

Given the presence of an output schema and the simplicity of the tool (one optional parameter, annotations cover behavior), the description is sufficient. It could optionally mention that results are sorted by volume, but that is implied by 'top pairs' and the tool's name.

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 coverage is 100% for the single parameter 'limit', which is clearly described with default and max values. The description does not mention parameters, but the schema already documents them adequately. Baseline 3 is appropriate.

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

Purpose5/5

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

The description uses a specific verb 'List', identifies the resource as 'top PulseX DEX trading pairs', and specifies the criterion 'by volume'. This clearly distinguishes it from siblings like 'get-top-tokens' and 'get-pair-analytics'.

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?

The description provides no guidance on when to use this tool versus alternatives, nor does it mention any prerequisites or exclusions. For example, it does not suggest that this is for volume-based ranking or when to prefer other tools like 'get-pair-analytics'.

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/openpulsechain/public'

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