get_poll
Retrieve poll metadata and time slot options with their IDs. Get title, status, deadline, location, and all available slots. Use the returned optionId values to vote or finalize the poll.
Instructions
Get poll metadata and time slot options (but NOT votes). Returns title, status, deadline, location, and all available time slots with their option IDs. Use this to retrieve optionId values needed for vote_on_poll or finalize_poll. To see who voted, use get_results instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pollId | Yes | Poll UUID |
Implementation Reference
- src/index.ts:61-75 (registration)Registers the 'get_poll' tool with the MCP server using server.tool(), defining the schema with a pollId string parameter and delegating to handleToolCall('get_poll', ...).
server.tool( "get_poll", TOOL_DESCRIPTIONS.get_poll, { pollId: z.string().describe("Poll UUID"), }, async (args) => { try { const text = await handleToolCall("get_poll", args, client, stdioSession()); return { content: [{ type: "text", text }] }; } catch (e) { return { content: [{ type: "text", text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true }; } }, ); - src/index.ts:62-65 (schema)Input schema for get_poll: requires pollId (string, described as 'Poll UUID').
"get_poll", TOOL_DESCRIPTIONS.get_poll, { pollId: z.string().describe("Poll UUID"), - src/tools.ts:94-105 (handler)Handler for get_poll tool. Parses pollId from args, then calls client.getPoll(pollId) and client.getOptions(pollId) in parallel via Promise.all. Returns poll metadata (title, status, etc.) plus the time slot options array with their IDs.
case "get_poll": { const { pollId } = z.object({ pollId: z.string() }).parse(args); const [poll, options] = await Promise.all([ client.getPoll(pollId), client.getOptions(pollId), ]); return JSON.stringify({ ...poll, options, }, null, 2); } - src/tools.ts:39-43 (schema)Tool description explaining that get_poll returns poll metadata and time slot options (but not votes), and is used to retrieve optionId values for vote_on_poll or finalize_poll.
get_poll: "Get poll metadata and time slot options (but NOT votes). " + "Returns title, status, deadline, location, and all available time slots with their option IDs. " + "Use this to retrieve optionId values needed for vote_on_poll or finalize_poll. " + "To see who voted, use get_results instead.", - src/client.ts:107-109 (helper)Client method getPoll(pollId) that makes a GET request to /api/open/polls/{pollId} and returns a Poll object (containing id, title, status, deadline, location, etc.).
async getPoll(pollId: string): Promise<Poll> { return this.request<Poll>("GET", `/api/open/polls/${pollId}`); }