Skip to main content
Glama

fetch_poll_results

Get poll results from Geekbot to analyze responses or track progress. Use after listing polls to obtain the poll ID.

Instructions

Retrieves Geekbot poll results. Use this tool to analyze poll results or track progress of polls. This tool is usually used after the list_polls tool to get the poll id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poll_idYesID of the specific standup to fetch reports for. If not provided, reports for all standups will be fetched.
beforeNoFetch results before this date (format: YYYY-MM-DD). This is not provided unless explicitly asked by the user.
afterNoFetch results after this date (format: YYYY-MM-DD). This is not provided unless explicitly asked by the user.

Implementation Reference

  • The main handler function that fetches poll results from Geekbot API via the client's get_poll_results method, parses the raw JSON response using poll_results_from_json_response, and returns formatted TextContent.
    async def handle_fetch_poll_results(
        gb_client: GeekbotClient,
        poll_id: int,
        before: str | None = None,
        after: str | None = None,
    ) -> list[types.TextContent]:
        """Fetch poll results from Geekbot
    
        Args:
            poll_id: int, required, the ID of the poll to fetch results for
            before: str, optional, the date to fetch results before in YYYY-MM-DD format
            after: str, optional, the date to fetch results after in YYYY-MM-DD format
        Returns:
            str: Properly formatted JSON string of poll results
        """
        poll_results = await gb_client.get_poll_results(
            poll_id=poll_id, before=before, after=after
        )
        parsed_poll_results = poll_results_from_json_response(poll_results)
    
        return [
            types.TextContent(
                type="text",
                text=json.dumps(parsed_poll_results.model_dump()),
            )
        ]
  • The tool schema definition for fetch_poll_results, defining its name, description, and input schema with poll_id (required integer), before (optional date string), and after (optional date string) parameters.
    fetch_poll_results = types.Tool(
        name="fetch_poll_results",
        description="Retrieves Geekbot poll results. Use this tool to analyze poll results or track progress of polls. This tool is usually used after the `list_polls` tool to get the poll id.",
        inputSchema={
            "type": "object",
            "properties": {
                "poll_id": {
                    "type": "integer",
                    "description": "ID of the specific standup to fetch reports for. If not provided, reports for all standups will be fetched.",
                },
                "before": {
                    "type": "string",
                    "description": "Fetch results before this date (format: YYYY-MM-DD). This is not provided unless explicitly asked by the user.",
                },
                "after": {
                    "type": "string",
                    "description": "Fetch results after this date (format: YYYY-MM-DD). This is not provided unless explicitly asked by the user.",
                },
            },
            "required": ["poll_id"],
        },
    )
  • Registers fetch_poll_results in the list_tools() function so it appears in the MCP server's tool listing.
    def list_tools() -> list[types.Tool]:
        return [
            list_members,
            list_standups,
            fetch_reports,
            post_report,
            list_polls,
            fetch_poll_results,
        ]
  • Dispatches to handle_fetch_poll_results when the tool name 'fetch_poll_results' is matched in the run_tool function.
    async def run_tool(
        gb_client: GeekbotClient,
        name: str,
        arguments: dict[str, str] | None,
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        match name:
            case "list_members":
                return await handle_list_members(gb_client)
            case "list_standups":
                return await handle_list_standups(gb_client)
            case "fetch_reports":
                return await handle_fetch_reports(gb_client, **arguments)
            case "post_report":
                return await handle_post_report(gb_client, **arguments)
            case "list_polls":
                return await handle_list_polls(gb_client)
            case "fetch_poll_results":
                return await handle_fetch_poll_results(gb_client, **arguments)
            case _:
                raise ValueError(f"Tool {name} not found")
  • Helper functions (poll_results_from_json_response and its chain) that parse the raw API response into Pydantic models (PollResults -> PollQuestionResults -> PollQuestionResult -> PollChoiceResult).
    def poll_choice_result_from_json_response(c_res: dict) -> PollChoiceResult:
        return PollChoiceResult(
            text=c_res["text"],
            votes=c_res["votes"],
            percentage=c_res["percentage"],
            users=[user_from_json_response(u) for u in c_res["users"]],
        )
    
    
    def poll_question_result_from_json_response(q_res: dict) -> PollQuestionResult:
        return PollQuestionResult(
            date=q_res["date"],
            choices=[poll_choice_result_from_json_response(c) for c in q_res["answers"]],
        )
    
    
    def poll_question_results_from_json_response(q_res: dict) -> PollQuestionResults:
        return PollQuestionResults(
            question_text=q_res["text"],
            results=[poll_question_result_from_json_response(r) for r in q_res["results"]],
        )
    
    
    def poll_results_from_json_response(p_res: dict) -> PollResults:
        return PollResults(
            num_poll_instances=p_res["total_results"],
            question_results=[
                poll_question_results_from_json_response(q) for q in p_res["questions"]
            ],
        )
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It does not mention whether the operation is read-only, what happens if the poll_id is invalid, or any side effects. This is insufficient for a retrieval tool with no structured behavioral disclosure.

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 is two sentences: first clearly states the action, second provides a usage hint. It is front-loaded and contains no unnecessary words.

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

Completeness2/5

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

With no output schema and three parameters, the description is too brief. It does not explain the return format, pagination, error behavior, or what data is included in the results. Agents need more context to use the tool correctly.

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

Parameters2/5

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

The input schema has 100% coverage with descriptions, but the poll_id description says 'ID of the specific standup to fetch reports for', which appears inconsistent with the tool name (polls vs standups). The tool description does not clarify or correct this, so it does not add meaningful value beyond the schema and may even mislead.

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 states 'Retrieves Geekbot poll results' with a specific verb and resource, and also provides use cases (analyze results, track progress). It implies differentiation from siblings like list_polls (which lists polls) by noting it is used after list_polls.

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

Usage Guidelines3/5

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

The description mentions it is 'usually used after the list_polls tool to get the poll id', providing a sequential usage hint. However, it does not explicitly compare to alternatives like fetch_reports or state when not to use this tool.

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/geekbot-com/geekbot-mcp'

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