Skip to main content
Glama

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
NameRequiredDescriptionDefault
ownerYesThe wallet address to get contracts for
pageKeyNoKey for pagination
pageSizeNoNumber of results per page
includeFiltersNoFilters to include in the response
excludeFiltersNoFilters 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"], }, },
  • TypeScript type definition extending Alchemy SDK's GetContractsForOwnerOptions with required 'owner' field for tool parameters.
    type GetContractsForOwnerParams = GetContractsForOwnerOptions & { owner: string; };
  • 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)) ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsanishjain/alchemy-sdk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server