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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/toolService.js:111-119 (handler)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`, }; }
- src/index.js:172-179 (schema)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;
- src/services/agService.js:77-95 (helper)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}`); } }
- src/constants.js:7-7 (helper)Constant definition for the tool name used in schema, registration, and dispatching.GET_SUPPORTED_CHAINS: "get_supported_chains",