helius_get_token_accounts
Retrieve token accounts by mint or owner using the MCP Helius server. This tool enables querying Solana blockchain data for detailed token account information, supporting pagination and limits.
Instructions
Get token accounts by mint or owner
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| mint | No | ||
| owner | No | ||
| page | No |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"type": "number"
},
"mint": {
"type": "string"
},
"owner": {
"type": "string"
},
"page": {
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:453-460 (handler)The main handler function that executes the tool logic by calling the Helius SDK's rpc.getTokenAccounts method with the provided input parameters (mint, owner, page, limit).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)Defines the input schema and description for the 'helius_get_token_accounts' tool.{ 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/tools.ts:583-583 (registration)Maps the tool name 'helius_get_token_accounts' to its handler function in the handlers dictionary."helius_get_token_accounts": helius.getTokenAccountsHandler,