Skip to main content
Glama

get_transfers_for_contract

Retrieve NFT transfer history for a specific contract address to track ownership changes and transaction activity.

Instructions

Get transfers for an NFT contract

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractAddressYesThe contract address of the NFT collection
pageKeyNoKey for pagination
fromBlockNoStarting block number for the query
toBlockNoEnding block number for the query
orderNoOrder of results (ascending or descending)
tokenTypeNoType of token (ERC721 or ERC1155)

Implementation Reference

  • index.ts:622-656 (registration)
    Tool registration including name, description, and detailed input schema for validating parameters like contractAddress, pagination, block range, order, and token type.
    name: "get_transfers_for_contract", description: "Get transfers for an NFT contract", inputSchema: { type: "object", properties: { contractAddress: { type: "string", description: "The contract address of the NFT collection", }, pageKey: { type: "string", description: "Key for pagination", }, fromBlock: { type: "number", description: "Starting block number for the query", }, toBlock: { type: "number", description: "Ending block number for the query", }, order: { type: "string", enum: ["asc", "desc"], description: "Order of results (ascending or descending)", }, tokenType: { type: "string", enum: ["ERC721", "ERC1155"], description: "Type of token (ERC721 or ERC1155)", }, }, required: ["contractAddress"], }, },
  • TypeScript type definition for the tool parameters, extending Alchemy SDK's GetTransfersForContractOptions and requiring contractAddress.
    type GetTransfersForContractParams = GetTransfersForContractOptions & { contractAddress: string; };
  • Parameter validation helper function that checks if input arguments conform to GetTransfersForContractParams type for use in handler.
    const isValidGetTransfersForContractParams = ( args: any ): args is GetTransfersForContractParams => { return ( typeof args === "object" && args !== null && typeof args.contractAddress === "string" && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.fromBlock === undefined || typeof args.fromBlock === "number") && (args.toBlock === undefined || typeof args.toBlock === "number") && (args.order === undefined || typeof args.order === "string") && (args.tokenType === undefined || typeof args.tokenType === "string") ); };
  • Import of Alchemy SDK type GetTransfersForContractOptions used in parameter type definition.
    GetTransfersForContractOptions,

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