get_cronjobs
List and check the status of all cron jobs in SAP Commerce Cloud (Hybris) instances for system administration and monitoring.
Instructions
List all cron jobs and their status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/hybris-client.ts:620-645 (handler)Core handler function implementing get_cronjobs tool logic by executing FlexibleSearch query for CronJob items and processing results into structured format.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)MCP tool registration defining the get_cronjobs tool name, description, and input schema (no parameters required).{ name: 'get_cronjobs', description: 'List all cron jobs and their status', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:434-436 (handler)Tool dispatching handler in MCP server that invokes the HybrisClient.getCronJobs method upon tool call.case 'get_cronjobs': result = await hybrisClient.getCronJobs(); break;