Skip to main content
Glama
Emenowicz

Hybris MCP Server

by Emenowicz

trigger_cronjob

Execute scheduled tasks in SAP Commerce Cloud by triggering cron jobs with specific codes for system administration and automation.

Instructions

Trigger a cron job to run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cronJobCodeYesCode of the cron job to trigger

Implementation Reference

  • The MCP tool handler for 'trigger_cronjob': validates the input argument 'cronJobCode' and delegates execution to the HybrisClient's triggerCronJob method.
    case 'trigger_cronjob':
      result = await hybrisClient.triggerCronJob(
        validateString(args, 'cronJobCode', true)
      );
      break;
  • Input schema definition for the 'trigger_cronjob' tool, specifying the required 'cronJobCode' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        cronJobCode: {
          type: 'string',
          description: 'Code of the cron job to trigger',
        },
      },
      required: ['cronJobCode'],
    },
  • src/index.ts:266-279 (registration)
    Registration of the 'trigger_cronjob' tool in the MCP tools array.
    {
      name: 'trigger_cronjob',
      description: 'Trigger a cron job to run',
      inputSchema: {
        type: 'object',
        properties: {
          cronJobCode: {
            type: 'string',
            description: 'Code of the cron job to trigger',
          },
        },
        required: ['cronJobCode'],
      },
    },
  • HybrisClient helper method that implements the core logic for triggering a cron job using a Groovy script executed via the HAC scripting console, leveraging CronJobService to perform the job.
      async triggerCronJob(cronJobCode: string): Promise<{ success: boolean; message: string }> {
        // Use Groovy script to trigger cron job
        const escapedCode = this.escapeGroovyString(cronJobCode);
        const script = `
    import de.hybris.platform.servicelayer.cronjob.CronJobService
    
    def cronJobService = spring.getBean("cronJobService")
    def cronJob = cronJobService.getCronJob("${escapedCode}")
    if (cronJob == null) {
        println "CronJob not found: ${escapedCode}"
        return "NOT_FOUND"
    }
    cronJobService.performCronJob(cronJob, true)
    println "CronJob triggered: ${escapedCode}"
    return "SUCCESS"
    `;
        const result = await this.executeGroovyScript(script);
        const output = result.output || '';
        const execResult = String(result.result || '');
        const success = output.includes('triggered') || execResult === 'SUCCESS';
        return {
          success,
          message: success
            ? `CronJob ${cronJobCode} triggered`
            : `Failed to trigger ${cronJobCode}: ${output || execResult || 'Unknown error'}`,
        };
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('trigger') but lacks critical details: whether this is a read-only or mutating operation (likely mutating, but unspecified), permission requirements, side effects (e.g., job execution logs, system load), or error handling. This leaves significant gaps in understanding the tool's behavior.

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 extremely concise at four words ('Trigger a cron job to run'), with no wasted language. It front-loads the core action ('trigger') and target ('cron job'), making it easy to parse quickly. Every word earns its place by conveying essential purpose without redundancy.

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 the tool's complexity (likely a mutating operation with no annotations or output schema), the description is incomplete. It doesn't explain what happens after triggering (e.g., success/failure response, job status changes) or address behavioral aspects like idempotency or rate limits. For a tool that could impact system operations, this leaves too much undefined.

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?

The input schema has 100% description coverage, with 'cronJobCode' documented as 'Code of the cron job to trigger'. The description adds no additional parameter semantics beyond this, such as format examples (e.g., alphanumeric string) or where to find valid codes. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema handles the heavy lifting.

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

Purpose3/5

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

The description 'Trigger a cron job to run' clearly states the action (trigger) and target (cron job), making the basic purpose understandable. However, it lacks specificity about what 'trigger' entails (e.g., immediate execution, manual override) and doesn't distinguish this tool from potential siblings like 'get_cronjobs' or 'trigger_catalog_sync', leaving room for ambiguity.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., cron job must exist), exclusions (e.g., cannot trigger disabled jobs), or comparisons to sibling tools like 'get_cronjobs' (for listing) or 'trigger_catalog_sync' (for a specific type of job), leaving the agent to infer usage context.

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/Emenowicz/hybris-mcp'

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