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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/hybris-client.ts:636-660 (handler)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: {}, }, }, - src/index.ts:442-444 (handler)Handler switch case for 'get_cronjobs' in the main tool execution logic.
case 'get_cronjobs': result = await hybrisClient.getCronJobs(); break;