get_category
Retrieve category details from SAP Commerce Cloud using a category code to access product classification information for management tasks.
Instructions
Get details about a specific category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryCode | Yes | The category code |
Implementation Reference
- src/index.ts:389-393 (handler)The handler logic for the 'get_category' tool within the main CallToolRequestSchema dispatcher switch statement. It validates the required 'categoryCode' input and delegates to hybrisClient.getCategory.case 'get_category': result = await hybrisClient.getCategory( validateString(args, 'categoryCode', true) ); break;
- src/index.ts:148-161 (registration)Tool registration entry in the 'tools' array, used by ListToolsRequestSchema handler. Defines the tool name, description, and input schema for MCP tool discovery.{ 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:151-160 (schema)Input schema definition for the 'get_category' tool, specifying the required 'categoryCode' string parameter.inputSchema: { type: 'object', properties: { categoryCode: { type: 'string', description: 'The category code', }, }, required: ['categoryCode'], },
- src/hybris-client.ts:431-435 (helper)Supporting method in HybrisClient that performs the actual REST API request to fetch category details using the OCC endpoints.async getCategory(categoryCode: string): Promise<Category> { return this.request<Category>( `/rest/v2/${encodeURIComponent(this.config.baseSiteId!)}/catalogs/${encodeURIComponent(this.config.catalogId!)}/${encodeURIComponent(this.config.catalogVersion!)}/categories/${encodeURIComponent(categoryCode)}` ); }