get_contracts_for_owner
Retrieve NFT contract addresses owned by a specific wallet, with options to filter spam and airdrops for targeted results.
Instructions
Get NFT contracts owned by an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | The wallet address to get contracts for | |
| pageKey | No | Key for pagination | |
| pageSize | No | Number of results per page | |
| includeFilters | No | Filters to include in the response | |
| excludeFilters | No | Filters to exclude from the response |
Implementation Reference
- index.ts:513-550 (registration)Registration of the 'get_contracts_for_owner' tool in the ListToolsRequestSchema handler, defining name, description, and input schema.{ name: "get_contracts_for_owner", description: "Get NFT contracts owned by an address", inputSchema: { type: "object", properties: { owner: { type: "string", description: "The wallet address to get contracts for", }, pageKey: { type: "string", description: "Key for pagination", }, pageSize: { type: "number", description: "Number of results per page", }, includeFilters: { type: "array", items: { type: "string", enum: ["spam", "airdrops"], }, description: "Filters to include in the response", }, excludeFilters: { type: "array", items: { type: "string", enum: ["spam", "airdrops"], }, description: "Filters to exclude from the response", }, }, required: ["owner"], }, },
- index.ts:65-67 (schema)TypeScript type definition extending Alchemy SDK's GetContractsForOwnerOptions with required 'owner' field for tool parameters.type GetContractsForOwnerParams = GetContractsForOwnerOptions & { owner: string; };
- index.ts:179-191 (helper)Helper validation function to type-guard arguments for the get_contracts_for_owner tool handler.const isValidGetContractsForOwnerParams = ( args: any ): args is GetContractsForOwnerParams => { return ( typeof args === "object" && args !== null && typeof args.owner === "string" && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.pageSize === undefined || typeof args.pageSize === "number") && (args.includeFilters === undefined || Array.isArray(args.includeFilters)) && (args.excludeFilters === undefined || Array.isArray(args.excludeFilters)) ); };