get-account-info
Retrieve current account details, including balances and staking information, by specifying the network name in the MantraChain MCP Server. Essential for managing blockchain operations and monitoring assets.
Instructions
Get current account information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| networkName | Yes | Name of the network to use - must first check what networks are available through the mantrachain-mcp server by accessing the networks resource `networks://all` before you pass this arguments |
Implementation Reference
- src/tools/network.ts:9-24 (registration)MCP tool registration for 'get-account-info', including input schema validation for networkName and inline handler function that initializes the client and returns account info.server.tool( "get-account-info", "Get current account information", { networkName: z.string().refine(val => Object.keys(networks).includes(val), { message: "Must be a valid network name" }).describe("Name of the network to use - must first check what networks are available by accessing the networks resource `networks://all` before you pass this arguments. Defaults to `mantra-dukong-1` testnet."), }, async ({ networkName }) => { await mantraClient.initialize(networkName); const currentAddressInfo = await mantraClient.getCurrentAddressInfo(); return { content: [{type: "text", text: JSON.stringify(currentAddressInfo)}], }; } );
- src/tools/network.ts:18-23 (handler)Inline handler executing the tool: initializes MantraClient and fetches current address information via getCurrentAddressInfo().await mantraClient.initialize(networkName); const currentAddressInfo = await mantraClient.getCurrentAddressInfo(); return { content: [{type: "text", text: JSON.stringify(currentAddressInfo)}], }; }
- src/tools/network.ts:12-16 (schema)Input schema using Zod: networkName must be valid network from config.{ networkName: z.string().refine(val => Object.keys(networks).includes(val), { message: "Must be a valid network name" }).describe("Name of the network to use - must first check what networks are available by accessing the networks resource `networks://all` before you pass this arguments. Defaults to `mantra-dukong-1` testnet."), },
- src/services/network-service.ts:7-13 (helper)Core helper function in NetworkService that constructs and returns the current account information object with address, network details, and explorer link.async getCurrentAddressInfo() { return { address: this.address, network: this.network, explorerUrl: `${this.network.explorerUrl}/address/${this.address}`, }; }