network_get_network
Retrieve the current network details for the MCP Crypto Wallet EVM, providing essential blockchain information for wallet management and transactions.
Instructions
Get the current network information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/wallet.ts:711-727 (handler)The main handler function for 'network_get_network'. It retrieves the current provider and calls provider.getNetwork() to fetch network details like name, chain ID, and ENS address, formatting the response.
export const getNetworkHandler = async (input: any): Promise<ToolResultSchema> => { try { const provider = getProvider(); if (!provider) { return createErrorResponse("Provider is required to get network information, please set the provider URL"); } const network = await provider.getNetwork(); return createSuccessResponse(`Network information retrieved successfully Network name: ${network.name} Chain ID: ${network.chainId} ENS address: ${network.ensAddress} `); } catch (error) { return createErrorResponse(`Failed to get network information: ${(error as Error).message}`); } }; - src/tools.ts:525-533 (schema)The tool schema definition in the tools array, specifying name, description, and empty input schema (no parameters required).
{ name: "network_get_network", description: "Get the current network information", inputSchema: { type: "object", properties: {}, required: [] } }, - src/tools.ts:602-602 (registration)Registration of the tool handler in the handlers dictionary, mapping 'network_get_network' to getNetworkHandler.
"network_get_network": getNetworkHandler,