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
| Name | Required | Description | Default |
|---|---|---|---|
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: [], }, },
- src/toolService.js:111-119 (handler)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;
- src/services/agService.js:77-95 (helper)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}`); } }
- src/constants.js:7-7 (helper)Constant definition for the tool name used throughout the codebase.GET_SUPPORTED_CHAINS: "get_supported_chains",