get_category
Retrieve category details from SAP Commerce Cloud using a category code to access product organization information.
Instructions
Get details about a specific category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryCode | Yes | The category code |
Implementation Reference
- src/hybris-client.ts:366-370 (handler)The core handler function that executes the tool logic by making an API request to the Hybris OCC endpoint to fetch category details.async getCategory(categoryCode: string): Promise<Category> { return this.request<Category>( `/rest/v2/${this.config.baseSiteId}/catalogs/${this.config.catalogId}/${this.config.catalogVersion}/categories/${categoryCode}` ); }
- src/index.ts:83-96 (registration)Registers the 'get_category' tool in the MCP tools list with name, description, and input schema.{ name: 'get_category', description: 'Get details about a specific category', inputSchema: { type: 'object', properties: { categoryCode: { type: 'string', description: 'The category code', }, }, required: ['categoryCode'], }, },
- src/index.ts:86-95 (schema)Defines the input schema for the 'get_category' tool, requiring a categoryCode string.inputSchema: { type: 'object', properties: { categoryCode: { type: 'string', description: 'The category code', }, }, required: ['categoryCode'], },
- src/index.ts:309-311 (handler)The dispatching handler in the main CallToolRequestSchema that invokes the getCategory method.case 'get_category': result = await hybrisClient.getCategory(args?.categoryCode as string); break;
- src/hybris-client.ts:42-46 (schema)TypeScript interface defining the expected output structure for a Category.export interface Category { id: string; name: string; subcategories?: Category[]; }