send_message
Send text messages to Telegram channels using specified parse modes like HTML or Markdown for automated bot communication and content distribution.
Instructions
Send a text message to the Telegram channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parse_mode | No | Parse mode (HTML, Markdown, or MarkdownV2) | |
| text | Yes | Message text to send |
Implementation Reference
- src/index.ts:334-352 (handler)The handler for the 'send_message' tool. Extracts text and optional parse_mode from arguments, sends the message to the specified Telegram channel using bot.sendMessage, and returns a formatted success response with message details.case 'send_message': { const { text, parse_mode = 'HTML' } = args as { text: string; parse_mode?: string; }; const result = await bot.sendMessage(CHANNEL_ID, text, { parse_mode: parse_mode as any, }); return { content: [ { type: 'text', text: `✅ Message sent successfully!\n\n📱 Channel: ${CHANNEL_ID}\n📝 Message ID: ${result.message_id}\n📄 Text: ${result.text}\n📅 Date: ${new Date(result.date * 1000).toLocaleString()}`, }, ], }; }
- src/index.ts:61-79 (schema)The input schema definition for the 'send_message' tool, specifying required 'text' parameter and optional 'parse_mode'.{ name: 'send_message', description: 'Send a text message to the Telegram channel', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'Message text to send', }, parse_mode: { type: 'string', enum: ['HTML', 'Markdown'], description: 'Parse mode for the message (HTML or Markdown)', }, }, required: ['text'], }, },