Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_supported_chains

Retrieve available blockchain networks for decentralized finance trading operations, enabling AI agents to identify compatible platforms for market analysis and transaction execution.

Instructions

Get list of blockchain networks supported by Aggregator Protocol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_supported_chains tool. Delegates to AgService.getSupportedChains() and formats the response with message, data, and summary.
    async getSupportedChains() { const result = await this.agg.getSupportedChains(); return { message: "Supported chains retrieved successfully", data: result, summary: `Found ${result.chains?.length || 0} supported chains`, }; }
  • Tool schema definition in the ListToolsRequestHandler, including name, description, and input schema (no parameters required).
    name: TOOL_NAMES.GET_SUPPORTED_CHAINS, description: "Get list of blockchain networks supported by Aggregator Protocol", inputSchema: { type: "object", properties: {}, required: [], },
  • src/index.js:996-998 (registration)
    Tool registration in the CallToolRequestHandler switch statement, dispatching calls to ToolService.getSupportedChains().
    case TOOL_NAMES.GET_SUPPORTED_CHAINS: result = await toolService.getSupportedChains(); break;
  • Supporting function in AgService that performs the HTTP request to the Aggregator API (/api/swap/chains) to retrieve the list of supported chains.
    async getSupportedChains() { try { const response = await fetch(`${this.baseUrl}/api/swap/chains`); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'API request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get supported chains: ${error.message}`); } }
  • Constant definition for the tool name used in schema, registration, and dispatching.
    GET_SUPPORTED_CHAINS: "get_supported_chains",

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