Skip to main content
Glama

get_token_holders

Retrieve token holder addresses for a specific blockchain token to analyze distribution and ownership patterns.

Instructions

Get the token holders for a given token address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYesThe chain ID
token_addressYesThe address of the token

Implementation Reference

  • The handler function that implements the core logic of the 'get_token_holders' tool by querying the Etherscan API for the top 10 token holders and formatting the response.
    async function handleGetTokenHolders(req: any, apiKey: string) {
        const chainId = req.params.arguments.chain_id;
        const tokenAddress = req.params.arguments.token_address;
    
        try {
            const response = await axios.get(
                `https://api.etherscan.io/v2/api?chainid=${chainId}&module=token&action=tokenholderlist&contractaddress=${tokenAddress}&page=1&offset=10&apikey=${apiKey}`
            );
    
            if (response.data.status === "1") {
                const tokenHolders = response.data.result.map((holder: any) => {
                    return `${holder.TokenHolderAddress}: ${holder.TokenHolderQuantity}`;
                }).join("\n");
    
                return {
                    content: [
                        {
                            type: "text",
                            text: `Token holders for token ${tokenAddress} on chain ${chainId}: ${tokenHolders}`,
                        },
                    ],
                };
            } else {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to get token holders: ${response.data.message}`,
                        },
                    ],
                };
            }
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to get token holders: ${error}`,
                    },
                ],
            };
        }
    }
  • The ToolDefinition object defining the schema, name, description, and input parameters for the 'get_token_holders' tool.
    const getTokenHolders: ToolDefinition = {
        name: "get_token_holders",
        description: "Get the token holders for a given token address",
        inputSchema: {
            type: "object",
            properties: {
                chain_id: {
                    type: "integer",
                    description: "The chain ID",
                },
                token_address: {
                    type: "string",
                    description: "The address of the token",
                },
            },
            required: ["chain_id", "token_address"],
        },
    };
  • index.ts:487-488 (registration)
    The switch case in the main tool handler that routes calls to 'get_token_holders' to its specific handler function.
    case getTokenHolders.name:
        return await handleGetTokenHolders(req, apiKey);
  • index.ts:221-222 (registration)
    Registration of the tool definition in the toolDefinitions map used by the MCP server.
    [getTokenHolders.name]: getTokenHolders,
    [getTokenHoldersCount.name]: getTokenHoldersCount
  • index.ts:509-511 (registration)
    The server capabilities section that registers all tool definitions, including 'get_token_holders', for the MCP protocol.
    capabilities: {
        tools: toolDefinitions,
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions, rate limits, pagination, or return format (e.g., list of holders with balances). This is inadequate for a tool that likely returns sensitive or complex data.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of token holder data, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'token holders' means (e.g., addresses with balances), how results are structured, or any limitations, leaving significant gaps for the agent to handle.

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

Parameters3/5

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

The schema description coverage is 100%, so the schema already documents both parameters ('chain_id' and 'token_address'). The description adds minimal value by mentioning 'token address' but doesn't provide additional context like format examples or constraints beyond the schema.

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 clearly states the tool's purpose with a specific verb ('Get') and resource ('token holders'), and identifies the key input ('token address'). However, it doesn't differentiate from sibling tools like 'get_token_holders_count' or 'get_token_balance', which reduces clarity about its unique function.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_token_holders_count' for counts or 'get_token_balance' for individual balances, leaving the agent to infer usage context without explicit direction.

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/septemhill/etherscan-mcp'

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