Skip to main content
Glama

trigger_catalog_sync

Synchronize catalog data between versions in SAP Commerce Cloud by specifying source and target versions to update product information.

Instructions

Trigger a catalog synchronization between versions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalogIdYesCatalog ID to sync
sourceVersionYesSource catalog version (e.g., "Staged")
targetVersionYesTarget catalog version (e.g., "Online")

Implementation Reference

  • The triggerCatalogSync method implements the logic to trigger a catalog synchronization in Hybris using a Groovy script.
      async triggerCatalogSync(
        catalogId: string,
        sourceVersion: string,
        targetVersion: string
      ): Promise<{ success: boolean; message: string }> {
        // Use Groovy script to trigger catalog sync by creating a properly configured CronJob
        const escapedCatalogId = this.escapeGroovyString(catalogId);
        const escapedSource = this.escapeGroovyString(sourceVersion);
        const escapedTarget = this.escapeGroovyString(targetVersion);
        const script = `
    import de.hybris.platform.catalog.model.synchronization.CatalogVersionSyncCronJobModel
    import de.hybris.platform.cronjob.enums.JobLogLevel
    
    try {
        def catalogVersionService = spring.getBean("catalogVersionService")
        def modelService = spring.getBean("modelService")
        def cronJobService = spring.getBean("cronJobService")
        def flexibleSearchService = spring.getBean("flexibleSearchService")
    
        def sourceCatalogVersion = catalogVersionService.getCatalogVersion("${escapedCatalogId}", "${escapedSource}")
        def targetCatalogVersion = catalogVersionService.getCatalogVersion("${escapedCatalogId}", "${escapedTarget}")
    
        if (sourceCatalogVersion == null) {
            println "ERROR: Source catalog version not found: ${escapedCatalogId}:${escapedSource}"
            return "SOURCE_NOT_FOUND"
        }
        if (targetCatalogVersion == null) {
            println "ERROR: Target catalog version not found: ${escapedCatalogId}:${escapedTarget}"
            return "TARGET_NOT_FOUND"
        }
    
        // Find sync job using flexible search
        def query = "SELECT {pk} FROM {CatalogVersionSyncJob} WHERE {sourceVersion} = ?source AND {targetVersion} = ?target"
        def params = [source: sourceCatalogVersion, target: targetCatalogVersion]
        def searchResult = flexibleSearchService.search(query, params)
    
        if (searchResult.result.isEmpty()) {
            println "ERROR: No sync job found for ${escapedCatalogId} ${escapedSource} -> ${escapedTarget}"
            println "Available sync jobs:"
            def allJobs = flexibleSearchService.search("SELECT {pk}, {code} FROM {CatalogVersionSyncJob}").result
            allJobs.each { job -> println "  - " + job.code }
            return "SYNC_JOB_NOT_FOUND"
        }
    
        def syncJob = searchResult.result[0]
        println "Found sync job: " + syncJob.code
    
        // Create a new CronJob with all mandatory attributes
        def syncCronJob = modelService.create(CatalogVersionSyncCronJobModel.class)
        syncCronJob.setJob(syncJob)
        syncCronJob.setCode("mcp_sync_" + System.currentTimeMillis())
    
        // Set all mandatory attributes
        syncCronJob.setCreateSavedValues(false)
        syncCronJob.setForceUpdate(false)
        syncCronJob.setLogToDatabase(false)
        syncCronJob.setLogToFile(false)
        syncCronJob.setLogLevelDatabase(JobLogLevel.WARNING)
        syncCronJob.setLogLevelFile(JobLogLevel.WARNING)
    
        modelService.save(syncCronJob)
        println "Created sync cronjob: " + syncCronJob.code
    
        // Trigger the cronjob
        cronJobService.performCronJob(syncCronJob, true)
    
        println "SUCCESS: Catalog sync triggered: ${escapedCatalogId} ${escapedSource} -> ${escapedTarget}"
        return "SUCCESS"
    } catch (Exception e) {
        println "ERROR: " + e.getMessage()
        e.printStackTrace()
  • The input schema definition for the trigger_catalog_sync tool.
    name: 'trigger_catalog_sync',
    description: 'Trigger a catalog synchronization between versions',
    inputSchema: {
      type: 'object',
      properties: {
        catalogId: {
          type: 'string',
          description: 'Catalog ID to sync',
        },
        sourceVersion: {
          type: 'string',
          description: 'Source catalog version (e.g., "Staged")',
        },
        targetVersion: {
          type: 'string',
          description: 'Target catalog version (e.g., "Online")',
  • src/index.ts:462-468 (registration)
    The registration logic in the main switch statement that calls the hybrisClient.triggerCatalogSync handler.
    case 'trigger_catalog_sync':
      result = await hybrisClient.triggerCatalogSync(
        validateString(args, 'catalogId', true),
        validateString(args, 'sourceVersion', true),
        validateString(args, 'targetVersion', true)
      );
      break;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool triggers synchronization but doesn't disclose behavioral traits like whether this is a read-only or destructive operation, what permissions are required, whether it's asynchronous, what happens on failure, or any rate limits. For a tool that likely modifies system state, this is inadequate.

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 and front-loaded with the core action. Every word earns its place.

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?

Given no annotations, no output schema, and a tool that likely performs system modifications (synchronization between versions), the description is incomplete. It doesn't explain what synchronization means operationally, what gets updated, potential side effects, or what the user should expect after invocation. This leaves significant gaps for an agent to use it correctly.

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 all three parameters with clear descriptions. The description doesn't add any meaning beyond what the schema provides about these parameters. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Trigger') and resource ('catalog synchronization between versions'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'trigger_cronjob' or explain what catalog synchronization entails in this specific system context.

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, typical use cases, or when NOT to use it. With sibling tools like 'import_impex' and 'export_impex' that might relate to data management, the lack of differentiation is a significant gap.

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