list_nfts
Retrieve NFTs owned by a wallet on supported networks. Specify network, wallet, and pagination to view ERC-721, ERC-1155, or Metaplex NFTs with optional grouping by collection.
Instructions
List NFTs (ERC-721, ERC-1155, Metaplex) owned by the wallet for a specific network. Requires NFT indexer API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network identifier (e.g., "ethereum-mainnet", "solana-mainnet" or CAIP-2 "eip155:1"). | |
| cursor | No | Pagination cursor from previous response. | |
| limit | No | Max NFTs per page (default: 20). | |
| group_by | No | Group NFTs by collection. | |
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions. |
Implementation Reference
- packages/mcp/src/tools/list-nfts.ts:13-42 (registration)The registration and handler logic for the 'list_nfts' MCP tool. It registers the tool with the server and defines the handler to fetch NFTs from the '/v1/wallet/nfts' API endpoint.
export function registerListNfts( server: McpServer, apiClient: ApiClient, walletContext?: WalletContext, ): void { server.tool( 'list_nfts', withWalletPrefix( 'List NFTs (ERC-721, ERC-1155, Metaplex) owned by the wallet for a specific network. Requires NFT indexer API key.', walletContext?.walletName, ), { network: z.string().describe('Network identifier (e.g., "ethereum-mainnet", "solana-mainnet" or CAIP-2 "eip155:1").'), cursor: z.string().optional().describe('Pagination cursor from previous response.'), limit: z.number().optional().describe('Max NFTs per page (default: 20).'), group_by: z.enum(['collection']).optional().describe('Group NFTs by collection.'), wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions.'), }, async (args) => { const params = new URLSearchParams(); params.set('network', args.network); if (args.cursor) params.set('cursor', args.cursor); if (args.limit !== undefined) params.set('limit', String(args.limit)); if (args.group_by) params.set('groupBy', args.group_by); if (args.wallet_id) params.set('walletId', args.wallet_id); const result = await apiClient.get('/v1/wallet/nfts?' + params.toString()); return toToolResult(result); }, ); }