Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

search_pools

Find DeFi liquidity pools by searching with pool addresses, token addresses, or token symbols across multiple blockchain networks.

Instructions

Search for pools by query (pool address, token address, or token symbol)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (pool address, token address, or token symbol)
networkNoNetwork ID to search on (optional, e.g., 'eth', 'bsc', 'polygon_pos')
includeNoAttributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)
pageNoPage number for pagination (optional, default: 1)

Implementation Reference

  • MCP tool schema definition for 'search_pools' including input schema with required 'query' parameter
    { name: TOOL_NAMES.SEARCH_POOLS, description: "Search for pools by query (pool address, token address, or token symbol)", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (pool address, token address, or token symbol)", }, network: { type: "string", description: "Network ID to search on (optional, e.g., 'eth', 'bsc', 'polygon_pos')", }, include: { type: "string", description: "Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated)", }, page: { type: "integer", description: "Page number for pagination (optional, default: 1)", }, }, required: ["query"], },
  • src/index.js:1064-1070 (registration)
    Tool dispatcher registration in MCP CallToolRequestHandler switch statement, calling toolService.searchPools
    case TOOL_NAMES.SEARCH_POOLS: result = await toolService.searchPools(args.query, { network: args.network, include: args.include, page: args.page, }); break;
  • Main handler function for search_pools tool that validates input, delegates to CoinGecko API service, and formats response
    async searchPools(query, options = {}) { if (!query) { throw new Error("query is required"); } const result = await this.coinGeckoApi.searchPools(query, options); return { message: `Pool search for "${query}" completed successfully`, data: result, summary: `Found ${result.data?.length || 0} pools matching "${query}"${ options.network ? ` on ${options.network}` : "" }`, }; }
  • Core implementation that makes HTTP request to CoinGecko /onchain/search/pools endpoint
    async searchPools(query, options = {}) { try { const queryParams = new URLSearchParams(); if (query) queryParams.append('query', query); if (options.network) queryParams.append('network', options.network); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); const url = `${this.baseUrl}/search/pools${queryParams.toString() ? '?' + queryParams.toString() : ''}`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to search pools: ${error.message}`); } }
  • src/constants.js:27-27 (registration)
    TOOL_NAMES constant defining the tool name 'search_pools' used in schema and dispatcher
    SEARCH_POOLS: "search_pools",

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/edkdev/defi-trading-mcp'

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