finalize_poll
Select the winning time slot to lock a scheduling poll and notify participants via email.
Instructions
Finalize a poll by picking the winning time slot. Call get_results first to find the best optionId. Uses the passphrase auto-saved from create_poll. If the MCP server was restarted since poll creation, provide the passphrase manually. This locks the poll and notifies participants who provided an email.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pollId | Yes | Poll UUID | |
| optionId | Yes | Winning time slot option UUID (pick from get_results) | |
| passphrase | No | Admin passphrase (auto-used from create_poll if available) |
Implementation Reference
- src/tools.ts:183-207 (handler)The 'finalize_poll' tool handler, responsible for validating inputs, retrieving the passphrase (either from input or session state), obtaining an admin token, and finalizing the poll via the client.
case "finalize_poll": { const input = z.object({ pollId: z.string(), optionId: z.string(), passphrase: z.string().optional(), }).parse(args); const passphrase = input.passphrase || passphraseMap.get(input.pollId); if (!passphrase) { return JSON.stringify({ error: "No passphrase available. Provide the passphrase that was returned when the poll was created.", }); } const adminToken = await client.getAdminToken(input.pollId, passphrase); const result = await client.finalize(input.pollId, input.optionId, adminToken); return JSON.stringify({ success: true, pollId: result.id, title: result.title, status: result.status, finalizedOption: result.finalizedOption, }, null, 2); }