get_account_info
Retrieve detailed account information from the Solana blockchain by providing an account address. This tool enables users to access account data for wallet management and blockchain interactions.
Instructions
Get detailed account information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Account address |
Implementation Reference
- src/index.ts:750-773 (handler)The handler function `handleGetAccountInfo` that implements the core logic: ensures Solana connection, parses address to PublicKey, fetches account info via `connection.getAccountInfo`, and returns formatted details or existence status.async function handleGetAccountInfo(args: any) { const { address } = args; ensureConnection(); const pubkey = new PublicKey(address); const accountInfo = await connection.getAccountInfo(pubkey); if (!accountInfo) { return { address, exists: false }; } return { address, exists: true, lamports: accountInfo.lamports, owner: accountInfo.owner.toString(), executable: accountInfo.executable, rentEpoch: accountInfo.rentEpoch, dataLength: accountInfo.data.length }; }
- src/index.ts:215-224 (schema)Input schema definition for the tool, specifying an object with required 'address' property of type string.inputSchema: { type: "object", properties: { address: { type: "string", description: "Account address" } }, required: ["address"] }
- src/index.ts:212-224 (registration)Tool registration entry in the `tools` array provided to `listTools` handler, including name, description, and input schema.{ name: "get_account_info", description: "Get detailed account information", inputSchema: { type: "object", properties: { address: { type: "string", description: "Account address" } }, required: ["address"] }
- src/index.ts:1309-1311 (registration)Handler dispatch/registration in the switch statement of the `CallToolRequestSchema` handler, mapping tool name to `handleGetAccountInfo` execution.case "get_account_info": result = await handleGetAccountInfo(args); break;