# Calendars

The 4 tools for calendars. Before an agent first makes one, it reads guide topic calendar.

## create_calendar

Add a calendar to a space: events on their days and times, by month, week or list, as in Google Calendar. Its events are its own (a title, a day or a time, an end, a place, notes, a color); people drag them to another day, click a day to add one, and open one to change it. Read guide topic "calendar" first; check it with render_calendar.

Parameters:
- `space_id` (string, required)
- `title` (string, required): What the calendar holds: "Content calendar", "Launch plan", "Team time off".
- `view` (string): What it opens on: month (the default), week (days with their hours) or list (the events in order, day by day).
- `events` (object[])

## read_calendar

A calendar as it is now: its events in date order, each with its id (what update_calendar and comment take), title, start, end, location, notes and color. Give from and to to read only the events between two days.

Parameters:
- `item_id` (string, required)
- `from` (string): Only events on or after this day (YYYY-MM-DD).
- `to` (string): Only events on or before this day (YYYY-MM-DD).

## update_calendar

Change a calendar: its title and the view it opens on; add events; change events (any of title, start, end, location, notes, color — a new start without an end moves the end with it, so the event keeps its length; end null clears it); delete events (only when the person asked for it). Changes apply in that order.

Parameters:
- `item_id` (string, required)
- `title` (string)
- `view` (string): What it opens on: month (the default), week (days with their hours) or list (the events in order, day by day).
- `add_events` (object[])
- `change_events` (object[])
- `delete_events` (string[]): Events deleted, by id. Deleting can't be undone.

## render_calendar

See a calendar as people do: a screenshot of the view it opens on (by default on the month of the next event), plus checks and errors the page hit. Give date to see another month or week.

Parameters:
- `item_id` (string, required)
- `date` (string): A day in the month or week to show (YYYY-MM-DD).
