Skip to main content
Glama

get_contracts_for_owner

Retrieve NFT contract addresses owned by a specific wallet, with options to filter spam and airdrops for targeted results.

Instructions

Get NFT contracts owned by an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe wallet address to get contracts for
pageKeyNoKey for pagination
pageSizeNoNumber of results per page
includeFiltersNoFilters to include in the response
excludeFiltersNoFilters to exclude from the response

Implementation Reference

  • index.ts:513-550 (registration)
    Registration of the 'get_contracts_for_owner' tool in the ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: "get_contracts_for_owner",
      description: "Get NFT contracts owned by an address",
      inputSchema: {
        type: "object",
        properties: {
          owner: {
            type: "string",
            description: "The wallet address to get contracts for",
          },
          pageKey: {
            type: "string",
            description: "Key for pagination",
          },
          pageSize: {
            type: "number",
            description: "Number of results per page",
          },
          includeFilters: {
            type: "array",
            items: {
              type: "string",
              enum: ["spam", "airdrops"],
            },
            description: "Filters to include in the response",
          },
          excludeFilters: {
            type: "array",
            items: {
              type: "string",
              enum: ["spam", "airdrops"],
            },
            description: "Filters to exclude from the response",
          },
        },
        required: ["owner"],
      },
    },
  • TypeScript type definition extending Alchemy SDK's GetContractsForOwnerOptions with required 'owner' field for tool parameters.
    type GetContractsForOwnerParams = GetContractsForOwnerOptions & {
      owner: string;
    };
  • Helper validation function to type-guard arguments for the get_contracts_for_owner tool handler.
    const isValidGetContractsForOwnerParams = (
      args: any
    ): args is GetContractsForOwnerParams => {
      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.includeFilters === undefined || Array.isArray(args.includeFilters)) &&
        (args.excludeFilters === undefined || Array.isArray(args.excludeFilters))
      );
    };
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a read-only operation ('Get') but doesn't disclose rate limits, authentication needs, error conditions, pagination behavior (beyond the pageKey/pageSize parameters), response format, or whether it's a real-time query. For a tool with 5 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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, front-loaded sentence with zero wasted words. It immediately conveys the core purpose without unnecessary elaboration. Every word earns its place, making it highly efficient for an AI agent to parse quickly.

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 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address the tool's complexity (filtering, pagination), behavioral aspects, or return values. While concise, it fails to provide sufficient context for an agent to understand how to effectively use this tool beyond basic parameter passing. The lack of output schema means the description should ideally hint at response structure, which it doesn't.

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 the schema fully documents all 5 parameters (owner, pageKey, pageSize, includeFilters, excludeFilters). The description adds no additional parameter semantics beyond the tool name implying the 'owner' parameter. It doesn't explain filter interactions (e.g., how include/exclude work together) or provide examples. With high schema coverage, the baseline 3 is appropriate as the description doesn't enhance parameter understanding.

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 verb 'Get' and resource 'NFT contracts owned by an address', making the purpose immediately understandable. It distinguishes from siblings like 'get_nfts_for_owner' (which retrieves NFTs rather than contracts) and 'get_nfts_for_contract' (which focuses on a specific contract). However, it doesn't explicitly mention the blockchain context or API source, which could be inferred but isn't stated.

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. It doesn't mention prerequisites (e.g., valid wallet address format), compare to siblings like 'get_nfts_for_owner' (for individual NFTs) or 'get_owners_for_nft' (reverse lookup), or specify use cases (e.g., portfolio analysis, contract discovery). The agent must infer usage from the name and parameters 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