Skip to main content
Glama

get-nft-count

Query the number of NFTs held by a specific address on the Monad testnet. Provide the address and NFT contract to retrieve the count.

Instructions

查询 Monad 测试网地址持有的 NFT 数量

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes需要查询的 Monad 测试网地址
nftContractYesNFT 合约地址

Implementation Reference

  • Handler function that queries the NFT balance for a given address on the specified NFT contract using viem's readContract method on balanceOf.
        async ({ address, nftContract }) => {
            try {
                // 调用合约的 balanceOf 方法查询 NFT 数量
                const balance = await publicClient.readContract({
                    address: nftContract as `0x${string}`,
                    abi: [
                        {
                            inputs: [{ name: "owner", type: "address" }],
                            name: "balanceOf",
                            outputs: [{ name: "", type: "uint256" }],
                            stateMutability: "view",
                            type: "function"
                        }
                    ],
                    functionName: "balanceOf",
                    args: [address as `0x${string}`]
                });
    
                // 返回格式化的查询结果
                return {
                    content: [
                        {
                            type: "text",
                            text: `地址 ${address} 在合约 ${nftContract} 中持有的 NFT 数量为:${balance.toString()} 个`,
                        },
                    ],
                };
            } catch (error) {
                // 错误处理
                return {
                    content: [
                        {
                            type: "text",
                            text: `查询地址 ${address} 的 NFT 数量失败:${
                            error instanceof Error ? error.message : String(error)
                            }`,
                        },
                    ],
                };
            }
        }
    );
  • Input schema defined using Zod for the address and nftContract parameters.
    {
        address: z.string().describe("需要查询的 Monad 测试网地址"),
        nftContract: z.string().describe("NFT 合约地址")
    },
  • src/index.ts:27-27 (registration)
    MCP server capabilities list including the get-nft-count tool.
    capabilities: ["get-mon-balance", "get-nft-count"]
  • src/index.ts:74-78 (registration)
    Start of server.tool registration for get-nft-count tool with name and description.
    server.tool(
        // 功能标识符
        "get-nft-count",
        // 功能说明
        "查询 Monad 测试网地址持有的 NFT 数量",
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states what the tool does (query NFT count) without mentioning whether this is a read-only operation, if it requires authentication, rate limits, error conditions, or what format the response takes. For a tool with zero annotation coverage, this is insufficient behavioral context.

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 extremely concise - a single sentence that directly states the tool's function. There's no wasted language or unnecessary elaboration. It's appropriately sized for a simple query tool and gets straight to the point without any structural issues.

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 no annotations and no output schema, the description is incomplete for proper tool usage. While it states the basic purpose, it doesn't cover important contextual information like response format, error handling, network specifics (Monad testnet limitations), or how this differs from the sibling balance tool. For a blockchain query tool, more context would be helpful.

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?

Schema description coverage is 100%, so the input schema already fully documents both parameters (address and nftContract). The description doesn't add any additional parameter semantics beyond what's in the schema descriptions. It mentions both parameters implicitly through the function description but provides no extra details about format, validation, or usage patterns.

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 as '查询 Monad 测试网地址持有的 NFT 数量' (Query the NFT count held by a Monad testnet address). It specifies both the verb (query) and resource (NFT count), but doesn't differentiate from its sibling tool 'get-mon-balance' which presumably handles token balances rather than NFTs. The purpose is specific but lacks sibling distinction.

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 the sibling tool 'get-mon-balance' or any other potential tools for querying NFT-related data. There's no indication of prerequisites, constraints, or typical use cases beyond the basic function stated.

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/bble/monad-mcp'

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