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
| Name | Required | Description | Default |
|---|---|---|---|
| fromBlock | No | The starting block (hex string or "latest") | |
| toBlock | No | The ending block (hex string or "latest") | |
| fromAddress | No | The sender address | |
| toAddress | No | The recipient address | |
| category | No | The category of transfers to include (e.g., "external", "internal", "erc20", "erc721", "erc1155", "specialnft") | |
| contractAddresses | No | List of contract addresses to filter by | |
| maxCount | No | The maximum number of results to return | |
| excludeZeroValue | No | Whether to exclude zero value transfers | |
| pageKey | No | Key for pagination | |
| withMetadata | No | Whether 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", }, }, }, },
- index.ts:60-60 (schema)TypeScript type definition for the tool's input parameters, aliasing Alchemy SDK's AssetTransfersParams.type GetAssetTransfersParams = AssetTransfersParams;
- index.ts:142-161 (helper)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") ); };