Skip to main content
Glama

get_cronjobs

Retrieve and display all cron jobs with their current status in SAP Commerce Cloud (Hybris) instances for monitoring and management.

Instructions

List all cron jobs and their status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `getCronJobs` method implements the tool logic by executing a FlexibleSearch query on the 'CronJob' type.
    async getCronJobs(): Promise<{ cronJobs: { code: string; active: boolean; status: string }[] }> {
      // Use FlexibleSearch to get cron jobs as HAC doesn't have a direct API
      const result = await this.executeFlexibleSearch(
        "SELECT {code}, {active}, {status} FROM {CronJob} ORDER BY {code}",
        1000
      );
    
      // FlexibleSearch returns resultList as array of arrays, with headers
      if (!this.isFlexSearchResponse(result)) {
        return { cronJobs: [] };
      }
      const resultList = result.resultList || [];
      const headers = result.headers || ['code', 'active', 'status'];
    
      const codeIdx = headers.findIndex(h => h.toLowerCase().includes('code'));
      const activeIdx = headers.findIndex(h => h.toLowerCase().includes('active'));
      const statusIdx = headers.findIndex(h => h.toLowerCase().includes('status'));
    
      return {
        cronJobs: resultList.map((row) => ({
          code: String(row[codeIdx >= 0 ? codeIdx : 0] || ''),
          active: row[activeIdx >= 0 ? activeIdx : 1] === true || row[activeIdx >= 0 ? activeIdx : 1] === 'true',
          status: String(row[statusIdx >= 0 ? statusIdx : 2] || ''),
        })),
      };
  • src/index.ts:258-265 (registration)
    Registration of the 'get_cronjobs' tool in the tool list passed to MCP.
    {
      name: 'get_cronjobs',
      description: 'List all cron jobs and their status',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Handler switch case for 'get_cronjobs' in the main tool execution logic.
    case 'get_cronjobs':
      result = await hybrisClient.getCronJobs();
      break;

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