MCPcopy Index your code
hub / github.com/codeaashu/claude-code / validateInput

Function validateInput

src/tools/ScheduleCronTool/CronDeleteTool.ts:61–81  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

59 return getCronFilePath()
60 },
61 async validateInput(input): Promise<ValidationResult> {
62 const tasks = await listAllCronTasks()
63 const task = tasks.find(t => t.id === input.id)
64 if (!task) {
65 return {
66 result: false,
67 message: `No scheduled job with id '${input.id}'`,
68 errorCode: 1,
69 }
70 }
71 // Teammates may only delete their own crons.
72 const ctx = getTeammateContext()
73 if (ctx && task.agentId !== ctx.agentId) {
74 return {
75 result: false,
76 message: `Cannot delete cron job '${input.id}': owned by another agent`,
77 errorCode: 2,
78 }
79 }
80 return { result: true }
81 },
82 async call({ id }) {
83 await removeCronTasks([id])
84 return { data: { id } }

Callers

nothing calls this directly

Calls 2

listAllCronTasksFunction · 0.85
getTeammateContextFunction · 0.85

Tested by

no test coverage detected