Skip to main content
Glama

helius_get_token_accounts

Retrieve token accounts by mint or owner. Provide mint address or owner public key, with optional page and limit for paginated results.

Instructions

Get token accounts by mint or owner

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mintNo
ownerNo
pageNo
limitNo

Implementation Reference

  • The actual handler function `getTokenAccountsHandler` that executes the tool logic. It calls `helius.rpc.getTokenAccounts(input)` with mint, owner, page, and limit 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)}`);
      }
    }
  • The `GetTokenAccountsInput` type definition for the tool's input schema (mint, owner, page, limit).
    export type GetTokenAccountsInput = {
      mint?: string;
      owner?: string;
      page?: number;
      limit?: number;
    }
  • src/tools.ts:436-448 (registration)
    Tool registration in the `tools` array with name 'helius_get_token_accounts', description 'Get token accounts by mint or owner', and inputSchema.
    {
      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)
    Handler mapping in the `handlers` object: 'helius_get_token_accounts' maps to `helius.getTokenAccountsHandler`.
    "helius_get_token_accounts": helius.getTokenAccountsHandler,
  • Mock implementation of `getTokenAccounts` in `MockHeliusClient` for testing purposes.
    getTokenAccounts: async (params: { mint?: string, owner?: string, page?: number, limit?: number }) => {
      const limit = params.limit || 10;
      return {
        total: 100,
        limit,
        page: params.page || 1,
        items: Array(limit).fill(0).map((_, i) => ({
          address: `MockTokenAccount${i}`,
          mint: params.mint || `MockMint${i}`,
          owner: params.owner || `MockOwner${i}`,
          amount: 1000000000 + i,
          delegateOption: 0,
          delegate: null,
          state: "initialized",
          isNative: false,
          rentExemptReserve: null,
          closeAuthority: null
        }))
      };
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations present, and the description only states the action. It does not disclose pagination behavior (page/limit), outcome when both mint and owner are provided, or any safety aspects. For a tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase, which is concise but under-specified for a 4-parameter tool. It omits necessary details, making it not appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters, no annotations, and no output schema, the description is far from complete. It fails to explain pagination, parameter interactions, or return format, leaving critical gaps for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description explains mint and owner ('by mint or owner') but ignores page and limit parameters, leaving their purpose and relationship unclear. This provides only partial semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get token accounts by mint or owner' clearly states the action (get) and resource (token accounts) with filtering scope. However, it does not explicitly distinguish from sibling tools like helius_get_token_accounts_by_owner, which is more specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this tool versus alternatives. With multiple sibling tools for token accounts, the lack of usage context leaves the agent to infer without support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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