get_network_mode
Retrieve the current network mode from the Neo N3 MCP Server to determine its operational environment for blockchain interactions, wallet management, and smart contract execution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:168-198 (handler)Primary implementation of the 'get_network_mode' tool using the modern McpServer.tool API. Computes and returns the current network mode, available networks, and default network as structured JSON text content.this.server.tool( 'get_network_mode', {}, async () => { const availableNetworks = []; if (config.networkMode === NetworkMode.MAINNET_ONLY || config.networkMode === NetworkMode.BOTH) { availableNetworks.push(NeoNetwork.MAINNET); } if (config.networkMode === NetworkMode.TESTNET_ONLY || config.networkMode === NetworkMode.BOTH) { availableNetworks.push(NeoNetwork.TESTNET); } const result = { mode: config.networkMode, availableNetworks, defaultNetwork: config.networkMode === NetworkMode.TESTNET_ONLY ? NeoNetwork.TESTNET : NeoNetwork.MAINNET }; return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } );
- src/index.ts:170-170 (schema)Input schema for 'get_network_mode' tool: empty object (no parameters required).{},
- src/handlers/tool-handler.ts:14-16 (handler)Alternative handler function 'handleGetNetworkMode' returning just the networkMode from config (possibly for low-level MCP handler setup, unused in main server).async function handleGetNetworkMode(): Promise<any> { return createSuccessResponse({ networkMode: config.networkMode }); }
- src/handlers/tool-handler.ts:251-252 (registration)Switch case registration dispatching to handleGetNetworkMode in callTool router (low-level implementation, unused in main server).case 'get_network_mode': return await handleGetNetworkMode();
- src/handlers/tool-handler.ts:340-342 (schema)Tool schema definition in tools array for low-level setupToolHandlers (unused in main server).name: 'get_network_mode', description: 'Get the currently configured network mode (mainnet_only, testnet_only, both)', inputSchema: { type: 'object', properties: {} },