helius_get_token_accounts
Retrieve token account information on Solana blockchain by specifying either a mint address or owner address to identify associated token holdings.
Instructions
Get token accounts by mint or owner
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mint | No | ||
| owner | No | ||
| page | No | ||
| limit | No |
Implementation Reference
- src/handlers/helius.ts:453-460 (handler)The main handler function implementing the logic for the 'helius_get_token_accounts' tool. It calls the Helius RPC method getTokenAccounts with the provided input parameters.export const getTokenAccountsHandler = async (input: { mint?: string, owner?: string, page?: number, limit?: number }): Promise<ToolResultSchema> => { try { const accounts = await (helius as any as Helius).rpc.getTokenAccounts(input); return createSuccessResponse(`Token accounts: ${JSON.stringify(accounts, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting token accounts: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:436-448 (schema)Input schema definition for the 'helius_get_token_accounts' tool, defining the expected input parameters.{ name: 'helius_get_token_accounts', description: 'Get token accounts by mint or owner', inputSchema: { type: 'object', properties: { mint: { type: 'string' }, owner: { type: 'string' }, page: { type: 'number' }, limit: { type: 'number' } } } },
- src/handlers/helius.types.ts:238-243 (schema)TypeScript type definition for the input of 'helius_get_token_accounts' handler.export type GetTokenAccountsInput = { mint?: string; owner?: string; page?: number; limit?: number; }
- src/tools.ts:583-583 (registration)Registration of the 'helius_get_token_accounts' tool handler in the handlers dictionary."helius_get_token_accounts": helius.getTokenAccountsHandler,