Skip to main content
Glama

get_nft_info

Retrieve detailed data for any ERC721 NFT, including collection name, symbol, token URI, and owner, across 30+ Ethereum-compatible networks using the EVM MCP Server.

Instructions

Get detailed information about a specific NFT (ERC721 token), including collection name, symbol, token URI, and current owner if available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Most NFTs are on Ethereum mainnet, which is the default.
tokenAddressYesThe contract address of the NFT collection (e.g., '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' for Bored Ape Yacht Club)
tokenIdYesThe ID of the specific NFT token to query (e.g., '1234')

Implementation Reference

  • Tool registration for 'get_nft_info' including input schema, annotations, and thin handler that calls the core service function.
    server.registerTool(
      "get_nft_info",
      {
        description: "Get information about an ERC721 NFT including metadata URI",
        inputSchema: {
          contractAddress: z.string().describe("The NFT contract address"),
          tokenId: z.string().describe("The NFT token ID"),
          network: z.string().optional().describe("Network name or chain ID. Defaults to Ethereum mainnet.")
        },
        annotations: {
          title: "Get NFT Info",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true
        }
      },
      async ({ contractAddress, tokenId, network = "ethereum" }) => {
        try {
          const nftInfo = await services.getERC721TokenMetadata(contractAddress as Address, BigInt(tokenId), network);
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                network,
                contract: contractAddress,
                tokenId,
                ...nftInfo
              }, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error fetching NFT info: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true
          };
        }
      }
    );
  • Core handler function that fetches ERC721 NFT metadata (name, symbol, tokenURI) using viem contract reads.
    export async function getERC721TokenMetadata(
      tokenAddress: Address,
      tokenId: bigint,
      network: string = 'ethereum'
    ): Promise<{
      name: string;
      symbol: string;
      tokenURI: string;
    }> {
      const publicClient = getPublicClient(network);
    
      const contract = getContract({
        address: tokenAddress,
        abi: erc721Abi,
        client: publicClient,
      });
    
      const [name, symbol, tokenURI] = await Promise.all([
        contract.read.name(),
        contract.read.symbol(),
        contract.read.tokenURI([tokenId])
      ]);
    
      return {
        name,
        symbol,
        tokenURI
      };
    }
  • ERC721 ABI snippet used for reading NFT contract metadata (name, symbol, tokenURI).
    const erc721Abi = [
      {
        inputs: [],
        name: 'name',
        outputs: [{ type: 'string' }],
        stateMutability: 'view',
        type: 'function'
      },
      {
        inputs: [],
        name: 'symbol',
        outputs: [{ type: 'string' }],
        stateMutability: 'view',
        type: 'function'
      },
      {
        inputs: [{ type: 'uint256', name: 'tokenId' }],
        name: 'tokenURI',
        outputs: [{ type: 'string' }],
        stateMutability: 'view',
        type: 'function'
      }
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. It mentions what information is retrieved (collection name, symbol, token URI, owner) but does not disclose behavioral traits such as rate limits, error handling, data freshness, or whether it requires authentication. For a read operation with no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 front-loads the core purpose and lists key data points. There is zero waste, and every word earns its place by clarifying the scope and output without redundancy.

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 moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and output data types, but lacks details on behavioral aspects and does not compensate for the missing output schema, leaving the agent unsure of the exact return format.

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 schema already documents all parameters thoroughly. The description adds no additional meaning beyond what the schema provides (e.g., it does not explain parameter interactions or provide examples not in the schema). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get detailed information') and resource ('specific NFT (ERC721 token)'), specifying the exact type of token. It distinguishes from siblings like get_nft_balance (which checks ownership quantity) or get_erc1155_token_uri (which handles a different token standard), making the purpose specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for querying NFT metadata and ownership, but does not explicitly state when to use this tool versus alternatives like get_token_info (for general tokens) or check_nft_ownership (for ownership verification). It provides some context but lacks explicit guidance on exclusions or named alternatives.

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/mcpdotdirect/evm-mcp-server'

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