Skip to main content
Glama
bobidk91-ops

Telegram MCP Server

by bobidk91-ops

send_poll

Create and send interactive polls to Telegram channels with customizable questions, multiple options, and anonymous voting settings for gathering feedback and engagement.

Instructions

Create and send a poll to the Telegram channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
is_anonymousNoWhether the poll is anonymous
optionsYesPoll options (2-10 items)
questionYesPoll question
typeNoPoll typeregular

Implementation Reference

  • The switch case handler that executes the 'send_poll' tool. It destructures arguments, validates the number of options, sends the poll via Telegram bot, and returns a formatted success response.
    case 'send_poll': {
      const { question, options, is_anonymous = true, type = 'regular' } = args as {
        question: string;
        options: string[];
        is_anonymous?: boolean;
        type?: string;
      };
      
      if (options.length < 2 || options.length > 10) {
        throw new Error('Poll must have between 2 and 10 options');
      }
      
      const result = await bot.sendPoll(CHANNEL_ID, question, options, {
        is_anonymous,
        type: type as any,
      });
      
      return {
        content: [
          {
            type: 'text',
            text: `āœ… Poll created successfully!\n\nšŸ“± Channel: ${CHANNEL_ID}\nšŸ“ Message ID: ${result.message_id}\nā“ Question: ${question}\nšŸ“Š Options: ${options.length}\nšŸ”’ Anonymous: ${is_anonymous ? 'Yes' : 'No'}\nšŸ“‹ Type: ${type}`,
          },
        ],
      };
    }
  • src/index.ts:103-132 (registration)
    The tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for 'send_poll'.
    {
      name: 'send_poll',
      description: 'Create and send a poll to the Telegram channel',
      inputSchema: {
        type: 'object',
        properties: {
          question: {
            type: 'string',
            description: 'Poll question',
          },
          options: {
            type: 'array',
            items: { type: 'string' },
            minItems: 2,
            maxItems: 10,
            description: 'Poll options (2-10 items)',
          },
          is_anonymous: {
            type: 'boolean',
            description: 'Whether the poll is anonymous (default: true)',
          },
          type: {
            type: 'string',
            enum: ['quiz', 'regular'],
            description: 'Poll type (default: regular)',
          },
        },
        required: ['question', 'options'],
      },
    },
  • The detailed input schema for the 'send_poll' tool, specifying properties, types, descriptions, and required fields.
    inputSchema: {
      type: 'object',
      properties: {
        question: {
          type: 'string',
          description: 'Poll question',
        },
        options: {
          type: 'array',
          items: { type: 'string' },
          minItems: 2,
          maxItems: 10,
          description: 'Poll options (2-10 items)',
        },
        is_anonymous: {
          type: 'boolean',
          description: 'Whether the poll is anonymous (default: true)',
        },
        type: {
          type: 'string',
          enum: ['quiz', 'regular'],
          description: 'Poll type (default: regular)',
        },
      },
      required: ['question', 'options'],
    },

Tool Definition Quality

Score is being calculated. Check back soon.

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/bobidk91-ops/telegram-mcp-server'

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