get_categories
Retrieve the product catalog's category tree structure for navigation and organization purposes.
Instructions
Get the category tree from the product catalog
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_categories"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/hybris-client.ts:424-429 (handler)The main handler function that fetches the category tree from the Hybris OCC REST API endpoint and returns the subcategories array.
async getCategories(): Promise<Category[]> { const result = await this.request<{ subcategories: Category[] }>( `/rest/v2/${encodeURIComponent(this.config.baseSiteId!)}/catalogs/${encodeURIComponent(this.config.catalogId!)}/${encodeURIComponent(this.config.catalogVersion!)}/categories` ); return result.subcategories || []; } - src/index.ts:140-147 (schema)Tool registration including name, description, and empty input schema (no parameters required). Serves as both schema definition and registration in the tools list.
{ name: 'get_categories', description: 'Get the category tree from the product catalog', inputSchema: { type: 'object', properties: {}, }, }, - src/hybris-client.ts:42-46 (schema)Type definition for Category used in the getCategories return type.
export interface Category { id: string; name: string; subcategories?: Category[]; } - src/index.ts:385-387 (registration)Dispatch/registration in the tool call switch statement that invokes the handler.
case 'get_categories': result = await hybrisClient.getCategories(); break;