Skip to main content
Glama

get_account_info

Retrieve Algorand account details such as balance and asset holdings by providing the account address.

Instructions

Get account information including balance and assets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesAlgorand account address

Implementation Reference

  • MCP tool handler for 'get_account_info': parses arguments using Zod schema, calls algorandService.getAccountInfo, formats and returns the response.
    case 'get_account_info': { const parsed = GetAccountInfoArgsSchema.parse(args); try { const accountInfo = await algorandService.getAccountInfo(parsed.address); return { content: [ { type: 'text', text: `Account Information for ${parsed.address}:\n` + `Balance: ${Number(accountInfo.balance) / 1000000} ALGO\n` + `Minimum Balance: ${Number(accountInfo.minBalance) / 1000000} ALGO\n` + `Status: ${accountInfo.status}\n` + `Assets: ${accountInfo.assets.length}\n` + `Created Apps: ${accountInfo.createdApps.length}\n` + `Created Assets: ${accountInfo.createdAssets.length}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting account info: ${error}`, }, ], isError: true, }; } }
  • Zod schema defining input validation for the tool: requires 'address' as string.
    const GetAccountInfoArgsSchema = z.object({ address: z.string(), });
  • src/index.ts:165-178 (registration)
    Tool registration in TOOLS array: defines name, description, and JSON input schema for MCP server.
    { name: 'get_account_info', description: 'Get account information including balance and assets', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Algorand account address', }, }, required: ['address'], }, },
  • Core implementation in AlgorandService: fetches account details from Algorand node via algodClient and formats the response.
    async getAccountInfo(address: string) { try { const accountInfo = await this.algodClient.accountInformation(address).do(); return { address: accountInfo.address, balance: accountInfo.amount, minBalance: accountInfo.minBalance, status: accountInfo.status, assets: accountInfo.assets || [], appsLocalState: accountInfo.appsLocalState || [], createdApps: accountInfo.createdApps || [], createdAssets: accountInfo.createdAssets || [] }; } catch (error) { throw new Error(`Failed to get account info: ${error}`); } }

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/Jake-loranger/algorand-mcp-server'

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