Skip to main content
Glama

get_results

Retrieve voting results for a Timergy poll, showing yes/maybe/no counts per time slot, to identify the slot with the highest availability.

Instructions

Get voting results for a Timergy poll, showing who voted yes/maybe/no for each time slot. Use this after participants have voted to see which slot has the most availability. To finalize, pick the optionId with the most 'yes' votes and call finalize_poll.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pollIdYesPoll UUID

Implementation Reference

  • Main handler for get_results tool case in handleToolCall. Parses pollId from args, fetches poll metadata, options, and votes via client.getResults(), then groups votes by option (yes/maybe/no) and returns a JSON summary with counts and voter names per time slot.
    case "get_results": {
      const { pollId } = z.object({ pollId: z.string() }).parse(args);
      const [poll, options, votes] = await Promise.all([
        client.getPoll(pollId),
        client.getOptions(pollId),
        client.getResults(pollId),
      ]);
    
      // Group votes by option
      const grouped = new Map<string, { option: typeof options[0]; yes: string[]; maybe: string[]; no: string[] }>();
      for (const opt of options) {
        grouped.set(opt.id, { option: opt, yes: [], maybe: [], no: [] });
      }
      for (const v of votes) {
        const group = grouped.get(v.optionId);
        if (!group) continue;
        const name = v.voterName || "Anonymous";
        if (v.availability === "yes") group.yes.push(name);
        else if (v.availability === "maybe") group.maybe.push(name);
        else if (v.availability === "no") group.no.push(name);
      }
    
      const summary = Array.from(grouped.values()).map((g) => ({
        optionId: g.option.id,
        start: g.option.start,
        end: g.option.end,
        yesCount: g.yes.length,
        maybeCount: g.maybe.length,
        noCount: g.no.length,
        yesVoters: g.yes,
        maybeVoters: g.maybe,
        noVoters: g.no,
      }));
    
      return JSON.stringify({
        pollId,
        title: poll.title,
        status: poll.status,
        finalizedOptionId: poll.finalizedOptionId,
        results: summary,
      }, null, 2);
    }
  • Tool description for get_results, documenting its purpose and expected usage pattern.
      get_results:
        "Get voting results for a Timergy poll, showing who voted yes/maybe/no for each time slot. " +
        "Use this after participants have voted to see which slot has the most availability. " +
        "To finalize, pick the optionId with the most 'yes' votes and call finalize_poll.",
    
      finalize_poll:
        "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.",
    };
  • src/index.ts:99-113 (registration)
    Registers the get_results tool with the MCP server, defining pollId as the sole input parameter with Zod validation, and delegating execution to handleToolCall.
    server.tool(
      "get_results",
      TOOL_DESCRIPTIONS.get_results,
      {
        pollId: z.string().describe("Poll UUID"),
      },
      async (args) => {
        try {
          const text = await handleToolCall("get_results", 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 };
        }
      },
    );
  • HTTP client method that fetches the voting results for a poll from the Timergy API (GET /api/open/polls/{pollId}/results). Returns an array of Vote objects.
    async getResults(pollId: string): Promise<Vote[]> {
      const data = await this.request<{ votes: Vote[] }>("GET", `/api/open/polls/${pollId}/results`);
      return data.votes;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It explains the tool returns voting results per time slot but does not detail the response format, error conditions, or any side effects. It provides a high-level outcome but lacks specifics needed for full behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of two concise sentences. The first sentence states the purpose, and the second provides usage guidance. Every sentence is valuable, and there is no redundancy or waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has one parameter and no output schema, the description provides adequate context: purpose, when to use, and subsequent action. It lacks a detailed description of the return format, but the mention of 'showing who voted yes/maybe/no for each time slot' gives a sufficient high-level picture.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description does not add significant new meaning about the pollId parameter beyond what the schema already provides. The description gives context on what the results contain, but that relates to output semantics rather than the parameter itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'voting results for a Timergy poll', and specifies it shows who voted yes/maybe/no for each time slot. It effectively distinguishes the tool from siblings like create_poll and finalize_poll.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this after participants have voted' and provides a use case for determining the most available slot. It also guides the next step: call finalize_poll with the optionId. However, it does not explicitly compare to alternatives or mention when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/timergy-app/timergy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server