Skip to main content
Glama

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
NameRequiredDescriptionDefault
networkYesNetwork identifier (e.g., "ethereum-mainnet", "solana-mainnet" or CAIP-2 "eip155:1").
cursorNoPagination cursor from previous response.
limitNoMax NFTs per page (default: 20).
group_byNoGroup NFTs by collection.
wallet_idNoTarget wallet ID. Required for multi-wallet sessions.

Implementation Reference

  • 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);
        },
      );
    }

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/minhoyoo-iotrust/WAIaaS'

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