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
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | The wallet address to get tokens for | |
| pageKey | No | Key for pagination | |
| pageSize | No | Number of results per page | |
| contractAddresses | No | List 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"], }, },
- index.ts:81-81 (schema)TypeScript type definition for the tool parameterstype GetTokensForOwnerParams = GetTokensForOwnerOptions & { owner: string };
- index.ts:270-282 (helper)Validation helper function to check if arguments match GetTokensForOwnerParamsconst 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)) ); };
- index.ts:49-49 (schema)Import of GetTokensForOwnerOptions type from alchemy-sdk used in the tool schemaGetTokensForOwnerOptions,