get_categories
Retrieve the category tree structure from SAP Commerce Cloud product catalogs to organize and navigate products.
Instructions
Get the category tree from the product catalog
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/hybris-client.ts:359-364 (handler)The core handler function that makes an API request to the Hybris OCC endpoint to fetch the top-level categories and returns them as Category[].async getCategories(): Promise<Category[]> { const result = await this.request<{ subcategories: Category[] }>( `/rest/v2/${this.config.baseSiteId}/catalogs/${this.config.catalogId}/${this.config.catalogVersion}/categories` ); return result.subcategories || []; }
- src/index.ts:75-82 (schema)Tool registration including name, description, and input schema (no required parameters). Serves as both registration and schema definition.{ name: 'get_categories', description: 'Get the category tree from the product catalog', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:305-307 (registration)Dispatch handler in the switch statement that calls the getCategories method on the HybrisClient instance.case 'get_categories': result = await hybrisClient.getCategories(); break;
- src/hybris-client.ts:42-46 (schema)TypeScript interface defining the structure of a Category object used in the tool's output.export interface Category { id: string; name: string; subcategories?: Category[]; }