Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

search_pools

Find DeFi pools by searching with a pool address, token address, or token symbol. Specify network, attributes, and pagination for precise results on supported blockchains.

Instructions

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

Input Schema

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

Implementation Reference

  • MCP tool schema definition including input schema, description, and name for search_pools
    { 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 execution handler dispatch in MCP callToolRequest that routes search_pools calls to toolService
    case TOOL_NAMES.SEARCH_POOLS: result = await toolService.searchPools(args.query, { network: args.network, include: args.include, page: args.page, }); break;
  • Primary handler function in ToolService that validates input, calls CoinGecko API, and formats response for search_pools tool
    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}` : "" }`, }; }
  • Supporting utility in CoinGeckoApiService that performs the actual HTTP API call to CoinGecko's 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)
    Constant definition for the tool name used in registration and dispatch
    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