Skip to main content
Glama

get_nfts_for_contract

Retrieve all NFTs from a specific smart contract address, with options for pagination, metadata inclusion, and token URI resolution.

Instructions

Get all NFTs for a contract

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractAddressYesThe contract address of the NFT collection
pageKeyNoKey for pagination
pageSizeNoNumber of results per page
tokenUriTimeoutInMsNoTimeout for token URI resolution in milliseconds
withMetadataNoWhether to include metadata

Implementation Reference

  • index.ts:591-620 (registration)
    Registration of the 'get_nfts_for_contract' tool in the ListTools response, defining its name, description, and input schema.
    { name: "get_nfts_for_contract", description: "Get all NFTs for a contract", inputSchema: { type: "object", properties: { contractAddress: { type: "string", description: "The contract address of the NFT collection", }, pageKey: { type: "string", description: "Key for pagination", }, pageSize: { type: "number", description: "Number of results per page", }, tokenUriTimeoutInMs: { type: "number", description: "Timeout for token URI resolution in milliseconds", }, withMetadata: { type: "boolean", description: "Whether to include metadata", }, }, required: ["contractAddress"], }, },
  • TypeScript type definition for the input parameters of the get_nfts_for_contract tool.
    type GetNftsForContractParams = GetBaseNftsForContractOptions & { contractAddress: string; };
  • Helper function to validate if the provided arguments conform to GetNftsForContractParams type, used in the tool handler.
    const isValidGetNftsForContractParams = ( args: any ): args is GetNftsForContractParams => { return ( typeof args === "object" && args !== null && typeof args.contractAddress === "string" && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.pageSize === undefined || typeof args.pageSize === "number") && (args.tokenUriTimeoutInMs === undefined || typeof args.tokenUriTimeoutInMs === "number") && (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