Skip to main content
Glama

get_top_pools

Retrieve the top liquidity pools by Total Value Locked (TVL) on SailFish DEX, with an optional count parameter to customize the number of results.

Instructions

Get a list of top liquidity pools by TVL on SailFish DEX

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of pools to return (default: 10)

Implementation Reference

  • src/index.ts:231-244 (registration)
    Registration of the 'get_top_pools' tool in the MCP ListTools handler, including name, description, and input schema.
    {
      name: 'get_top_pools',
      description: 'Get a list of top liquidity pools by TVL on SailFish DEX',
      inputSchema: {
        type: 'object',
        properties: {
          count: {
            type: 'number',
            description: 'Number of pools to return (default: 10)',
          },
        },
        required: [],
      },
    },
  • MCP tool handler for 'get_top_pools' in the CallToolRequestSchema switch statement. Extracts optional count parameter and calls subgraph.getTopPools, returning JSON stringified pools.
    case 'get_top_pools': {
      const count = typeof args.count === 'number' ? args.count : 10;
      const pools = await subgraph.getTopPools(count);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(pools, null, 2),
          },
        ],
      };
    }
  • Core implementation function getTopPools that queries the subgraph using TOP_POOLS_QUERY for top pools by TVL, returning Pool[].
    export async function getTopPools(count: number = 10): Promise<Pool[]> {
      try {
        const data = await request<PoolQueryResult>(
          SUBGRAPH_URL,
          TOP_POOLS_QUERY,
          { count }
        );
        return data.pools;
      } catch (error) {
        console.error('Error fetching top pools:', error);
        throw error;
      }
    }
  • GraphQL query TOP_POOLS_QUERY used by getTopPools to fetch top pools ordered by totalValueLockedUSD.
    const TOP_POOLS_QUERY = gql`
      query getTopPools($count: Int!) {
        pools(
          first: $count
          orderBy: totalValueLockedUSD
          orderDirection: desc
        ) {
          id
          token0 {
            id
            symbol
            name
          }
          token1 {
            id
            symbol
            name
          }
          feeTier
          liquidity
          token0Price
          token1Price
          volumeUSD
          totalValueLockedUSD
          txCount
        }
      }
    `;
  • TypeScript interface Pool defining the structure of pool data returned by the subgraph query.
    export interface Pool {
      id: string;
      createdAtTimestamp: string;
      createdAtBlockNumber: string;
      token0: Token;
      token1: Token;
      feeTier: string;
      liquidity: string;
      sqrtPrice: string;
      feeGrowthGlobal0X128: string;
      feeGrowthGlobal1X128: string;
      token0Price: string;
      token1Price: string;
      tick: string;
      observationIndex: string;
      volumeToken0: string;
      volumeToken1: string;
      volumeUSD: string;
      untrackedVolumeUSD: string;
      feesUSD: string;
      txCount: string;
      collectedFeesToken0: string;
      collectedFeesToken1: string;
      collectedFeesUSD: string;
      totalValueLockedToken0: string;
      totalValueLockedToken1: string;
      totalValueLockedETH: string;
      totalValueLockedUSD: string;
      totalValueLockedUSDUntracked: string;
      liquidityProviderCount: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions TVL-based ranking but doesn't cover critical aspects like rate limits, data freshness, pagination, error conditions, or whether this is a read-only operation. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 that directly states the tool's purpose without any fluff. It's front-loaded with the core functionality and uses minimal words to convey the essential information.

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 insufficient for a tool that returns ranked data. It doesn't explain what information is included in the pool list (e.g., pool addresses, token pairs, TVL values), how TVL is calculated, or the format of the response. This leaves too many unknowns for effective use.

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%, with the single parameter 'count' documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for adequate coverage but doesn't provide extra semantic context.

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 a list') and resource ('top liquidity pools by TVL on SailFish DEX'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_pool_info' or 'get_total_tvl', which reduces it from a perfect score.

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. For example, it doesn't specify if this is for general discovery vs. detailed analysis, or how it differs from 'get_pool_info' or 'get_top_tokens'. The description only states what it does, not when it's appropriate.

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

Related 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/SailFish-Finance/educhain-ai-agent-kit'

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