Skip to main content
Glama

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

NameRequiredDescriptionDefault
limitNo
mintNo
ownerNo
pageNo

Input Schema (JSON Schema)

{ "properties": { "limit": { "type": "number" }, "mint": { "type": "string" }, "owner": { "type": "string" }, "page": { "type": "number" } }, "type": "object" }

Implementation Reference

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

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/dcSpark/mcp-server-helius'

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