Skip to main content
Glama

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
NameRequiredDescriptionDefault
networkNameYesName 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

  • 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)}], }; } );
  • 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)}], }; }
  • 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."), },
  • 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}`, }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/allthatjazzleo/mantrachain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server