Skip to main content
Glama

trigger_cronjob

Execute scheduled tasks in SAP Commerce Cloud by triggering cron jobs using specific job codes to automate system processes.

Instructions

Trigger a cron job to run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cronJobCodeYesCode of the cron job to trigger

Implementation Reference

  • The handler method in HybrisClient that executes a Groovy script to trigger a CronJob by code.
      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'}`,
        };
      }
  • src/index.ts:266-279 (registration)
    Definition of the trigger_cronjob tool, including input schema and description.
    {
      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'],
      },
    },
  • Implementation of the tool call handler for trigger_cronjob in the main index.ts file.
    case 'trigger_cronjob':
      result = await hybrisClient.triggerCronJob(
        validateString(args, 'cronJobCode', 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 the full burden. It states the action ('trigger') but lacks critical behavioral details: whether this requires admin permissions, if it's synchronous or asynchronous, potential side effects (e.g., system load), error handling, or what happens if the cron job is already running. This is inadequate for a mutation tool with zero annotation coverage.

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 front-loaded and appropriately sized for the tool's apparent simplicity, though this conciseness comes at the cost of detail.

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 complexity (a mutation tool that triggers jobs), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, execution mode, or response format, leaving significant gaps for an AI 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%, with the parameter 'cronJobCode' clearly documented in the schema. The description adds no additional meaning beyond the schema—it doesn't explain what a cron job code is, provide examples, or clarify format. 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.

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' states a clear verb ('trigger') and resource ('cron job'), but it's vague about what 'trigger' entails—does it execute immediately, schedule, or test? It doesn't distinguish from siblings like 'get_cronjobs' (which likely lists cron jobs) or 'trigger_catalog_sync' (a specific type of cron job).

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 on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing cron job code), exclusions, or how it differs from sibling tools like 'execute_groovy' (which might run scripts) or 'trigger_catalog_sync' (a specialized cron job).

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