Skip to content

Availability programs: set

The Availability Verbs set as MCP do programs, with inputs, result, refusals and an example.

Reference for Availability, one group of Availability programs.

Availability.set

Set records the weekly hours a Worker can be booked in and the calendars whose busy times it subtracts. Verb page.

Text
do: return await $.Availability.set(input)

Emits Availability.set.

Inputs

InputTypeRequiredDescription
workerWorkerrequiredWho is booked.
hoursjsonrequiredOpen hours by weekday.
timezonestringrequiredAn IANA time zone.
calendarsstring[]Connected calendars to subtract busy times from.

Returns

OutputTypeRequiredDescription
availabilityAvailabilityrequiredThe Availability, replacing the Worker’s last one.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Availability.set({ worker: 'worker_whZFpOKWIV', hours: { tue: ['09:00-12:00'], thu: ['13:00-17:00'] }, timezone: 'America/Chicago' })"
  }
}