Skip to main content
Glama

get_nfts_for_owner

Retrieve NFT collections owned by a specific wallet address using the Alchemy MCP Plugin. Filter results by contract addresses and include metadata as needed.

Instructions

Get NFTs owned by a specific wallet address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe wallet address to get NFTs for
pageKeyNoKey for pagination
pageSizeNoNumber of NFTs to return in one page (max: 100)
contractAddressesNoList of contract addresses to filter by
withMetadataNoWhether to include NFT metadata

Implementation Reference

  • The handler function for the 'get_nfts_for_owner' tool. It validates the input arguments using a type guard and calls the Alchemy SDK's nft.getNftsForOwner method with the validated parameters.
    private async handleGetNftsForOwner(args: Record<string, unknown>) {
      const params = this.validateAndCastParams<GetNftsForOwnerParams>(
        args,
        isValidGetNftsForOwnerParams,
        "Invalid NFTs for owner parameters"
      );
      return await this.alchemy.nft.getNftsForOwner(params.owner, params);
    }
  • index.ts:412-442 (registration)
    The registration of the 'get_nfts_for_owner' tool in the MCP server's tool list, including its name, description, and input schema definition.
    name: "get_nfts_for_owner",
    description: "Get NFTs owned by a specific wallet address",
    inputSchema: {
      type: "object",
      properties: {
        owner: {
          type: "string",
          description: "The wallet address to get NFTs for",
        },
        pageKey: {
          type: "string",
          description: "Key for pagination",
        },
        pageSize: {
          type: "number",
          description: "Number of NFTs to return in one page (max: 100)",
        },
        contractAddresses: {
          type: "array",
          items: {
            type: "string",
          },
          description: "List of contract addresses to filter by",
        },
        withMetadata: {
          type: "boolean",
          description: "Whether to include NFT metadata",
        },
      },
      required: ["owner"],
    },
  • Type guard validation function for 'get_nfts_for_owner' parameters, ensuring they conform to GetNftsForOwnerParams type.
    const isValidGetNftsForOwnerParams = (
      args: any
    ): args is GetNftsForOwnerParams => {
      return (
        typeof args === "object" &&
        args !== null &&
        typeof args.owner === "string" &&
        (args.pageKey === undefined || typeof args.pageKey === "string") &&
        (args.pageSize === undefined || typeof args.pageSize === "number") &&
        (args.contractAddresses === undefined ||
          Array.isArray(args.contractAddresses)) &&
        (args.withMetadata === undefined || typeof args.withMetadata === "boolean")
      );
    };
  • TypeScript type definition for the parameters of 'get_nfts_for_owner', extending Alchemy SDK's GetNftsForOwnerOptions with required owner field.
    type GetNftsForOwnerParams = GetNftsForOwnerOptions & { owner: string };
  • index.ts:987-989 (registration)
    Dispatcher switch case that routes calls to the 'get_nfts_for_owner' handler in the MCP tool request handler.
    case "get_nfts_for_owner":
      result = await this.handleGetNftsForOwner(request.params.arguments);
      break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves NFTs but does not mention pagination behavior (implied by 'pageKey' and 'pageSize' in schema), rate limits, authentication needs, error conditions, or response format. For a read operation with multiple parameters, this is inadequate transparency.

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?

The description is a single, clear sentence with zero waste. It is front-loaded with the core purpose and appropriately sized for the tool's complexity. Every word earns its place, making it efficient and easy to parse.

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?

Given the tool's complexity (5 parameters, no output schema, no annotations), the description is incomplete. It lacks behavioral details (e.g., pagination, metadata inclusion effects), usage context relative to siblings, and output expectations. For a data retrieval tool with filtering and pagination, this leaves significant gaps for an agent.

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?

The schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain parameter interactions or default behaviors). With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to.

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 tool's purpose: 'Get NFTs owned by a specific wallet address'. It specifies the verb 'Get' and the resource 'NFTs', with the scope 'owned by a specific wallet address'. However, it does not explicitly differentiate from sibling tools like 'get_nfts_for_contract' or 'get_contracts_for_owner', which reduces clarity in a crowded toolset.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools for NFTs and owners (e.g., 'get_nfts_for_contract', 'get_contracts_for_owner', 'get_owners_for_nft'), there is no indication of context, prerequisites, or exclusions. This leaves the agent to infer usage from the tool name 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