Skip to main content
Glama
monad-vibe

Monad MCP Server

by monad-vibe

get-mon-balance

Retrieve the MON token balance for a specified address on the Monad testnet using the Model Context Protocol server. Check token holdings with a simple address input.

Instructions

Get MON balance for an address on Monad testnet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesMonad testnet address to check balance for

Implementation Reference

  • The handler function that implements the core logic of the 'get-mon-balance' tool. It queries the MON balance for the given address on the Monad testnet using viem's publicClient, formats the result using formatUnits with 18 decimals, and returns a formatted text response or error message.
    async ({ address }) => {
        try {
            const balance = await publicClient.getBalance({
                address: address as `0x${string}`,
            });
            return {
                content: [
                    {
                        type: "text",
                        text: `Balance for ${address}: ${formatUnits(balance, 18)} MON`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to retrieve balance for address: ${address}. Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
  • The input schema for the 'get-mon-balance' tool, defined using Zod. Requires a single 'address' parameter as a string describing the Monad testnet address.
    {
        address: z.string().describe("Monad testnet address to check balance for"),
    },
  • The balanceProvider function that registers the 'get-mon-balance' tool with the MCP server using server.tool(), including the tool name, description, input schema, and handler function.
    export function balanceProvider(server: McpServer) {
        server.tool(
            "get-mon-balance",
            "Get MON balance for an address on Monad testnet",
            {
                address: z.string().describe("Monad testnet address to check balance for"),
            },
            async ({ address }) => {
                try {
                    const balance = await publicClient.getBalance({
                        address: address as `0x${string}`,
                    });
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Balance for ${address}: ${formatUnits(balance, 18)} MON`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Failed to retrieve balance for address: ${address}. Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );
  • Within walletProvider, calls balanceProvider to register the get-mon-balance tool as part of wallet tools.
    balanceProvider(server);
    sendMonProvider(server);
  • src/index.ts:24-24 (registration)
    In the main server initialization, calls walletProvider(server) which chains to registering get-mon-balance.
    walletProvider(server);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but lacks critical behavioral details: it doesn't specify if this is a read-only operation, mention rate limits, error conditions, or what format the balance returns (e.g., in wei or MON tokens).

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. However, it could be slightly more structured by explicitly stating it's a read operation or including key constraints, which would enhance clarity without sacrificing brevity.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but omits behavioral context (e.g., read-only nature, return format) that would help an agent use it correctly, especially with no annotations to fill gaps.

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' well-documented in the schema as 'Monad testnet address to check balance for'. The description adds no additional parameter semantics beyond this, so it meets the baseline for high 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 MON balance') and resource ('for an address on Monad testnet'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-block-by-number' or 'query-mon-nft', which prevents a perfect score.

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 prerequisites (e.g., needing a valid testnet address) or compare it to sibling tools like 'send-mon-transaction' for balance changes, leaving usage context unclear.

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

Related 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/monad-vibe/monad-mcp-server'

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