mavis_cron_delete
Delete a scheduled cron task owned by a specific agent in the multi-agent system.
Instructions
Delete a cron job.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentName | Yes | Agent name or ID that owns the cron task | |
| cronName | Yes | Cron task name |
Implementation Reference
- src/index.js:334-344 (registration)Tool definition/registration for mavis_cron_delete. Defines name, description, input schema (agentName, cronName), sets execFn to execMavis, outputMode to OUTPUT_RAW, and buildArgs to construct CLI arguments ['cron', 'delete', agentName, cronName].
{ name: 'mavis_cron_delete', description: 'Delete a cron job.', inputSchema: z.object({ agentName: z.string().describe('Agent name or ID that owns the cron task'), cronName: z.string().describe('Cron task name') }), execFn: execMavis, outputMode: OUTPUT_RAW, buildArgs: ({ agentName, cronName }) => ['cron', 'delete', agentName, cronName] }, - src/index.js:32-53 (handler)The execMavis function that executes the tool logic. Spawns the MAVIS_BIN CLI process with the constructed args (['cron', 'delete', agentName, cronName]), captures stdout/stderr, resolves with trimmed stdout on success, rejects with stderr on error.
function execMavis(args, input = '') { return new Promise((resolve, reject) => { const SESSION_COMMANDS = new Set(['communication', 'session', 'spawn']); const sessionId = process.env.__MAVIS_PARENT_SESSION_ID; const subcmd = args[0]; const needsSession = SESSION_COMMANDS.has(subcmd) && sessionId; const finalArgs = needsSession ? [...args, '--session', sessionId] : args; const proc = spawn(MAVIS_BIN, finalArgs, { stdio: ['pipe', 'pipe', 'pipe'] }); let stdout = ''; let stderr = ''; proc.stdout.on('data', d => stdout += d.toString()); proc.stderr.on('data', d => stderr += d.toString()); proc.on('close', code => { if (code === 0) resolve(stdout.trim()); else reject(new Error(stderr.split('\n')[0] || `exit code ${code}`)); }); proc.on('error', reject); if (input) proc.stdin.write(input), proc.stdin.end(); }); } - src/index.js:337-340 (schema)Input schema definition for mavis_cron_delete. Uses Zod to define two required string fields: agentName and cronName.
inputSchema: z.object({ agentName: z.string().describe('Agent name or ID that owns the cron task'), cronName: z.string().describe('Cron task name') }), - src/index.js:77-92 (helper)The runTool function that invokes the tool. For mavis_cron_delete, it uses execMavis (since execFn is set), passes the built args, and returns the raw string result (since outputMode is OUTPUT_RAW).
function runTool(spec, parsedArgs) { const { execFn, outputMode, stdin, buildArgs } = spec; const args = buildArgs(parsedArgs); const input = typeof stdin === 'function' ? stdin(parsedArgs) : stdin; const execPromise = execFn ? execMavis(args, input || '') : execMavisJSON(args); return execPromise.then(result => { const text = outputMode === OUTPUT_RAW ? (result || '') : JSON.stringify(result, null, 2); return [{ type: 'text', text }]; }); }