Skip to main content

Availability and Schedules

Fyso's scheduling system calculates availability automatically from three entities.

Required Entities

To use the scheduling system, the tenant must have these three entities:

horarios

Defines the regular schedules for each professional.

FieldTypeDescription
profesional_idrelationReference to the professional
rruletextRecurrence rule (RFC 5545 / RRule format)
hora_iniciotextStart time (HH:MM)
hora_fintextEnd time (HH:MM)
duracion_turnonumberDuration of each slot in minutes
activobooleanWhether the schedule is active

Example rrule: RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR (Monday to Friday).

excepciones_horario

Defines exceptions to the regular schedule (holidays, special days).

FieldTypeDescription
profesional_idrelationReference to the professional
fechadateException date (YYYY-MM-DD)
tiposelect"bloqueado" (unavailable) or "horario_especial"
hora_iniciotextStart time (only for horario_especial)
hora_fintextEnd time (only for horario_especial)

turnos

The booked appointments.

FieldTypeDescription
profesional_idrelationReference to the professional
paciente_idrelationReference to the patient/client
fechadateAppointment date (YYYY-MM-DD)
horatextAppointment time (HH:MM)
duracionnumberDuration in minutes
estadoselect"confirmado", "cancelado", etc.
notastextareaOptional notes

MCP Tool: get_available_slots

Profile: core

Calculates available slots considering schedules, exceptions, and existing appointments.

Parameters

ParameterTypeRequiredDescription
profesional_idstringYesProfessional's UUID
fechastringNoSpecific date (YYYY-MM-DD)
desdestringNoRange start (YYYY-MM-DD)
hastastringNoRange end (YYYY-MM-DD, max 90 days)

Provide fecha for a single day, or desde/hasta for a range.

Example: Single Day

get_available_slots({
profesional_id: "uuid-del-profesional",
fecha: "2026-02-20"
})

Example: Date Range

get_available_slots({
profesional_id: "uuid-del-profesional",
desde: "2026-02-20",
hasta: "2026-02-28"
})

Response

[
{ "fecha": "2026-02-20", "hora": "09:00", "duracion": 30, "profesional_id": "uuid" },
{ "fecha": "2026-02-20", "hora": "09:30", "duracion": 30, "profesional_id": "uuid" },
{ "fecha": "2026-02-20", "hora": "10:00", "duracion": 30, "profesional_id": "uuid" }
]

Calculation Logic

  1. Gets the active schedules for the professional
  2. Generates slots based on hora_inicio, hora_fin, and duracion_turno
  3. Applies the recurrence rule (rrule) to determine which days it applies
  4. Excludes blocked dates and adjusts special schedules
  5. Excludes slots that already have a confirmed appointment
Creado con Fyso