get_supported_chains
Retrieve all blockchain networks available for cross-chain swaps through deBridge, including chain IDs and names for route planning.
Instructions
List all blockchain networks supported by deBridge for cross-chain swaps. Returns chain IDs and names.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-supported-chains.ts:4-23 (handler)The registerGetSupportedChains function that registers the 'get_supported_chains' tool with the MCP server. It includes the tool handler that calls tokenDb.getChains() and returns the chains as JSON.
export function registerGetSupportedChains(server: McpServer, tokenDb: TokenDb) { server.registerTool( "get_supported_chains", { description: "List all blockchain networks supported by deBridge for cross-chain swaps. Returns chain IDs and names.", }, async () => { const chains = tokenDb.getChains(); return { content: [ { type: "text" as const, text: JSON.stringify(chains), }, ], }; }, ); } - src/lib/token-db.ts:71-73 (helper)The getChains method in TokenDb class that retrieves and sorts all supported blockchain chains by name.
getChains(): ChainInfo[] { return [...this.chains].sort((a, b) => a.chainNames[0].localeCompare(b.chainNames[0])); } - src/types.ts:11-21 (schema)The ChainInfo interface that defines the structure of chain data returned by get_supported_chains, including chainId, debridgeSubscriptionId, and chainNames.
export interface ChainInfo { /** Real blockchain chain ID. */ chainId: string; /** * Synthetic deBridge-local ID used to avoid chainId overlaps across * different networks. Only present when it differs from chainId. * This is the identifier deBridge API calls expect as "chainId". */ debridgeSubscriptionId?: string; chainNames: string[]; } - src/server.ts:37-37 (registration)The registration call in createServer where registerGetSupportedChains is invoked to add the tool to the MCP server.
registerGetSupportedChains(server, tokenDb);