Skip to main content
Glama

clear_cache

Remove cached data from SAP Commerce Cloud (Hybris) to resolve performance issues or outdated information. Specify a cache type or clear all caches.

Instructions

Clear the Hybris cache

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cacheTypeNoSpecific cache type to clear (optional, clears all if not specified)

Implementation Reference

  • The actual implementation of the clearCache method which executes a Groovy script on the Hybris platform.
      async clearCache(cacheType?: string): Promise<{ success: boolean; message: string }> {
        // Use Groovy script to clear cache
        const escapedType = cacheType ? this.escapeGroovyString(cacheType) : '';
        const script = `
    import de.hybris.platform.core.Registry
    
    def cacheType = "${escapedType}"
    
    if (cacheType == "all" || cacheType == "") {
        Registry.getCurrentTenant().getCache().clear()
        println "All caches cleared"
        return "SUCCESS"
    } else {
        // Clear specific cache region if supported
        try {
            def cacheController = spring.getBean("cacheController")
            cacheController.clearCache()
            println "Cache cleared: " + cacheType
            return "SUCCESS"
        } catch (Exception e) {
            Registry.getCurrentTenant().getCache().clear()
            println "Cleared all caches (specific cache type not supported)"
            return "SUCCESS"
        }
    }
    `;
  • src/index.ts:280-292 (registration)
    The MCP tool registration definition for clear_cache.
    {
      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)',
          },
        },
      },
    },
  • The handler logic in the tool router that invokes the hybrisClient.clearCache method.
    case 'clear_cache':
      result = await hybrisClient.clearCache(
        validateString(args, 'cacheType', false)
      );
      break;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Clear' implies a destructive/mutating operation, but the description doesn't specify whether this requires admin permissions, whether it's reversible, what side effects might occur, or any rate limits. It provides minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool with one optional parameter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a potentially destructive cache-clearing operation with no annotations and no output schema, the description is inadequate. It doesn't explain what 'Hybris cache' refers to, what happens after clearing, whether the operation is synchronous/asynchronous, or what errors might occur. The agent lacks crucial context for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the optional 'cacheType' parameter. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Clear') and target resource ('the Hybris cache'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential sibling cache-related tools (none are listed among siblings, but the agent might not know if other cache tools exist).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, timing considerations, or what effects clearing the cache might have on system performance or data consistency.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcieunic/hybris-mcp-main'

If you have feedback or need assistance with the MCP directory API, please join our Discord server