nft_check_ownership
Verify NFT ownership in a collection by checking a wallet address against a contract on supported blockchains, with optional trait filtering.
Instructions
Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection. Required: chainName (blockchain network), walletAddress (wallet address), collectionContract (NFT collection). Optional: traitsFilter (filter by trait types), valuesFilter (filter by trait values). Returns ownership status and matching NFTs if owned.
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 check NFT ownership for. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically. | |
| collectionContract | Yes | The NFT collection contract address to check ownership in. Must be a valid ERC-721 or ERC-1155 contract address. | |
| traitsFilter | No | Filter by specific trait types (comma-separated list of trait names to filter by). | |
| valuesFilter | No | Filter by specific trait values (comma-separated list of trait values to match). |
Implementation Reference
- src/services/NftService.ts:94-156 (handler)The tool definition and handler for nft_check_ownership within NftService.ts. It uses Zod to validate input parameters and calls goldRushClient.NftService.checkOwnershipInNft to retrieve the ownership data.
server.tool( "nft_check_ownership", "Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.\n" + "Required: chainName (blockchain network), walletAddress (wallet address), collectionContract (NFT collection).\n" + "Optional: traitsFilter (filter by trait types), valuesFilter (filter by trait values).\n" + "Returns ownership status and matching NFTs if owned.", { 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 check NFT ownership for. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically." ), collectionContract: z .string() .describe( "The NFT collection contract address to check ownership in. Must be a valid ERC-721 or ERC-1155 contract address." ), traitsFilter: z .string() .optional() .describe( "Filter by specific trait types (comma-separated list of trait names to filter by)." ), valuesFilter: z .string() .optional() .describe( "Filter by specific trait values (comma-separated list of trait values to match)." ), }, async (params) => { try { const response = await goldRushClient.NftService.checkOwnershipInNft( params.chainName as Chain, params.walletAddress, params.collectionContract, { traitsFilter: params.traitsFilter, valuesFilter: params.valuesFilter, } ); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err}` }], isError: true, }; } } );