vote_on_poll
Submit availability votes for time slots in a scheduling poll. Choose 'yes', 'maybe', or 'no' for each option to help determine optimal meeting times.
Instructions
Submit votes on a Timergy poll. First call get_poll to retrieve the available optionId values. Each vote maps an optionId to an availability: 'yes' (available), 'maybe' (might work), or 'no' (unavailable). A unique voter token is auto-generated per voter name. Resubmitting with the same voter name updates previous votes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pollId | Yes | Poll UUID | |
| voterName | Yes | Name of the voter | |
| voterEmail | No | Optional voter email for finalization notification | |
| votes | Yes | One vote per time slot |
Implementation Reference
- src/tools.ts:107-138 (handler)The handler implementation for the `vote_on_poll` tool. It validates the input using Zod, manages a persistent voter token for the session, and calls the `client.vote` method.
case "vote_on_poll": { const input = z.object({ pollId: z.string(), voterName: z.string(), voterEmail: z.string().optional(), votes: z.array(z.object({ optionId: z.string(), availability: z.enum(["yes", "maybe", "no"]), })), }).parse(args); // Reuse or generate voterToken per voter name const tokenKey = `${input.pollId}:${input.voterName}`; let voterToken = voterTokenMap.get(tokenKey); if (!voterToken) { voterToken = randomUUID(); voterTokenMap.set(tokenKey, voterToken); } await client.vote(input.pollId, { voterName: input.voterName, voterToken, voterEmail: input.voterEmail, votes: input.votes, }); return JSON.stringify({ success: true, voterName: input.voterName, votesSubmitted: input.votes.length, }, null, 2); }