clear_cache
Clear cache in SAP Commerce Cloud (Hybris) to resolve data inconsistencies and improve system performance. Specify a cache type or clear all caches.
Instructions
Clear the Hybris cache
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cacheType | No | Specific cache type to clear (optional, clears all if not specified) |
Implementation Reference
- src/hybris-client.ts:486-503 (handler)The core handler function that executes the cache clearing logic by POSTing to the Hybris Administration Console (HAC) cache clear endpoint, optionally for a specific cache type.async clearCache(cacheType?: string): Promise<{ success: boolean; message: string }> { const endpoint = cacheType ? `${this.hacPrefix}/monitoring/cache/clear/${cacheType}` : `${this.hacPrefix}/monitoring/cache/clear`; const formData = new URLSearchParams(); return this.hacRequest<{ success: boolean; message: string }>( endpoint, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: formData, } ); }
- src/index.ts:211-223 (schema)The tool registration including name, description, and input schema definition for the clear_cache tool.{ name: 'clear_cache', description: 'Clear the Hybris cache', inputSchema: { type: 'object', properties: { cacheType: { type: 'string', description: 'Specific cache type to clear (optional, clears all if not specified)', }, }, }, },
- src/index.ts:351-353 (registration)The switch case in the MCP CallToolRequest handler that routes clear_cache calls to the hybrisClient.clearCache method.case 'clear_cache': result = await hybrisClient.clearCache(args?.cacheType as string | undefined); break;