get_nfts_for_contract
Retrieve all NFTs from a specific smart contract address, with options for pagination, metadata inclusion, and token URI resolution.
Instructions
Get all NFTs for a contract
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contractAddress | Yes | The contract address of the NFT collection | |
| pageKey | No | Key for pagination | |
| pageSize | No | Number of results per page | |
| tokenUriTimeoutInMs | No | Timeout for token URI resolution in milliseconds | |
| withMetadata | No | Whether to include metadata |
Implementation Reference
- index.ts:591-620 (registration)Registration of the 'get_nfts_for_contract' tool in the ListTools response, defining its name, description, and input schema.{ name: "get_nfts_for_contract", description: "Get all NFTs for a contract", inputSchema: { type: "object", properties: { contractAddress: { type: "string", description: "The contract address of the NFT collection", }, pageKey: { type: "string", description: "Key for pagination", }, pageSize: { type: "number", description: "Number of results per page", }, tokenUriTimeoutInMs: { type: "number", description: "Timeout for token URI resolution in milliseconds", }, withMetadata: { type: "boolean", description: "Whether to include metadata", }, }, required: ["contractAddress"], }, },
- index.ts:82-84 (schema)TypeScript type definition for the input parameters of the get_nfts_for_contract tool.type GetNftsForContractParams = GetBaseNftsForContractOptions & { contractAddress: string; };
- index.ts:284-297 (helper)Helper function to validate if the provided arguments conform to GetNftsForContractParams type, used in the tool handler.const isValidGetNftsForContractParams = ( args: any ): args is GetNftsForContractParams => { return ( typeof args === "object" && args !== null && typeof args.contractAddress === "string" && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.pageSize === undefined || typeof args.pageSize === "number") && (args.tokenUriTimeoutInMs === undefined || typeof args.tokenUriTimeoutInMs === "number") && (args.withMetadata === undefined || typeof args.withMetadata === "boolean") ); };