Skip to main content
Glama

DeFi Trading Agent MCP Server

by edkdev

get_supported_chains

Retrieve a list of blockchain networks supported by the Aggregator Protocol, enabling users to identify available chains for decentralized finance (DeFi) trading and integration with the DeFi Trading Agent MCP Server.

Instructions

Get list of blockchain networks supported by Aggregator Protocol

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • src/index.js:171-180 (registration)
    Tool registration including name, description, and input schema (no parameters required). This is returned by ListToolsRequestHandler.
    { name: TOOL_NAMES.GET_SUPPORTED_CHAINS, description: "Get list of blockchain networks supported by Aggregator Protocol", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Primary handler function executed by MCP server for get_supported_chains tool. Delegates to AgService and formats 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`, }; }
  • src/index.js:996-998 (registration)
    Dispatch/execution registration in CallToolRequestHandler switch statement, calling the toolService handler.
    case TOOL_NAMES.GET_SUPPORTED_CHAINS: result = await toolService.getSupportedChains(); break;
  • Supporting utility in AgService that makes the actual API call to retrieve supported chains from the aggregator endpoint /api/swap/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 throughout the codebase.
    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