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,

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