add_schedule
Create or update a cron schedule that sends recurring POST requests to a deployed app endpoint, with timezone, timeout, and overwrite-by-name support.
Instructions
Have this machine POST to a deployed app's path on a timer (cron).
Each due minute the daemon POSTs ``{}`` to the running app with headers
``X-Nerdit-Schedule`` (the name), ``X-Nerdit-Schedule-Run`` (the run id)
and ``X-Nerdit-Schedule-Token``: the app must compare that token, in
constant time, with its ``NERDIT_SCHEDULE_TOKEN`` env var and refuse a
mismatch. Answer ``202`` and work from your own queue for long jobs.
No retry, no overlap (a run still out makes the next ``skipped_overlap``),
one catch-up run after downtime under 24 h. Upsert by name: the same
name with new fields updates it. At most 10 per app.
Refusals: 422 ``schedule.cron_invalid`` / ``schedule.too_frequent`` /
``schedule.path_invalid`` / ``schedule.timezone_unknown`` /
``schedule.name_invalid`` / ``schedule.kind_unsupported``; 409
``schedule.limit_reached``; 409 ``schedule.restart_required`` (the app
was launched by an older daemon: restart it once). Returns
``{schedule, created}``.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"schedule_name": "<schedule_name>",
"cron": "<cron>",
"path": "<path>"
},
"name": "add_schedule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cron | Yes | Five fields: minute hour day-of-month month day-of-week. Digits, ``*``, lists ``a,b``, ranges ``a-b``, steps ``*/n`` and ``a-b/n``; day of week 0-7 (0 and 7 are Sunday); no names, no ``@daily``. At most every 5 minutes, e.g. ``0 7 * * 1-5``. | |
| name | Yes | Name (or row id) of an existing deployed app — only kind 'service' can be exposed: ``share_service``/``add_domain`` refuse a model or database with 422 ``*.kind_unsupported``, while the remove tools just find nothing to undo. | |
| path | Yes | App path the daemon POSTs ``{}`` to, e.g. ``/_agent/run/morning``. | |
| timezone | No | IANA zone the cron reads in (default ``UTC``). | |
| timeout_s | No | Seconds the call may take, 5-900 (default 300). | |
| schedule_name | Yes | Schedule name: lowercase letters, digits and '-', 1-32 characters, starting with a letter (e.g. ``morning``); the app receives it as ``X-Nerdit-Schedule``. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |