Skip to main content
Glama

get_tokens_for_owner

Retrieve tokens owned by a specific wallet address using the Alchemy MCP Plugin. Filter results by contract addresses and manage large datasets with pagination options.

Instructions

Get tokens owned by an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe wallet address to get tokens for
pageKeyNoKey for pagination
pageSizeNoNumber of results per page
contractAddressesNoList of contract addresses to filter by

Implementation Reference

  • index.ts:737-765 (registration)
    Registration of the 'get_tokens_for_owner' tool in the ListTools response, including its schema definition
    {
      name: "get_tokens_for_owner",
      description: "Get tokens owned by an address",
      inputSchema: {
        type: "object",
        properties: {
          owner: {
            type: "string",
            description: "The wallet address to get tokens for",
          },
          pageKey: {
            type: "string",
            description: "Key for pagination",
          },
          pageSize: {
            type: "number",
            description: "Number of results per page",
          },
          contractAddresses: {
            type: "array",
            items: {
              type: "string",
            },
            description: "List of contract addresses to filter by",
          },
        },
        required: ["owner"],
      },
    },
  • TypeScript type definition for the tool parameters
    type GetTokensForOwnerParams = GetTokensForOwnerOptions & { owner: string };
  • Validation helper function to check if arguments match GetTokensForOwnerParams
    const isValidGetTokensForOwnerParams = (
      args: any
    ): args is GetTokensForOwnerParams => {
      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))
      );
    };
  • Import of GetTokensForOwnerOptions type from alchemy-sdk used in the tool schema
    GetTokensForOwnerOptions,
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states the action ('Get tokens') without mentioning pagination behavior (implied by parameters), rate limits, authentication needs, error conditions, or what 'tokens' specifically refers to (e.g., ERC-20, ERC-721). This is inadequate for a tool with multiple parameters and no output schema.

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, efficient sentence with no wasted words. It's front-loaded with the core purpose, making it easy to parse quickly, though this conciseness comes at the cost of completeness.

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 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, pagination behavior, or how filtering works with 'contractAddresses'. For a data retrieval tool in a crowded sibling set, more context is needed to guide 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. The description adds no additional meaning beyond implying 'owner' is required and 'tokens' are retrieved, but doesn't clarify parameter interactions (e.g., how 'contractAddresses' filters results). Baseline 3 is appropriate since the schema handles most documentation.

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 'Get tokens owned by an address' clearly states the verb ('Get') and resource ('tokens owned by an address'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_nfts_for_owner' or 'get_token_balances', which reduces specificity.

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 siblings like 'get_nfts_for_owner' and 'get_token_balances' available, there's no indication of differences in scope (e.g., tokens vs. NFTs vs. balances) or filtering capabilities, leaving usage context unclear.

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