Skip to main content
Glama

get_asset_transfers

Retrieve blockchain asset transfers for addresses or contracts, filtering by block range, transfer categories, and contract addresses to analyze transaction history.

Instructions

Get asset transfers for a specific address or contract

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromBlockNoThe starting block (hex string or "latest")
toBlockNoThe ending block (hex string or "latest")
fromAddressNoThe sender address
toAddressNoThe recipient address
categoryNoThe category of transfers to include (e.g., "external", "internal", "erc20", "erc721", "erc1155", "specialnft")
contractAddressesNoList of contract addresses to filter by
maxCountNoThe maximum number of results to return
excludeZeroValueNoWhether to exclude zero value transfers
pageKeyNoKey for pagination
withMetadataNoWhether to include metadata in the response

Implementation Reference

  • index.ts:766-829 (registration)
    Registration of the get_asset_transfers tool, including name, description, and complete input schema for MCP tool listing.
    { name: "get_asset_transfers", description: "Get asset transfers for a specific address or contract", inputSchema: { type: "object", properties: { fromBlock: { type: "string", description: 'The starting block (hex string or "latest")', }, toBlock: { type: "string", description: 'The ending block (hex string or "latest")', }, fromAddress: { type: "string", description: "The sender address", }, toAddress: { type: "string", description: "The recipient address", }, category: { type: "array", items: { type: "string", enum: [ "external", "internal", "erc20", "erc721", "erc1155", "specialnft", ], }, description: 'The category of transfers to include (e.g., "external", "internal", "erc20", "erc721", "erc1155", "specialnft")', }, contractAddresses: { type: "array", items: { type: "string", }, description: "List of contract addresses to filter by", }, maxCount: { type: "number", description: "The maximum number of results to return", }, excludeZeroValue: { type: "boolean", description: "Whether to exclude zero value transfers", }, pageKey: { type: "string", description: "Key for pagination", }, withMetadata: { type: "boolean", description: "Whether to include metadata in the response", }, }, }, },
  • TypeScript type definition for the tool's input parameters, aliasing Alchemy SDK's AssetTransfersParams.
    type GetAssetTransfersParams = AssetTransfersParams;
  • Helper function to validate and type-guard the input arguments for the get_asset_transfers tool before execution.
    const isValidGetAssetTransfersParams = ( args: any ): args is GetAssetTransfersParams => { return ( typeof args === "object" && args !== null && (args.fromBlock === undefined || typeof args.fromBlock === "string") && (args.toBlock === undefined || typeof args.toBlock === "string") && (args.fromAddress === undefined || typeof args.fromAddress === "string") && (args.toAddress === undefined || typeof args.toAddress === "string") && (args.category === undefined || Array.isArray(args.category)) && (args.contractAddresses === undefined || Array.isArray(args.contractAddresses)) && (args.maxCount === undefined || typeof args.maxCount === "number") && (args.excludeZeroValue === undefined || typeof args.excludeZeroValue === "boolean") && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.withMetadata === undefined || typeof args.withMetadata === "boolean") ); };

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