gateway_get_supported_chains
Retrieve a list of all supported blockchain chains to identify network compatibility and integration options with Tatum MCP Server.
Instructions
[gateway] Get a list of all supported blockchain chains
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/gateway.ts:118-121 (handler)The core handler function that returns the list of supported blockchain chains. It ensures the service data is loaded and returns a copy of the cached chain names.public async getSupportedChains(): Promise<string[]> { await this.ensureDataLoaded(); return [...this.cachedChains]; // Return a copy to prevent mutation }
- src/services/gateway.ts:8-16 (schema)The tool's schema definition, specifying name, description, and empty input schema (no parameters required).name: 'gateway_get_supported_chains', description: "Get a list of all supported blockchain networks available through Tatum's RPC gateways", inputSchema: { type: 'object', properties: {}, required: [] } }, {
- src/index.ts:78-80 (registration)Tool handler registration in the executeGatewayTool switch statement, dispatching to the GatewayService implementation.case 'gateway_get_supported_chains': return await this.gatewayService.getSupportedChains();
- src/index.ts:193-196 (registration)Registration of all gateway tools (including this one) in the MCP server's listTools response handler....GATEWAY_TOOLS.map(tool => ({ name: tool.name, description: `[gateway] ${tool.description}`, inputSchema: tool.inputSchema
- src/services/gateway.ts:74-105 (helper)Helper method that initializes the service by fetching blockchain data from Tatum API and populating the cachedChains used by the handler.public async initialize(): Promise<void> { if (this.dataFetched) { return; } try { console.error('Fetching blockchain data from Tatum API...'); const response = await fetch(this.BLOCKCHAINS_URL); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const externalBlockchains: ExternalBlockchain[] = await response.json(); // Transform external data to internal format this.cachedGateways = this.transformToGateways(externalBlockchains); this.cachedChains = this.extractChainNames(externalBlockchains); this.dataFetched = true; console.error(`Loaded ${this.cachedChains.length} networks from ${this.cachedGateways.length} blockchains`); } catch (error) { console.error('Failed to fetch blockchain data:', error instanceof Error ? error.message : 'Unknown error'); // Fallback to empty data this.cachedGateways = []; this.cachedChains = []; this.dataFetched = true; throw new Error(`Failed to initialize GatewayService: ${error instanceof Error ? error.message : 'Unknown error'}`); } }