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",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the search functionality without mentioning whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior (implied by the 'page' parameter but not explained), error conditions, or what the output format looks like. For a search tool with zero annotation coverage, this is insufficient.

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 unnecessary words. It's appropriately sized for a search tool and front-loaded with the core functionality.

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 complexity (search operation with 4 parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (pool data structure), how results are ordered, pagination details, or error handling. For a tool that likely returns structured data, this leaves significant gaps for the agent.

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%, so the schema already fully documents all four parameters. The description mentions the 'query' parameter's semantics (search by pool address, token address, or token symbol), which adds some context beyond the schema's generic description. However, it doesn't provide additional details about parameter interactions, examples, or constraints beyond what's in the schema.

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 tool's purpose: 'Search for pools by query (pool address, token address, or token symbol)'. It specifies the verb ('search'), resource ('pools'), and search criteria. However, it doesn't explicitly differentiate from sibling tools like 'get_top_pools_by_dex' or 'get_trending_pools', which also retrieve pool information but with different selection criteria.

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. It doesn't mention sibling tools like 'get_multiple_pools_data' or 'get_top_pools_by_dex', nor does it specify use cases, prerequisites, or exclusions. The agent must infer usage from the name and description alone.

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

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