reachthingsDocs
EN
Dashboard
Schedule toolscreate_schedule
On this page
TOOLscope: devices:control · idempotentHint

create_schedule

Schedules a device command for a specific time (once) or on a daily or weekly recurrence. The server stores it and a worker runs it, so it persists after the conversation ends. Give times as the user's local time in their IANA timezone; if you do not know the timezone, ask the user before calling. Actions that need approval are stored as pending_approval and run only after the owner approves the schedule in the console. Accepting a schedule is not a successful run; check results with list_schedule_runs.

Arguments

device_idstringrequired

From list_devices.

actionstringrequired

An action the device supports.

parametersobject

Validated like an immediate action. Defaults to {}.

timezonestringrequired

IANA timezone, e.g. Asia/Seoul. Missing or an abbreviation → TIMEZONE_REQUIRED. The server timezone is never used.

recurrenceobjectrequired

{kind:"once", at:"YYYY-MM-DDTHH:MM"}, {kind:"daily", time:"HH:MM"} or {kind:"weekly", time:"HH:MM", weekdays:[0–6]} (0 = Sunday).

ends_onstring

Last local date for a recurrence, YYYY-MM-DD.

grace_minutesinteger · 1–1440

Skip the run if it is this many minutes late. Default 15.

labelstring · ≤60

Shown in the dashboard.

request_keystring · 8–128required

Idempotency key for creation.

Returns: Schedule

statusenum

pending_approval active paused blocked cancelled completed, with status_reason.

recurrenceobject

{kind:"once", at}, {kind:"daily", time} or {kind:"weekly", time, weekdays}; recurrence_text is a human sentence.

next_run_at · next_run_localstring | null

Next run in UTC and in the schedule's timezone. null when nothing is left to run.

versioninteger

Increases when the target, command, time or recurrence changes. A schedule that needs approval must be approved again for the new version.

approvalobject

required, state (not_required pending approved expired), approved_version, expires_at and, when required, the console url.

grace_minutes · dst_policy · notes

Late runs beyond the grace period are skipped, never replayed. DST: a local time that does not exist moves forward; one that occurs twice runs the first time.

Request

REQUESTTypeScript ▾
await client.callTool({
  name: "create_schedule",
  arguments: {
    device_id: "dev_8kq2",
    action: "climate.set_temperature",
    parameters: { temperature: 24, unit: "C" },
    timezone: "Asia/Seoul",
    recurrence: { kind: "weekly", time: "08:00", weekdays: [1, 2, 3, 4, 5] },
    ends_on: "2026-12-31",
    label: "Weekday morning AC",
    request_key: "sch-weekday-ac-001"
  }
});
RESPONSE · structuredContent
{
  "schedule_id": "sch_7Qp2",
  "status": "active",
  "status_reason": null,
  "label": "Weekday morning AC",
  "device_id": "dev_8kq2",
  "action": "climate.set_temperature",
  "parameters": {
    "temperature": 24,
    "unit": "C"
  },
  "timezone": "Asia/Seoul",
  "recurrence": {
    "kind": "weekly",
    "time": "08:00",
    "weekdays": [
      1,
      2,
      3,
      4,
      5
    ]
  },
  "recurrence_text": "Weekly Mon·Tue·Wed·Thu·Fri 08:00",
  "ends_on": "2026-12-31",
  "next_run_at": "2026-11-02T23:00:00.000Z",
  "next_run_local": "2026-11-03 08:00 (Tue)",
  "last_run_at": null,
  "version": 1,
  "grace_minutes": 15,
  "approval": {
    "required": false,
    "state": "not_required",
    "approved_version": null,
    "expires_at": null
  },
  "dst_policy": "DST handling: a local time that does not exist (spring-forward gap) runs at the real time shifted forward by the gap; a local time that occurs twice (fall-back overlap) runs at the first occurrence.",
  "notes": []
}
Errors: TIMEZONE_REQUIRED, SCHEDULE_INVALID, plus the same access checks as execute_device_action (DEVICE_NOT_ACCESSIBLE, PERMISSION_DENIED, ACTION_NOT_SUPPORTED, INVALID_PARAMETERS).