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
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Most NFTs are on Ethereum mainnet, which is the default. | |
| tokenAddress | Yes | The contract address of the NFT collection (e.g., '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' for Bored Ape Yacht Club) | |
| tokenId | Yes | The ID of the specific NFT token to query (e.g., '1234') |
Implementation Reference
- src/core/tools.ts:1136-1174 (registration)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 }; } } );
- src/core/services/tokens.ts:118-146 (handler)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 }; }
- src/core/services/tokens.ts:43-64 (schema)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' }