Skip to main content
Glama

hyperd.balance.get

Retrieve on-chain balance for any EVM wallet address across multiple chains (Base, Ethereum, Polygon, Arbitrum). Supports ERC-20 tokens by symbol or contract address. Use chain='all' for parallel multi-chain lookup.

Instructions

Get the on-chain balance for an EVM wallet address. Multi-chain (Base, Ethereum, Polygon, Arbitrum). Supports ERC-20 by symbol or contract address. Pass chain='all' for parallel multi-chain lookup. Costs $0.01 in USDC on Base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes0x EVM wallet address
tokenNoToken symbol (e.g., USDC, WETH) or contract address. Default USDC.
chainNoChain. Default 'base'. Use 'all' for parallel multi-chain.

Implementation Reference

  • src/server.ts:197-209 (registration)
    Registration of the 'hyperd.balance.get' tool via server.tool() — defines tool name, description, Zod input schema (address, optional token, optional chain), and handler.
    server.tool(
      "hyperd.balance.get",
      "Get the on-chain balance for an EVM wallet address. Multi-chain (Base, Ethereum, Polygon, Arbitrum). Supports ERC-20 by symbol or contract address. Pass chain='all' for parallel multi-chain lookup. Costs $0.01 in USDC on Base.",
      {
        address: z.string().describe("0x EVM wallet address"),
        token: z.string().optional().describe("Token symbol (e.g., USDC, WETH) or contract address. Default USDC."),
        chain: z
          .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb", "base-sepolia", "all"])
          .optional()
          .describe("Chain. Default 'base'. Use 'all' for parallel multi-chain."),
      },
      async (args) => asText(await paidGet("/api/balance", args)),
    );
  • Handler for 'hyperd.balance.get' — a thin inline lambda that calls paidGet('/api/balance', args) and formats the result as text.
      async (args) => asText(await paidGet("/api/balance", args)),
    );
  • Zod input schema for hyperd.balance.get: address (required string), token (optional string, default USDC), chain (optional enum: base, ethereum, polygon, arbitrum, optimism, avalanche, bnb, base-sepolia, all; default base).
    {
      address: z.string().describe("0x EVM wallet address"),
      token: z.string().optional().describe("Token symbol (e.g., USDC, WETH) or contract address. Default USDC."),
      chain: z
        .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb", "base-sepolia", "all"])
        .optional()
        .describe("Chain. Default 'base'. Use 'all' for parallel multi-chain."),
    },
  • paidGet helper function — constructs request URL with query params, delegates to paidRequest() which performs the x402 payment dance.
    async function paidGet(
      path: string,
      query: Record<string, string | number | boolean | undefined>,
    ): Promise<unknown> {
      if (!httpClient) {
        throw new Error(WALLET_NOT_CONFIGURED_MSG);
      }
    
      const url = new URL(`${API_BASE}${path}`);
      for (const [k, v] of Object.entries(query)) {
        if (v !== undefined && v !== "" && v !== null) url.searchParams.set(k, String(v));
      }
      return paidRequest("GET", url, undefined);
    }
  • asText helper — wraps response data into the MCP content format {content: [{type: 'text', text: ...}]}.
    function asText(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that this is a read operation (get), that it costs $0.01 in USDC on Base, and that it supports multiple chains and parallel lookup. This is strong behavioral context, though it could mention potential rate limits or error handling.

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?

Three concise sentences: purpose, scope, and special usage. Every sentence adds essential information. No redundant or filler content. Front-loaded with the core purpose.

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

Completeness4/5

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

Given no output schema, the description covers the main inputs and behavior. It lacks mention of the return format (e.g., raw amount vs. formatted) or error scenarios, but overall it provides enough context for an AI to use the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining that 'token' can be a symbol or contract address, and that 'chain' accepts 'all' for parallel lookup, which is not obvious from the enum alone. This gives agents practical guidance beyond the schema.

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

Purpose5/5

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

The description starts with a clear verb+resource combination: 'Get the on-chain balance for an EVM wallet address'. It immediately distinguishes from siblings by specifying EVM, multi-chain support, and ERC-20 token lookup, making the tool's purpose highly specific and unambiguous.

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

Usage Guidelines4/5

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

The description explicitly states when to use the tool (get balance) and notably explains the 'chain=all' parallel multi-chain option. However, it does not provide explicit when-not-to-use guidance or mention alternatives among siblings, though the usage context is clear.

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/hyperd-ai/hyperd-mcp'

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