# Polls

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

## create_poll

Make a poll in a space: a question (the title) and options people vote on — one each, or several — with the results live as they vote: counts, shares and who voted for what (unless anonymous). The votes are kept in a spreadsheet or a database table of the space (votes_to; left out, a new sheet of its own), a row per vote, where people see and use them like any other data. For a team decision, a date, a venue, a name, a priority; with open_options, an idea board. People vote; you read the results with read_poll. Read guide topic "polls" first; check it with render_poll.

Parameters:
- `space_id` (string, required)
- `title` (string, required): The question, as people will read it: "Where should we hold the Q1 offsite?"
- `options` (object[], required): The choices, in the order they show.
- `votes_to` (object): Where the votes are kept, one row (or record) per vote: Voted at (UTC), Who, Option, Voter ID. Left out, a new spreadsheet "<question> — votes" of its own.
- `description` (string): Under the question: the context people need to choose — what is being decided, by when, what happens with the result.
- `multiple` (boolean): People may pick more than one option (default: one).
- `max_choices` (integer): With multiple: at most this many each.
- `anonymous` (boolean): Show only how many voted for each option, never who (the votes' Who is left blank). Set it before anyone votes.
- `open_options` (boolean): Anyone who can vote may add an option of their own (an idea board).
- `closes_at` (string): When voting ends: an ISO time "2026-11-05T17:00:00Z", or a day "2026-11-05" (its end, UTC).

## read_poll

A poll as it is now, counted from its votes: the question, whether it is open, where the votes are kept, and each option with its id (what update_poll and comment take), its votes, its share of the voters and who voted for it (names; none when anonymous), the leaders and how many people voted; problems with the votes (rows for no option, a votes tab that is gone).

Parameters:
- `item_id` (string, required)

## update_poll

Change a poll. Any of: title (the question); description, multiple, max_choices, anonymous (before the first vote), open_options, closes_at (null to clear); closed (true ends voting now, false opens it again); add_options; change_options (by id: title, description, image, url; "" clears one — a new title renames its votes too); remove_options (their votes are deleted with them); move_options (to a 0-based place); clear_votes (deletes everyone's votes, to start over — only when the person asks); votes_to (where votes go from now on; the votes so far are copied there). Applied in that order. People's votes are theirs: never vote for them.

Parameters:
- `item_id` (string, required)
- `title` (string)
- `description` (string | null)
- `multiple` (boolean)
- `max_choices` (integer | null)
- `anonymous` (boolean)
- `open_options` (boolean)
- `closes_at` (string | null)
- `closed` (boolean)
- `add_options` (object[])
- `change_options` (object[])
- `remove_options` (string[])
- `move_options` (object[])
- `clear_votes` (boolean)
- `votes_to` (object): Where the votes are kept, one row (or record) per vote: Voted at (UTC), Who, Option, Voter ID. Left out, a new spreadsheet "<question> — votes" of its own.

## render_poll

See a poll as people do: a screenshot of the question, the options with their pictures, and the results bars as they stand, plus checks (fewer than two options, a closing time passed, a limit that limits nothing, problems with the votes) and errors the page hit.

Parameters:
- `item_id` (string, required)
