sodax_get_supported_chains
Retrieve a list of blockchain networks supported for cross-chain swaps and DeFi operations through the SODAX platform.
Instructions
List all blockchain networks supported by SODAX for cross-chain swaps and DeFi operations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Response format: 'json' for raw data or 'markdown' for formatted text | markdown |
Implementation Reference
- src/tools/sodaxApi.ts:92-116 (handler)The MCP tool handler for sodax_get_supported_chains. This async function calls getSupportedChains() service and formats the response as JSON or Markdown based on the format parameter.server.tool( "sodax_get_supported_chains", "List all blockchain networks supported by SODAX for cross-chain swaps and DeFi operations", { format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, READ_ONLY, async ({ format }) => { try { const chains = await getSupportedChains(); return { content: [{ type: "text", text: formatResponse(chains, format) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }], isError: true }; } } );
- src/services/sodaxApi.ts:57-72 (handler)The core service function that fetches supported chains from the SODAX API endpoint /config/spoke/chains, with caching support.export async function getSupportedChains(): Promise<Chain[]> { const cacheKey = "chains"; const cached = getCached<Chain[]>(cacheKey); if (cached) return cached; try { const response = await apiClient.get("/config/spoke/chains"); // API returns array directly const chains = Array.isArray(response.data) ? response.data : (response.data?.data || []); setCache(cacheKey, chains); return chains; } catch (error) { console.error("Error fetching chains:", error); throw new Error("Failed to fetch supported chains from SODAX API"); } }
- src/tools/sodaxApi.ts:92-98 (schema)Zod schema definition for the tool's input parameters - optional format field that accepts 'json' or 'markdown' (defaults to markdown).server.tool( "sodax_get_supported_chains", "List all blockchain networks supported by SODAX for cross-chain swaps and DeFi operations", { format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") },
- src/types.ts:13-26 (schema)TypeScript interface Chain that defines the structure of blockchain network data returned by the API (id, name, chainId, nativeCurrency, etc.).export interface Chain { id: string; name: string; chainId: number; nativeCurrency: { name: string; symbol: string; decimals: number; }; rpcUrl?: string; explorerUrl?: string; iconUrl?: string; isTestnet?: boolean; }
- src/index.ts:42-42 (registration)Registration call where registerSodaxApiTools(server) is invoked to register all SODAX API tools including sodax_get_supported_chains with the MCP server.registerSodaxApiTools(server);