list_product_sets
Retrieve product sets from a specified product catalog. Use catalog ID to filter results, with optional fields and pagination.
Instructions
List product sets within a catalog.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog_id | Yes | Product catalog ID | |
| fields | No | Comma-separated fields to return | |
| limit | No | Number of results to return | |
| after | No | Pagination cursor for next page |
Implementation Reference
- src/tools/catalogs.ts:89-97 (handler)The handler function for the list_product_sets tool. It accepts catalog_id, fields, limit, and after parameters, makes a GET request to /{catalog_id}/product_sets, and returns the JSON response with rate limit info.
async ({ catalog_id, ...params }) => { try { const { data, rateLimit } = await client.get(`/${catalog_id}/product_sets`, { ...params }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/catalogs.ts:83-88 (schema)Zod schema definitions for the list_product_sets tool's input parameters: catalog_id (required string), fields (optional string), limit (optional number, default 25), after (optional string for pagination).
{ catalog_id: z.string().describe("Product catalog ID"), fields: z.string().optional().describe("Comma-separated fields to return"), limit: z.number().optional().default(25).describe("Number of results to return"), after: z.string().optional().describe("Pagination cursor for next page"), }, - src/tools/catalogs.ts:80-97 (registration)Registration of the 'list_product_sets' tool via server.tool() within the registerCatalogTools function, which is exported and called from src/index.ts line 71.
server.tool( "list_product_sets", "List product sets within a catalog.", { catalog_id: z.string().describe("Product catalog ID"), fields: z.string().optional().describe("Comma-separated fields to return"), limit: z.number().optional().default(25).describe("Number of results to return"), after: z.string().optional().describe("Pagination cursor for next page"), }, async ({ catalog_id, ...params }) => { try { const { data, rateLimit } = await client.get(`/${catalog_id}/product_sets`, { ...params }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );