Skip to main content
Glama

get-native-currency-balance

Retrieve the native cryptocurrency balance for any blockchain address using MetaMask's secure wallet integration.

Instructions

Get the native currency balance of an address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesAddress to get balance for.

Implementation Reference

  • The tool handler function that fetches the native currency balance using wagmi's getBalance and returns the result as a JSON-stringified text content block.
    execute: async (args) => {
      const result = await getBalance(wagmiConfig, args);
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      };
    },
  • Input schema defining the 'address' parameter as an Address type.
    parameters: z.object({
      address: Address.describe("Address to get balance for."),
    }),
  • Tool registration via server.addTool call within the registerGetBalanceTools function.
    server.addTool({
      name: "get-native-currency-balance",
      description: "Get the native currency balance of an address.",
      parameters: z.object({
        address: Address.describe("Address to get balance for."),
      }),
      execute: async (args) => {
        const result = await getBalance(wagmiConfig, args);
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        };
      },
    });
  • Higher-level registration call to registerGetBalanceTools during overall tool setup.
    registerGetBalanceTools(server, wagmiConfig);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets' data, implying a read-only operation, but doesn't mention potential side effects, rate limits, authentication needs, or what happens with invalid addresses. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 any wasted words. It is appropriately sized and front-loaded, making it easy to grasp immediately.

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 blockchain operations, no annotations, and no output schema, the description is incomplete. It doesn't explain what the balance return value includes (e.g., units, decimals), error handling, or network context, which are crucial for effective use in this domain.

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%, with the single parameter 'address' documented in the schema as 'Address to get balance for.' The description adds no additional meaning beyond this, such as format examples or constraints, but the schema provides adequate baseline information.

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

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 such as 'get-token-balance' for non-native currencies or 'get-account' for broader account info. The description lacks context about prerequisites, exclusions, or specific use cases.

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/metamask-mcp'

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