Skip to main content
Glama

DeFi Trading Agent MCP Server

by edkdev

get_new_pools

Discover and monitor the latest DeFi pools across multiple networks using defined attributes like base token, quote token, and DEX. Ideal for real-time crypto trading insights and strategy optimization.

Instructions

Get latest new pools across all networks

Input Schema

NameRequiredDescriptionDefault
includeNoAttributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated)
pageNoPage number for pagination (optional, default: 1)

Input Schema (JSON Schema)

{ "properties": { "include": { "description": "Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated)", "type": "string" }, "page": { "description": "Page number for pagination (optional, default: 1)", "type": "integer" } }, "required": [], "type": "object" }

Implementation Reference

  • Core handler function that executes the tool logic by fetching new pools data from the CoinGecko/GeckoTerminal API endpoint `/networks/new_pools` with optional parameters for include and page.
    async getNewPools(options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); const url = `${this.baseUrl}/networks/new_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 get new pools: ${error.message}`); } }
  • Helper wrapper in ToolService that delegates to CoinGeckoApiService.getNewPools and formats the response with standardized message, data, and summary fields.
    async getNewPools(options = {}) { const result = await this.coinGeckoApi.getNewPools(options); return { message: "New pools retrieved successfully", data: result, summary: `Found ${ result.data?.length || 0 } new pools across all networks`, }; }
  • src/index.js:1057-1062 (registration)
    Registration and dispatch handler in the MCP server's CallToolRequestSchema that routes calls to toolService.getNewPools with parsed input arguments.
    case TOOL_NAMES.GET_NEW_POOLS: result = await toolService.getNewPools({ include: args.include, page: args.page, }); break;
  • Input schema definition for the get_new_pools tool registered in the MCP server's ListToolsRequestSchema, specifying optional 'include' and 'page' parameters with descriptions.
    name: TOOL_NAMES.GET_NEW_POOLS, description: "Get latest new pools across all networks", inputSchema: { type: "object", properties: { include: { type: "string", description: "Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated)", }, page: { type: "integer", description: "Page number for pagination (optional, default: 1)", }, }, required: [], },
  • Constant definition mapping the tool name symbol to its string identifier used throughout the codebase.
    GET_NEW_POOLS: "get_new_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