Skip to main content
Glama

get_top_tokens

Retrieve the top tokens by Total Value Locked (TVL) on SailFish DEX. Specify the number of tokens to fetch for informed DeFi decisions.

Instructions

Get a list of top tokens by TVL on SailFish DEX

Input Schema

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

Implementation Reference

  • MCP tool handler implementation for 'get_top_tokens'. Extracts optional 'count' parameter, calls subgraph.getTopTokens, and returns JSON-formatted list of top tokens.
    case 'get_top_tokens': {
      const count = typeof args.count === 'number' ? args.count : 10;
      const tokens = await subgraph.getTopTokens(count);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(tokens, null, 2),
          },
        ],
      };
    }
  • Input schema and metadata definition for the 'get_top_tokens' tool, registered in ListToolsRequestSchema response.
      name: 'get_top_tokens',
      description: 'Get a list of top tokens by TVL on SailFish DEX',
      inputSchema: {
        type: 'object',
        properties: {
          count: {
            type: 'number',
            description: 'Number of tokens to return (default: 10)',
          },
        },
        required: [],
      },
    },
  • src/index.ts:173-712 (registration)
    Registration of all MCP tools including 'get_top_tokens' via setRequestHandler for ListToolsRequestSchema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'get_token_price',
          description: 'Get the current price of a token on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              tokenId: {
                type: 'string',
                description: 'Token address',
              },
            },
            required: ['tokenId'],
          },
        },
        {
          name: 'get_token_info',
          description: 'Get detailed information about a token on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              tokenId: {
                type: 'string',
                description: 'Token address',
              },
            },
            required: ['tokenId'],
          },
        },
        {
          name: 'get_pool_info',
          description: 'Get detailed information about a liquidity pool on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              poolId: {
                type: 'string',
                description: 'Pool address',
              },
            },
            required: ['poolId'],
          },
        },
        {
          name: 'get_top_tokens',
          description: 'Get a list of top tokens by TVL on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              count: {
                type: 'number',
                description: 'Number of tokens to return (default: 10)',
              },
            },
            required: [],
          },
        },
        {
          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: [],
          },
        },
        {
          name: 'get_total_tvl',
          description: 'Get the total value locked (TVL) in SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {},
            required: [],
          },
        },
        {
          name: 'get_24h_volume',
          description: 'Get the 24-hour trading volume on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {},
            required: [],
          },
        },
        {
          name: 'get_token_historical_data',
          description: 'Get historical data for a token on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              tokenId: {
                type: 'string',
                description: 'Token address',
              },
              days: {
                type: 'number',
                description: 'Number of days of data to return (default: 7)',
              },
            },
            required: ['tokenId'],
          },
        },
        {
          name: 'get_pool_historical_data',
          description: 'Get historical data for a liquidity pool on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              poolId: {
                type: 'string',
                description: 'Pool address',
              },
              days: {
                type: 'number',
                description: 'Number of days of data to return (default: 7)',
              },
            },
            required: ['poolId'],
          },
        },
        {
          name: 'get_edu_balance',
          description: 'Get the EDU balance of a wallet address',
          inputSchema: {
            type: 'object',
            properties: {
              walletAddress: {
                type: 'string',
                description: 'Wallet address to check',
              },
            },
            required: ['walletAddress'],
          },
        },
        {
          name: 'get_token_balance',
          description: 'Get the token balance of a wallet address with USD value using SailFish as price oracle',
          inputSchema: {
            type: 'object',
            properties: {
              tokenAddress: {
                type: 'string',
                description: 'Token contract address',
              },
              walletAddress: {
                type: 'string',
                description: 'Wallet address to check',
              },
            },
            required: ['tokenAddress', 'walletAddress'],
          },
        },
        {
          name: 'get_multiple_token_balances',
          description: 'Get multiple token balances for a wallet address with USD values using SailFish as price oracle',
          inputSchema: {
            type: 'object',
            properties: {
              tokenAddresses: {
                type: 'array',
                items: {
                  type: 'string',
                },
                description: 'List of token contract addresses',
              },
              walletAddress: {
                type: 'string',
                description: 'Wallet address to check',
              },
            },
            required: ['tokenAddresses', 'walletAddress'],
          },
        },
        {
          name: 'get_nft_balance',
          description: 'Get the NFT balance of a wallet address for a specific NFT collection',
          inputSchema: {
            type: 'object',
            properties: {
              nftAddress: {
                type: 'string',
                description: 'NFT contract address',
              },
              walletAddress: {
                type: 'string',
                description: 'Wallet address to check',
              },
              fetchTokenIds: {
                type: 'boolean',
                description: 'Whether to fetch token IDs (default: true)',
              },
            },
            required: ['nftAddress', 'walletAddress'],
          },
        },
        {
          name: 'get_wallet_overview',
          description: 'Get an overview of a wallet including EDU, tokens, and NFTs',
          inputSchema: {
            type: 'object',
            properties: {
              walletAddress: {
                type: 'string',
                description: 'Wallet address to check',
              },
              tokenAddresses: {
                type: 'array',
                items: {
                  type: 'string',
                },
                description: 'List of token contract addresses to check',
              },
              nftAddresses: {
                type: 'array',
                items: {
                  type: 'string',
                },
                description: 'List of NFT contract addresses to check',
              },
            },
            required: ['walletAddress'],
          },
        },
        {
          name: 'set_rpc_url',
          description: 'Set the RPC URL for blockchain interactions',
          inputSchema: {
            type: 'object',
            properties: {
              url: {
                type: 'string',
                description: 'RPC URL to use for blockchain interactions',
              },
            },
            required: ['url'],
          },
        },
        {
          name: 'get_rpc_url',
          description: 'Get the current RPC URL used for blockchain interactions',
          inputSchema: {
            type: 'object',
            properties: {},
            required: [],
          },
        },
        {
          name: 'send_edu',
          description: 'Send EDU native token to another wallet address',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the sender wallet',
              },
              toAddress: {
                type: 'string',
                description: 'Recipient wallet address',
              },
              amount: {
                type: 'string',
                description: 'Amount of EDU to send',
              },
            },
            required: ['privateKey', 'toAddress', 'amount'],
          },
        },
        {
          name: 'get_wallet_address_from_private_key',
          description: 'Get wallet address from private key with proper checksum formatting',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the wallet',
              },
            },
            required: ['privateKey'],
          },
        },
        {
          name: 'send_erc20_token',
          description: 'Send ERC20 token to another wallet address',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the sender wallet',
              },
              tokenAddress: {
                type: 'string',
                description: 'Token contract address',
              },
              toAddress: {
                type: 'string',
                description: 'Recipient wallet address',
              },
              amount: {
                type: 'string',
                description: 'Amount of tokens to send',
              },
              confirm: {
                type: 'boolean',
                description: 'Confirm the transaction after verifying wallet address (default: true)',
              },
            },
            required: ['privateKey', 'tokenAddress', 'toAddress', 'amount'],
          },
        },
        {
          name: 'get_swap_quote',
          description: 'Get a quote for swapping tokens on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              tokenIn: {
                type: 'string',
                description: 'Address of the input token',
              },
              tokenOut: {
                type: 'string',
                description: 'Address of the output token',
              },
              amountIn: {
                type: 'string',
                description: 'Amount of input token to swap',
              },
              fee: {
                type: 'number',
                description: 'Fee tier (100=0.01%, 500=0.05%, 3000=0.3%, 10000=1%)',
              },
            },
            required: ['tokenIn', 'tokenOut', 'amountIn'],
          },
        },
        {
          name: 'swap_tokens',
          description: 'Swap tokens on SailFish DEX (token to token)',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the sender wallet',
              },
              tokenIn: {
                type: 'string',
                description: 'Address of the input token',
              },
              tokenOut: {
                type: 'string',
                description: 'Address of the output token',
              },
              amountIn: {
                type: 'string',
                description: 'Amount of input token to swap',
              },
              slippagePercentage: {
                type: 'number',
                description: 'Slippage tolerance percentage (default: 0.5)',
              },
              fee: {
                type: 'number',
                description: 'Fee tier (100=0.01%, 500=0.05%, 3000=0.3%, 10000=1%)',
              },
            },
            required: ['privateKey', 'tokenIn', 'tokenOut', 'amountIn'],
          },
        },
        {
          name: 'swap_edu_for_tokens',
          description: 'Swap EDU for tokens on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the sender wallet',
              },
              tokenOut: {
                type: 'string',
                description: 'Address of the output token',
              },
              amountIn: {
                type: 'string',
                description: 'Amount of EDU to swap',
              },
              slippagePercentage: {
                type: 'number',
                description: 'Slippage tolerance percentage (default: 0.5)',
              },
              fee: {
                type: 'number',
                description: 'Fee tier (100=0.01%, 500=0.05%, 3000=0.3%, 10000=1%)',
              },
            },
            required: ['privateKey', 'tokenOut', 'amountIn'],
          },
        },
        {
          name: 'swap_tokens_for_edu',
          description: 'Swap tokens for EDU on SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the sender wallet',
              },
              tokenIn: {
                type: 'string',
                description: 'Address of the input token',
              },
              amountIn: {
                type: 'string',
                description: 'Amount of tokens to swap',
              },
              slippagePercentage: {
                type: 'number',
                description: 'Slippage tolerance percentage (default: 0.5)',
              },
              fee: {
                type: 'number',
                description: 'Fee tier (100=0.01%, 500=0.05%, 3000=0.3%, 10000=1%)',
              },
            },
            required: ['privateKey', 'tokenIn', 'amountIn'],
          },
        },
        {
          name: 'get_external_market_data',
          description: 'Get external market data for EDU from centralized exchanges',
          inputSchema: {
            type: 'object',
            properties: {},
            required: [],
          },
        },
        {
          name: 'check_arbitrage_opportunities',
          description: 'Check for arbitrage opportunities between centralized exchanges and SailFish DEX',
          inputSchema: {
            type: 'object',
            properties: {
              threshold: {
                type: 'number',
                description: 'Minimum price difference percentage to consider as an arbitrage opportunity (default: 1.0)',
              },
            },
            required: [],
          },
        },
        {
          name: 'update_external_market_config',
          description: 'Update the configuration for external market data API',
          inputSchema: {
            type: 'object',
            properties: {
              apiUrl: {
                type: 'string',
                description: 'API URL for external market data',
              },
              apiKey: {
                type: 'string',
                description: 'API key for external market data (if required)',
              },
              symbols: {
                type: 'object',
                properties: {
                  EDU: {
                    type: 'string',
                    description: 'Symbol for EDU token on the external API',
                  },
                  USD: {
                    type: 'string',
                    description: 'Symbol for USD on the external API',
                  },
                },
                description: 'Symbol mappings for the external API',
              },
            },
            required: [],
          },
        },
        {
          name: 'get_external_market_config',
          description: 'Get the current configuration for external market data API',
          inputSchema: {
            type: 'object',
            properties: {},
            required: [],
          },
        },
        {
          name: 'wrap_edu',
          description: 'Wrap EDU to WEDU (Wrapped EDU)',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the wallet',
              },
              amount: {
                type: 'string',
                description: 'Amount of EDU to wrap',
              },
            },
            required: ['privateKey', 'amount'],
          },
        },
        {
          name: 'unwrap_wedu',
          description: 'Unwrap WEDU (Wrapped EDU) to EDU',
          inputSchema: {
            type: 'object',
            properties: {
              privateKey: {
                type: 'string',
                description: 'Private key of the wallet',
              },
              amount: {
                type: 'string',
                description: 'Amount of WEDU to unwrap',
              },
            },
            required: ['privateKey', 'amount'],
          },
        },
      ],
    }));
  • Helper function getTopTokens that executes GraphQL query to fetch top tokens by totalValueLockedUSD from SailFish subgraph.
    export async function getTopTokens(count: number = 10): Promise<Token[]> {
      try {
        const data = await request<TokenQueryResult>(
          SUBGRAPH_URL,
          TOP_TOKENS_QUERY,
          { count }
        );
        return data.tokens;
      } catch (error) {
        console.error('Error fetching top tokens:', error);
        throw error;
      }
    }
  • GraphQL schema/query definition for fetching top tokens, used by getTopTokens helper.
    const TOP_TOKENS_QUERY = gql`
      query getTopTokens($count: Int!) {
        tokens(
          first: $count
          orderBy: totalValueLockedUSD
          orderDirection: desc
        ) {
          id
          symbol
          name
          decimals
          totalValueLockedUSD
          volumeUSD
          feesUSD
          txCount
          derivedETH
        }
      }
    `;
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get a list' implies a read-only operation, it doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format the TVL data is in (e.g., USD value, percentage). For a tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 immediately conveys the core functionality without unnecessary words. Every word earns its place, and there's no redundant information or structural issues.

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 the lack of annotations and output schema, the description should provide more context about what the tool returns (e.g., token symbols, TVL values, timestamps) and any behavioral constraints. As a data retrieval tool in a financial context, users need to understand the completeness and limitations of the TVL ranking data being provided.

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' clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline expectation when schema coverage is complete.

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 tokens by TVL on SailFish DEX'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_top_pools' or 'get_token_info', which would require more specific context about what distinguishes 'top tokens by TVL' from other token-related queries.

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. With sibling tools like 'get_token_info', 'get_token_balance', and 'get_top_pools', there's no indication of when this specific TVL-based ranking is appropriate versus other token data retrieval methods.

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