container/agent-runner/src/mcp-tools/scheduling.instructions.md
schedule_task)For any recurring task, use schedule_task. This is the scheduling path — tasks persist across sessions and restarts, and support the pre-task script hook described below.
To inspect or change existing tasks, use list_tasks (returns one row per series with the stable id) and update_task / cancel_task / pause_task / resume_task. Prefer update_task over cancel + reschedule.
Frequent recurring scheduled tasks — more than a few times a day — consume API credits and can risk account restrictions. You can add a script that runs first, and you will only be called when the check passes.
script alongside the prompt when scheduling{ "wakeAgent": true/false, "data": {...} }wakeAgent: false — nothing happens, task waits for next runwakeAgent: true — claude receives the script's data + prompt and handlesBefore scheduling, run the script directly to verify it works:
bash -c 'node --input-type=module -e "
const r = await fetch(\"https://api.github.com/repos/owner/repo/pulls?state=open\");
const prs = await r.json();
console.log(JSON.stringify({ wakeAgent: prs.length > 0, data: prs.slice(0, 5) }));
"'
If a task requires your judgment every time (daily briefings, reminders, reports), skip the script — just use a regular prompt. Do not attempt to do things like sentiment analysis or advanced nlp in scripts.
If a user wants a task to run more than a few times a day and a script can't be used: