Skip to main content
Glama
monad-vibe

Monad MCP Server

by monad-vibe

query-mon-nft

Retrieve detailed NFT information from the Monad testnet by providing the contract address and token ID, enabling seamless integration with AI models for blockchain interactions.

Instructions

Query NFT information on Monad testnet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractAddressYesNFT contract address
tokenIdYesToken ID of the NFT

Implementation Reference

  • Core execution logic of the 'query-mon-nft' tool. Queries ERC721 ownerOf and tokenURI using viem publicClient on Monad testnet, returns formatted text response or error.
    async ({ contractAddress, tokenId }) => {
        try {
            // Create contract instance
            const contract = {
                address: contractAddress as `0x${string}`,
                abi: ERC721_ABI,
            };
    
            // Get owner and token URI
            const [owner, tokenUri] = await Promise.all([
                publicClient.readContract({
                    ...contract,
                    functionName: 'ownerOf',
                    args: [BigInt(tokenId)],
                }),
                publicClient.readContract({
                    ...contract,
                    functionName: 'tokenURI',
                    args: [BigInt(tokenId)],
                }),
            ]);
    
            return {
                content: [
                    {
                        type: "text",
                        text: `NFT Information:\nContract: ${contractAddress}\nToken ID: ${tokenId}\nOwner: ${owner}\nToken URI: ${tokenUri}`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to query NFT information. Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
    }
  • Zod-based input schema for the tool parameters: contractAddress and tokenId.
    {
        contractAddress: z.string().describe("NFT contract address"),
        tokenId: z.string().describe("Token ID of the NFT"),
    },
  • Registers the 'query-mon-nft' tool with the MCP server, specifying name, description, input schema, and handler function.
    export function nftQueryProvider(server: McpServer) {
        server.tool(
            "query-mon-nft",
            "Query NFT information on Monad testnet",
            {
                contractAddress: z.string().describe("NFT contract address"),
                tokenId: z.string().describe("Token ID of the NFT"),
            },
            async ({ contractAddress, tokenId }) => {
                try {
                    // Create contract instance
                    const contract = {
                        address: contractAddress as `0x${string}`,
                        abi: ERC721_ABI,
                    };
    
                    // Get owner and token URI
                    const [owner, tokenUri] = await Promise.all([
                        publicClient.readContract({
                            ...contract,
                            functionName: 'ownerOf',
                            args: [BigInt(tokenId)],
                        }),
                        publicClient.readContract({
                            ...contract,
                            functionName: 'tokenURI',
                            args: [BigInt(tokenId)],
                        }),
                    ]);
    
                    return {
                        content: [
                            {
                                type: "text",
                                text: `NFT Information:\nContract: ${contractAddress}\nToken ID: ${tokenId}\nOwner: ${owner}\nToken URI: ${tokenUri}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Failed to query NFT information. Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );
    }
  • ERC721 ABI fragments required for the contract read operations in the handler.
    const ERC721_ABI = parseAbi([
        'function ownerOf(uint256 tokenId) external view returns (address)',
        'function tokenURI(uint256 tokenId) external view returns (string)',
    ]);
  • Wrapper provider function for NFT tools that calls the specific query provider to register the tool.
    export function nftProvider(server: McpServer) {
        nftQueryProvider(server);
    }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure but only states the action without details on permissions, rate limits, or response format. It doesn't mention if this is a read-only operation or potential side effects, which is inadequate for a tool with no annotation support.

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 with no wasted words, clearly front-loading the core purpose. It's appropriately sized for a simple query tool, making it easy for an agent to parse quickly.

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. It doesn't explain what information is returned (e.g., metadata, owner), how errors are handled, or any behavioral traits, leaving gaps for the agent to understand the tool's full 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 schema description coverage is 100%, so the input schema already documents both parameters thoroughly. The description doesn't add any extra meaning about the parameters beyond what the schema provides, meeting 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 ('Query') and resource ('NFT information on Monad testnet'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'get-mon-balance' or 'get-block-by-number' that also query blockchain data, 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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites, such as needing a contract address and token ID, or comparisons to other query tools in the sibling list, leaving the agent without usage direction.

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