nft_for_address
Retrieve and display NFT collections held by a wallet address on supported blockchain networks, with options to filter spam and manage metadata fetching.
Instructions
Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address. Required: chainName (blockchain network name), walletAddress (wallet address or ENS/domain). Optional: noSpam (filter spam, default true), noNftAssetMetadata (exclude metadata for faster response, default true), withUncached (fetch uncached metadata, may be slower, default false). Returns complete details of NFTs in the wallet including metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | Yes | The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet'). | |
| walletAddress | Yes | The wallet address to get NFTs for. Can be a wallet address or ENS/domain name. | |
| noSpam | No | Filter out spam/scam NFTs from results. Default is true. | |
| noNftAssetMetadata | No | Skip fetching NFT asset metadata for faster response. Default is true. | |
| withUncached | No | Fetch uncached metadata directly from source (may be slower but more up-to-date). Default is false. |
Implementation Reference
- src/services/NftService.ts:25-92 (handler)The "nft_for_address" tool is registered and implemented in src/services/NftService.ts. It uses the Covalent GoldRushClient to fetch NFT data and returns the result as a text content object.
server.tool( "nft_for_address", "Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.\n" + "Required: chainName (blockchain network name), walletAddress (wallet address or ENS/domain).\n" + "Optional: noSpam (filter spam, default true), noNftAssetMetadata (exclude metadata for faster response, default true), " + "withUncached (fetch uncached metadata, may be slower, default false).\n" + "Returns complete details of NFTs in the wallet including metadata.", { chainName: z .enum(Object.values(ChainName) as [string, ...string[]]) .describe( "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')." ), walletAddress: z .string() .describe( "The wallet address to get NFTs for. Can be a wallet address or ENS/domain name." ), noSpam: z .boolean() .optional() .default(true) .describe( "Filter out spam/scam NFTs from results. Default is true." ), noNftAssetMetadata: z .boolean() .optional() .default(true) .describe( "Skip fetching NFT asset metadata for faster response. Default is true." ), withUncached: z .boolean() .optional() .default(false) .describe( "Fetch uncached metadata directly from source (may be slower but more up-to-date). Default is false." ), }, async (params) => { try { const response = await goldRushClient.NftService.getNftsForAddress( params.chainName as Chain, params.walletAddress, { noSpam: params.noSpam, noNftAssetMetadata: params.noNftAssetMetadata, withUncached: params.withUncached, } ); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err}` }], isError: true, }; } } );