Skip to main content
Glama
billyfranklim1

mcp-evolution

Send Poll

send_poll

Send a WhatsApp poll message to a recipient or group. Define the poll question, the number of selectable options, and the list of choices.

Instructions

Send a WhatsApp poll message via the pinned instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesRecipient JID or phone number (e.g. 5511999999999 or group@g.us)
nameYesPoll question/title
selectableCountYesNumber of options the recipient can select
valuesYesArray of poll options (minimum 2)

Implementation Reference

  • Input schema for send_poll tool: number (PhoneOrJidSchema), name (poll question), selectableCount (number of selectable options), values (array of poll options, min 2).
    const schema = {
      number: PhoneOrJidSchema,
      name: z.string().min(1).describe("Poll question/title"),
      selectableCount: z.number().int().min(1).describe("Number of options the recipient can select"),
      values: z.array(z.string().min(1)).min(2).describe("Array of poll options (minimum 2)"),
    };
  • Full implementation of the send_poll tool handler. Registers the tool with the MCP server, sends a POST request to /message/sendPoll/{instanceName} with the poll parameters, and returns the JSON response.
    import { z } from "zod";
    import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { McpError } from "@modelcontextprotocol/sdk/types.js";
    import type { EvolutionClient } from "../evolution-client.js";
    import { PhoneOrJidSchema } from "../schemas.js";
    
    const schema = {
      number: PhoneOrJidSchema,
      name: z.string().min(1).describe("Poll question/title"),
      selectableCount: z.number().int().min(1).describe("Number of options the recipient can select"),
      values: z.array(z.string().min(1)).min(2).describe("Array of poll options (minimum 2)"),
    };
    
    export function registerSendPoll(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "send_poll",
        {
          title: "Send Poll",
          description: "Send a WhatsApp poll message via the pinned instance.",
          inputSchema: schema,
        },
        async (args) => {
          try {
            const data = await client.post(`/message/sendPoll/${client.instanceName}`, {
              number: args.number,
              name: args.name,
              selectableCount: args.selectableCount,
              values: args.values,
            });
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Import of registerSendPoll from send-poll.ts.
    import { registerSendPoll } from "./send-poll.js";
  • Registration call for send_poll tool.
    registerSendPoll(server, client);
  • PhoneOrJidSchema used by send_poll's number field, accepting phone numbers or JIDs.
    export const PhoneOrJidSchema = z
      .string()
      .min(1)
      .describe("Recipient JID or phone number (e.g. 5511999999999 or group@g.us)");
Behavior2/5

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

No annotations are present, so the description carries full burden. It fails to disclose whether the poll is sent immediately, if it requires a connected instance, or any side effects. The term 'pinned instance' is not explained, leaving behavioral ambiguity.

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

Conciseness3/5

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

The description is a single sentence and front-loaded with the action. It is concise but lacks depth, making it minimally useful. Could include more context without becoming verbose.

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?

Given the absence of annotations, output schema, and the complexity of a poll message (with required parameters), the description is too sparse. It does not explain return behavior or prerequisites like instance status.

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?

Input schema covers all 4 parameters with descriptions (100% coverage). The description adds no additional meaning beyond the schema. Baseline of 3 is appropriate as schema already provides semantic clarity.

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

Purpose4/5

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

The description clearly identifies the action (send) and resource (WhatsApp poll message). However, it does not differentiate from sibling tools like send_button or send_list that also send interactive messages. The mention of 'pinned instance' is unique but unexplained.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus other send tools. No alternatives or conditions for use are provided. The agent must infer usage context from the name alone.

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/billyfranklim1/mcp-evolution'

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