Skip to main content
Glama

get-native-currency-balance

Retrieve the native cryptocurrency balance for any blockchain address. This tool queries on-chain data to display current holdings without requiring private keys.

Instructions

Get the native currency balance of an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes

Implementation Reference

  • The handler function that executes the tool: casts address, calls wagmi's getBalance with wagmiConfig and address, stringifies the result with JSONStringify, and returns it as text content.
    execute: async (args) => {
      const address = args.address as Address
      const result = await getBalance(wagmiConfig, { address })
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      }
    },
  • Zod input schema requiring a single 'address' string parameter.
    parameters: z.object({
      address: z.string()
    }),
  • Registers the 'get-native-currency-balance' tool on the FastMCP server within registerGetBalanceTools function.
    server.addTool({
      name: "get-native-currency-balance",
      description: "Get the native currency balance of an address",
      parameters: z.object({
        address: z.string()
      }),
      execute: async (args) => {
        const address = args.address as Address
        const result = await getBalance(wagmiConfig, { address })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        }
      },
    });
  • Top-level call to registerGetBalanceTools during server initialization, which includes the get-native-currency-balance tool.
    registerGetBalanceTools(server);
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 the tool retrieves balance information, implying a read-only operation, but doesn't specify if it requires network connectivity, has rate limits, returns data in a specific format (e.g., wei or ether), or handles errors. This leaves significant gaps in understanding how the tool behaves in practice.

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, direct sentence with no unnecessary words, making it highly concise and front-loaded. Every word contributes to understanding the tool's purpose efficiently.

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's complexity (a blockchain balance query with no output schema and no annotations), the description is incomplete. It doesn't explain what the output looks like (e.g., numeric balance, currency unit), error conditions, or dependencies like network state. This makes it inadequate for an AI agent to use the tool effectively without additional context.

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 input schema has one parameter ('address') with 0% description coverage, meaning the schema provides no semantic details. The description adds minimal context by implying the address is for retrieving a balance, but doesn't clarify format (e.g., Ethereum address starting with '0x'), validation, or examples. This meets the baseline of 3 as it compensates slightly for the low schema coverage.

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 action ('Get') and resource ('native currency balance of an address'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get-account' or 'get-token-balance', which might also retrieve balance information but for different resources or currencies.

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 is provided on when to use this tool versus alternatives like 'get-token-balance' for non-native currencies or 'get-account' for broader account information. The description lacks context about prerequisites, such as needing a valid blockchain address, or exclusions.

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/Xiawpohr/mcpilot'

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