Skip to main content
Glama

get_nft_sales

Retrieve NFT sales data for collections or specific tokens using contract addresses, token IDs, and customizable filters like block ranges and marketplaces.

Instructions

Get NFT sales data for a contract or specific NFT

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractAddressNoThe contract address of the NFT collection
tokenIdNoThe token ID of the specific NFT
fromBlockNoStarting block number for the query
toBlockNoEnding block number for the query
orderNoOrder of results (ascending or descending)
marketplaceNoFilter by marketplace (e.g., 'seaport', 'wyvern')
pageKeyNoKey for pagination
pageSizeNoNumber of results per page

Implementation Reference

  • index.ts:471-512 (registration)
    Registration of the 'get_nft_sales' tool in the tools list, including its description and input schema definition.
      name: "get_nft_sales",
      description: "Get NFT sales data for a contract or specific NFT",
      inputSchema: {
        type: "object",
        properties: {
          contractAddress: {
            type: "string",
            description: "The contract address of the NFT collection",
          },
          tokenId: {
            type: "string",
            description: "The token ID of the specific NFT",
          },
          fromBlock: {
            type: "number",
            description: "Starting block number for the query",
          },
          toBlock: {
            type: "number",
            description: "Ending block number for the query",
          },
          order: {
            type: "string",
            enum: ["asc", "desc"],
            description: "Order of results (ascending or descending)",
          },
          marketplace: {
            type: "string",
            description:
              "Filter by marketplace (e.g., 'seaport', 'wyvern')",
          },
          pageKey: {
            type: "string",
            description: "Key for pagination",
          },
          pageSize: {
            type: "number",
            description: "Number of results per page",
          },
        },
      },
    },
  • TypeScript type definition for GetNftSalesParams, extending Alchemy SDK's GetNftSalesOptions with optional contractAddress and tokenId.
    type GetNftSalesParams = GetNftSalesOptions & {
      contractAddress?: string;
      tokenId?: string;
    };
  • Parameter validation function for get_nft_sales tool inputs, ensuring args conform to GetNftSalesParams.
    const isValidGetNftSalesParams = (args: any): args is GetNftSalesParams => {
      return (
        typeof args === "object" &&
        args !== null &&
        (args.contractAddress === undefined ||
          typeof args.contractAddress === "string") &&
        (args.tokenId === undefined || typeof args.tokenId === "string") &&
        (args.fromBlock === undefined || typeof args.fromBlock === "number") &&
        (args.toBlock === undefined || typeof args.toBlock === "number") &&
        (args.order === undefined || typeof args.order === "string") &&
        (args.marketplace === undefined || typeof args.marketplace === "string") &&
        (args.pageKey === undefined || typeof args.pageKey === "string") &&
        (args.pageSize === undefined || typeof args.pageSize === "number")
      );
    };
  • Import of GetNftSalesOptions type from alchemy-sdk for use in get_nft_sales schema.
    GetNftSalesOptions,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'Get NFT sales data' which implies a read-only operation, but doesn't specify whether this requires API keys, has rate limits, returns paginated results, or what format the data comes in. The mention of 'contract or specific NFT' hints at filtering but lacks detail on how these interact. Significant behavioral gaps remain.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise single sentence that front-loads the core purpose. Every word earns its place with no redundant information. The structure is clear and efficiently communicates the tool's scope without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return format, pagination behavior (implied by pageKey/pageSize but not described), error conditions, or how parameters interact. Given the complexity and lack of structured support, more contextual information is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema itself. The description adds minimal value beyond what's in the schema—it implies that 'contractAddress' and 'tokenId' are the primary filters, but doesn't explain their relationship (e.g., if tokenId requires contractAddress). Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('NFT sales data') with two distinct scopes ('for a contract or specific NFT'). It distinguishes from siblings like 'get_nft_metadata' or 'get_floor_price' by focusing on sales data, but doesn't explicitly differentiate from 'get_asset_transfers' which might overlap. The purpose is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'get_asset_transfers' or 'get_transfers_for_contract'. The description implies usage for NFT sales queries but provides no context about prerequisites, limitations, or when other tools might be more appropriate. This leaves the agent to infer usage from parameter names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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